Class EDI

java.lang.Object
ubc.team09.player.EDI
All Implemented Interfaces:
VI

public class EDI extends Object implements VI
The flagship VI for this project. EDI uses a lightweight, single-threaded implementation of alpha-beta search with heavily optimized operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    EDI()
    Creates a new instance of EDI.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    consult(State state)
    Returns the VI's recommended move.
    setColor(byte color)
    Tells the VI which color they should make decisions for; i.e., which player they should try to maximize the score for.
    setTimeLimit(int seconds)
    Imposes a time limit for each turn that the VI takes.

    Methods inherited from class Object

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

    • EDI

      public EDI()
      Creates a new instance of EDI. Before consulting this instance, you must make sure that you use setColor(byte) and setTimeLimit(int). E.g.,
      VI edi = new EDI();
      
      // Set the color of the player we want EDI to make decisions on behalf
      // of.
      edi.setColor(C.WHITE);
      
      // Set the time alloted per decision.
      edi.setTimeLimit(10); // 10 seconds
      
      // Given a board state, have EDI recommend a move.
      int move = edi.consult(state);
      
      The move result is encoded as an int. In order to make use of such a move, see the Move class which has static methods for getting details about the move.
  • Method Details

    • consult

      public int consult(State state)
      Description copied from interface: VI
      Returns the VI's recommended move.

      See Move to use the move value.
      Specified by:
      consult in interface VI
      Parameters:
      state - The current board state.
      Returns:
      An integer encoding of the move.
    • setColor

      public EDI setColor(byte color)
      Description copied from interface: VI
      Tells the VI which color they should make decisions for; i.e., which player they should try to maximize the score for.

      See C
      Specified by:
      setColor in interface VI
      Parameters:
      color - 0 for White, 1 for black.
      Returns:
      The configured VI.
    • setTimeLimit

      public EDI setTimeLimit(int seconds)
      Description copied from interface: VI
      Imposes a time limit for each turn that the VI takes.
      Specified by:
      setTimeLimit in interface VI
      Parameters:
      seconds - The number of seconds allotted.
      Returns:
      The configured VI.