Files
Craftimizer/Solver/Crafty/RootScores.cs
T
Asriel Camora 636501ab86 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.
2023-07-07 20:17:35 +02:00

19 lines
360 B
C#

using System.Runtime.InteropServices;
namespace Craftimizer.Solver.Crafty;
[StructLayout(LayoutKind.Auto)]
public sealed class RootScores
{
public float ScoreSum;
public float MaxScore;
public int Visits;
public void Visit(float score)
{
ScoreSum += score;
MaxScore = Math.Max(MaxScore, score);
Visits++;
}
}