636501ab86
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.
19 lines
360 B
C#
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++;
|
|
}
|
|
}
|