Skip to content

Commit

Permalink
Fix Optimal solver when MaxQuality == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Dec 3, 2024
1 parent c7558af commit 8ce9605
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Solver/Solver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ void OnProgress(nuint p)
Token.ThrowIfCancellationRequested();
}


if (solution == null || ExecuteActions(solution).HQPercent != 100)
var state = solution != null ? (SimulationState?)ExecuteActions(solution) : null;
if (solution == null || state?.Quality != state?.Input.Recipe.MaxQuality)
{
Raphael.SolverConfig config = new()
{
Expand Down

1 comment on commit 8ce9605

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 8ce9605 Previous: f89203a Ratio
Craftimizer.Benchmark.Bench.Solve(State: 05B7B4D9, Config: FB5C8580) 102160524.28571428 ns (± 760305.9880855085)
Craftimizer.Benchmark.Bench.Solve(State: BA05D45F, Config: FB5C8580) 72999848.33333333 ns (± 608020.3515131435)

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.