Interface IGamePosition<P extends IGamePosition<P>>

All Known Implementing Classes:
ArtificialGamePosition, BstarSquaredDB.L1Position, BstarSquaredSimple.L1Position, BstarSquaredSimpleMax.L1Position, BstarSquaredVariant.L1Position, SimplePosition, VariantAGP

public interface IGamePosition<P extends IGamePosition<P>>
This interface represents a game position in any game which can be modelled as an adversarial or non-adversarial game.

Either one player takes action in each move with a series of moves leading to a final state or score, OR, one player aims to maximise a score against another player aiming to minimise that score.

The 'minimising player' can be more than one player, but applying this model to multi-player games assumes a strategy akin to Paranoid Search. This is when the maximising player p assumes all other players are cooperating to minimise p's score.

Version:
1.0
Author:
Pascal Anema
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    This method should be implemented with a hash that still remains different from similar states if a mask is applied to the hash.
    double
    The lower-bound value is the lower bound on the game-theoretical mini-max value of this game position.
    boolean
     
     
    double
    The upper-bound value is the upper bound on the game-theoretical mini-max value of this game position.
  • Method Details

    • next

      Collection<P> next()
      Returns:
      The collection of game positions directly reachable by moves from the current player to move in this game position.
    • upperbound

      double upperbound()
      The upper-bound value is the upper bound on the game-theoretical mini-max value of this game position.

      For the maximising player this is the best value achievable under perfect play.

      For the minimising player this is the worst-case value achievable under perfect play.

      Returns:
      The upper-bound value for this game position
    • lowerbound

      double lowerbound()
      The lower-bound value is the lower bound on the game-theoretical mini-max value of this game position.

      For the maximising player this is the minimum value that can be guaranteed under perfect play.

      For the minimising player this is the best value achievable under perfect play.

      Returns:
      The lower-bound value for this game position
    • maximising

      boolean maximising()
      Returns:
      true if the current player-to-move is maximising the score, or false if it is minimising the score.
    • hash

      long hash()
      This method should be implemented with a hash that still remains different from similar states if a mask is applied to the hash. Commonly, a transposition table implementation may only use the first 20 to 26 bits of the hash to use as an index, so the hash should try to minimise collisions regardless of how many bits are included for the index.
      Returns:
      a 64-bit zobrist hash or other kind of game-state hash that represents this state.