Fix: heuristic save on Iterative Deepening

This commit is contained in:
Yorick Barbanneau 2023-12-21 21:46:13 +01:00
parent 5f69c5ed9f
commit 5cfd2ce404

View file

@ -330,6 +330,7 @@ class MinmaxDeepeningPlayerEngine(MinmaxPlayerEngine):
# return the current move onli if heuristic is better than previous # return the current move onli if heuristic is better than previous
# iteration # iteration
if current_heuristic > heuristic: if current_heuristic > heuristic:
heuristic = current_heuristic
move = current_move move = current_move
depth = depth + 1 depth = depth + 1
@ -375,6 +376,7 @@ class AlphaBetaDeepeningPlayerEngine(AlphabetaPlayerEngine):
# return the current move only if heuristic is better than previous # return the current move only if heuristic is better than previous
# iteration can be possible id iteration is stopped by timer # iteration can be possible id iteration is stopped by timer
if current_heuristic > heuristic: if current_heuristic > heuristic:
heuristic = current_heuristic
move = current_move move = current_move
depth = depth + 1 depth = depth + 1