Compare commits
2 commits
025860fc8f
...
6d8273617c
Author | SHA1 | Date | |
---|---|---|---|
|
6d8273617c | ||
|
fd37388339 |
1 changed files with 3 additions and 4 deletions
|
@ -57,7 +57,6 @@ initial_state([ [f, g, a],
|
||||||
initial_state([ [e, f, g],
|
initial_state([ [e, f, g],
|
||||||
[d,vide,h],
|
[d,vide,h],
|
||||||
[c, b, a] ]). % h2=24, f*=30
|
[c, b, a] ]). % h2=24, f*=30
|
||||||
|
|
||||||
initial_state([ [a, b, c],
|
initial_state([ [a, b, c],
|
||||||
[g,vide,d],
|
[g,vide,d],
|
||||||
[h, f, e]]). % etat non connexe avec l'etat final (PAS DE SOLUTION)
|
[h, f, e]]). % etat non connexe avec l'etat final (PAS DE SOLUTION)
|
||||||
|
@ -180,8 +179,8 @@ delete(N,X,[Y|L], [Y|R]) :-
|
||||||
%*************
|
%*************
|
||||||
|
|
||||||
heuristique(U,H) :-
|
heuristique(U,H) :-
|
||||||
heuristique1(U, H). % au debut on utilise l'heuristique 1
|
% heuristique1(U, H). % au debut on utilise l'heuristique 1
|
||||||
% heuristique2(U, H). % ensuite utilisez plutot l'heuristique 2
|
heuristique2(U, H). % ensuite utilisez plutot l'heuristique 2
|
||||||
|
|
||||||
|
|
||||||
%****************
|
%****************
|
||||||
|
@ -207,7 +206,7 @@ diff(_,_) :- true.
|
||||||
|
|
||||||
heuristique1(U,H) :-
|
heuristique1(U,H) :-
|
||||||
findall(X,
|
findall(X,
|
||||||
(final_state(Fin), coordonnees([L,C], U, X)
|
(final_state(Fin), coordonnees([L,C], U, X),
|
||||||
coordonnees([L,C], Fin, Y), diff(X,Y)),
|
coordonnees([L,C], Fin, Y), diff(X,Y)),
|
||||||
Count),
|
Count),
|
||||||
length(Count, H).
|
length(Count, H).
|
||||||
|
|
Loading…
Reference in a new issue