s3games.player

## Class AbstractMonteCarloPlayer

- java.lang.Object
- - s3games.player.Player
  - - s3games.player.AbstractMonteCarloPlayer

- Direct Known Subclasses:
    MonteCarloClassicPlayer, MonteCarloRatioPlayer, MonteCarloRatioPlayer2

      public abstract class AbstractMonteCarloPlayer
      extends Player

  Holds common code shared by all monte-carlo players

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class s3games.player.Player

      `Player.boardType, Player.playerType`

  - ### Field Summary

    - ### Fields inherited from class s3games.player.Player

      `maxNodes, number`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMonteCarloPlayer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `addScore(GameState gs, int i)` add to the scores depending on the game result of this trial
    `protected abstract double` | `calculateScore(int i)` calculate the score of the player after all trials ended
    `protected abstract void` | `initializeRatio()` initialize ratio that is specific for one trial
    `protected abstract void` | `initializeScore(int i)` initialize the scores of all players before starting the trials
    `Move` | `move(GameState state, java.util.ArrayList<Move> allowedMoves)` make a move.
    `protected abstract void` | `updateRatio(GameState gs, java.util.Set<Move> moves)` update the ratio depending on the branching in the current state

    - ### Methods inherited from class s3games.player.Player

      `isComputer, otherMoved, ratioTimeLeft, setMaximumNumberOfNodes, setMaxTime, setPlayerNumber, startMove, timeUsed`

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

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

- - ### Constructor Detail

    - #### AbstractMonteCarloPlayer

          public AbstractMonteCarloPlayer()

  - ### Method Detail

    - #### move

          public Move move(GameState state,
                  java.util.ArrayList<Move> allowedMoves)
                    throws java.lang.Exception

      make a move. run many random game developments from the current state, and look at which move has a higher success rate
      Specified by:
        `move` in class `Player`
      Throws:
        `java.lang.Exception`

    - #### addScore

          protected abstract void addScore(GameState gs,
                      int i)

      add to the scores depending on the game result of this trial

    - #### calculateScore

          protected abstract double calculateScore(int i)

      calculate the score of the player after all trials ended

    - #### initializeScore

          protected abstract void initializeScore(int i)

      initialize the scores of all players before starting the trials

    - #### initializeRatio

          protected abstract void initializeRatio()

      initialize ratio that is specific for one trial

    - #### updateRatio

          protected abstract void updateRatio(GameState gs,
                         java.util.Set<Move> moves)

      update the ratio depending on the branching in the current state