controllers.sampleMCTS

## Class SingleMCTSPlayer

- java.lang.Object
- - controllers.sampleMCTS.SingleMCTSPlayer

-     public class SingleMCTSPlayer
      extends java.lang.Object

  Created with IntelliJ IDEA. User: Diego Date: 07/11/13 Time: 17:13

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.util.Random` | `m_rnd` Random generator.
    `SingleTreeNode` | `m_root` Root of the tree.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingleMCTSPlayer(java.util.Random a_rnd)` Creates the MCTS player with a sampleRandom generator object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `init(StateObservation a_gameState)` Inits the tree with the new observation state in the root.
    `int` | `run(ElapsedCpuTimer elapsedTimer)` Runs MCTS to decide the action to take.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### m_root

          public SingleTreeNode m_root

      Root of the tree.

    - #### m_rnd

          public java.util.Random m_rnd

      Random generator.

  - ### Constructor Detail

    - #### SingleMCTSPlayer

          public SingleMCTSPlayer(java.util.Random a_rnd)

      Creates the MCTS player with a sampleRandom generator object.
      Parameters:
        `a_rnd` - sampleRandom generator object.

  - ### Method Detail

    - #### init

          public void init(StateObservation a_gameState)

      Inits the tree with the new observation state in the root.
      Parameters:
        `a_gameState` - current state of the game.

    - #### run

          public int run(ElapsedCpuTimer elapsedTimer)

      Runs MCTS to decide the action to take. It does not reset the tree.
      Parameters:
        `elapsedTimer` - Timer when the action returned is due.
      Returns:
        the action to execute in the game.