s3games.player

## Class MonteCarloRatioPlayer

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

-     public class MonteCarloRatioPlayer
      extends AbstractMonteCarloPlayer

  A version of a monte-carlo player that calculates the winning trials scaled with a quotient that is calculated as a multiply of 1/N_i constants, where N_i is branching in the opponent move state. The idea is that the winning trial that is far and prone to not be selected due to other options of the opponent should be less valuable than a winning trial that is reachable in each case regardless the opponents selection.

- - ### 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
    `MonteCarloRatioPlayer()` construct a new monte carlo player

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addScore(GameState gs, int i)` add the score after each trial
    `protected double` | `calculateScore(int i)` calculate the score after all trials finished
    `protected void` | `initializeRatio()` each trial starts with ratio = 1
    `protected void` | `initializeScore(int i)` initialize the scores before all trials are started
    `protected void` | `updateRatio(GameState gs, java.util.Set<Move> moves)` opponent moves are taxing the ratio depending on the state neighborhood size

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

      `move`

    - ### 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

    - #### MonteCarloRatioPlayer

          public MonteCarloRatioPlayer()

      construct a new monte carlo player

  - ### Method Detail

    - #### initializeRatio

          protected void initializeRatio()

      each trial starts with ratio = 1
      Specified by:
        `initializeRatio` in class `AbstractMonteCarloPlayer`

    - #### updateRatio

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

      opponent moves are taxing the ratio depending on the state neighborhood size
      Specified by:
        `updateRatio` in class `AbstractMonteCarloPlayer`

    - #### initializeScore

          protected void initializeScore(int i)

      initialize the scores before all trials are started
      Specified by:
        `initializeScore` in class `AbstractMonteCarloPlayer`

    - #### addScore

          protected void addScore(GameState gs,
                      int i)

      add the score after each trial
      Specified by:
        `addScore` in class `AbstractMonteCarloPlayer`

    - #### calculateScore

          protected double calculateScore(int i)

      calculate the score after all trials finished
      Specified by:
        `calculateScore` in class `AbstractMonteCarloPlayer`