Fix including unjustified decisions

This commit is contained in:
tool4EvEr
2023-01-13 19:32:16 +01:00
parent 7ef1f64870
commit c2cea6fb3c
2 changed files with 4 additions and 3 deletions

View File

@@ -81,9 +81,11 @@ public class SimulationController {
}
public void doneEvaluating(Score score) {
if (score.value > bestScore.value) {
// if we're here during a deeper level this hasn't been called for the level above yet
// in such case we need to check that this decision has really lead to the improvement in score
if (getLastDecision().initialScore.value < score.value && score.value > bestScore.value) {
bestScore = score;
bestSequence = currentStack.get(currentStack.size() - 1);
bestSequence = getLastDecision();
}
currentStack.remove(currentStack.size() - 1);
}