public class SingleMCTSPlayer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Random |
randomGenerator
Random generator.
|
Constructor and Description |
---|
SingleMCTSPlayer(java.util.Random randomGenerator,
Agent agent)
Public constructor with a sampleRandom generator object.
|
Modifier and Type | Method and Description |
---|---|
void |
init(StateObservation gameState)
Initializes the tree with the new observation state in the root.
|
double |
rollOut(StateObservation _currentObservation)
Plays random moves until the simulation ends (either because we do MCTSRolloutDepth moves, or the game ends)
|
int |
run(ElapsedCpuTimer elapsedTimer)
Runs MCTS to decide the action to take.
|
public SingleMCTSPlayer(java.util.Random randomGenerator, Agent agent)
randomGenerator
- sampleRandom generator object.public void init(StateObservation gameState)
gameState
- current state of the game.public int run(ElapsedCpuTimer elapsedTimer)
elapsedTimer
- Timer when the action returned is due.public double rollOut(StateObservation _currentObservation)
_currentObservation
- the initial state observation