ai
Class Variation

java.lang.Object
  extended by ai.Variation

public class Variation
extends Object

A Variation represents the sequence of optimal plays from a game state. It is an immutable linked list, where each cell contains a move, the value associated with that cell, and the length of the list.

Specification Fields

Constructor Summary
Variation(int value)
           
 
Method Summary
 Variation cdr()
           
 Variation cons(Move move)
           
 int getDepth()
           
 Move getMove()
           
 int getValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variation

public Variation(int value)
Method Detail

getValue

public int getValue()
Returns:
The value for this player with this variation.

getMove

public Move getMove()
Returns:
The move at this point of the variation.

getDepth

public int getDepth()
Returns:
The depth from this point of the variation.

cons

public Variation cons(Move move)
Returns:
A new variation with a given Move as the first move and this as the rest.

cdr

public Variation cdr()
Returns:
The rest of the Variation.