Remove all concurrency code

Muddled the code too much, and only gave a marginal performance improvement in the grand scheme of things. Other ways to parallelize MCTS will be nicer to implement and could yield better results.
This commit is contained in:
Asriel Camora
2023-07-07 20:17:35 +02:00
parent 3ab50d389e
commit 636501ab86
11 changed files with 153 additions and 431 deletions
+6 -6
View File
@@ -46,22 +46,22 @@ internal static class Program
var config = new SolverConfig()
{
Iterations = 100_000,
Iterations = 30_000,
ThreadCount = 8,
};
Debugger.Break();
var s = Stopwatch.StartNew();
if (true) {
(_, var state) = SolverUtils.SearchStepwise<SolverSingle>(config, input, a => Console.WriteLine(a));
(_, var state) = Solver.Crafty.Solver.SearchStepwise(config, input, a => Console.WriteLine(a));
Console.WriteLine($"Qual: {state.Quality}/{state.Input.Recipe.MaxQuality}");
}
else
{
(var actions, _) = SolverUtils.SearchOneshot<SolverConcurrent>(config, input);
foreach (var action in actions)
Console.Write($">{action.IntName()}");
Console.WriteLine();
//(var actions, _) = SolverUtils.SearchOneshot<SolverConcurrent>(config, input);
//foreach (var action in actions)
// Console.Write($">{action.IntName()}");
//Console.WriteLine();
}
s.Stop();
Console.WriteLine($"{s.Elapsed.TotalMilliseconds:0.00}");