Class HistoryTable

java.lang.Object
ubc.team09.search.HistoryTable

public class HistoryTable extends Object
A history table is used to track which moves have produced cutoffs in the past and increments their score accordingly. When searching the game tree, the history table can be used to order child states. Since this approach only involves table lookups, it's much faster than just about any other ordering method, and the quality of the ordering has been shown to be far more effective than ordering by evaluation scores.
See Also
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    A comparator for states that orders them in descending order based on their history scores.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new, empty history table.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    increaseScore(int move, int depth)
    Used to indicate that a move is sufficient; i.e., it's score should be increased.
    int
    score(int move)
    Gets the history score of a move.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • descending

      public final Comparator<State> descending
      A comparator for states that orders them in descending order based on their history scores.
  • Constructor Details

    • HistoryTable

      public HistoryTable()
      Creates a new, empty history table.
  • Method Details

    • score

      public int score(int move)
      Gets the history score of a move.

      See Move.
    • increaseScore

      public void increaseScore(int move, int depth)
      Used to indicate that a move is sufficient; i.e., it's score should be increased. This should be used whenever a move produces a cutoff.
      Parameters:
      depth - The depth at which the cutoff was found. Greater depths (i.e., those closer to the root) prune more branches, and are thus given higher history scores.