Split solver into MCTS and algorithms
This commit is contained in:
+10
-6
@@ -9,8 +9,16 @@ public sealed class Simulator : SimulatorNoRandom
|
||||
{
|
||||
private readonly int maxStepCount;
|
||||
|
||||
public new CompletionState CompletionState => CalculateCompletionState(State, maxStepCount);
|
||||
public override bool IsComplete => CompletionState != CompletionState.Incomplete;
|
||||
public override CompletionState CompletionState
|
||||
{
|
||||
get
|
||||
{
|
||||
var b = base.CompletionState;
|
||||
if (b == CompletionState.Incomplete && (ActionCount + 1) >= maxStepCount)
|
||||
return CompletionState.MaxActionCountReached;
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
public Simulator(SimulationState state, int maxStepCount) : base(state)
|
||||
{
|
||||
@@ -187,8 +195,4 @@ public sealed class Simulator : SimulatorNoRandom
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static CompletionState CalculateCompletionState(SimulationState state, int maxStepCount) =>
|
||||
state.ActionCount + 1 >= maxStepCount ?
|
||||
CompletionState.MaxActionCountReached :
|
||||
(CompletionState)CalculateCompletionState(state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user