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) { 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; bestScore = score;
bestSequence = currentStack.get(currentStack.size() - 1); bestSequence = getLastDecision();
} }
currentStack.remove(currentStack.size() - 1); currentStack.remove(currentStack.size() - 1);
} }

View File

@@ -254,7 +254,6 @@ public class Cost implements Serializable {
else else
manaParts.append(part).append(" "); manaParts.append(part).append(" ");
} }
} }
if (parsedMana == null && (manaParts.length() > 0 || xCantBe0)) { if (parsedMana == null && (manaParts.length() > 0 || xCantBe0)) {