Index
All Classes and Interfaces|All Packages|Constant Field Values
A
- activePlayer - Variable in class ubc.team09.state.State
-
The player who can make a move from this position.
- AlphaBeta - Class in ubc.team09.search
-
Alpha-Beta Search
- AlphaBeta() - Constructor for class ubc.team09.search.AlphaBeta
- AlphaBeta(State, HeuristicMethod, byte) - Constructor for class ubc.team09.search.AlphaBeta
- Alpha-Beta Search - Section in class ubc.team09.search.AlphaBeta
- Ansi - Class in ubc.team09.view
-
Contains a set of constants that represent ANSI codes, which we use to color the CLI display.
- arrow(int) - Static method in class ubc.team09.state.Move
-
Reads the position where the queen fires an arrow from a move.
B
- BG_BLACK - Static variable in class ubc.team09.view.Ansi
- BG_BLUE - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_BLACK - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_BLUE - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_CYAN - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_GREEN - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_MAGENTA - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_RED - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_WHITE - Static variable in class ubc.team09.view.Ansi
- BG_BRIGHT_YELLOW - Static variable in class ubc.team09.view.Ansi
- BG_CYAN - Static variable in class ubc.team09.view.Ansi
- BG_GREEN - Static variable in class ubc.team09.view.Ansi
- BG_MAGENTA - Static variable in class ubc.team09.view.Ansi
- BG_RED - Static variable in class ubc.team09.view.Ansi
- BG_WHITE - Static variable in class ubc.team09.view.Ansi
- BG_YELLOW - Static variable in class ubc.team09.view.Ansi
- BitBoard - Class in ubc.team09.bitboard
-
A bitboard is a means of representing a board such that each square is represented by a single bit.
- BitBoards - Section in package ubc.team09.bitboard
- BLACK - Static variable in class ubc.team09.state.C
- BLINK - Static variable in class ubc.team09.view.Ansi
- BoardState - Class in ubc.team09.state
-
Represents a board state.
- BoardState(long[], byte[]) - Constructor for class ubc.team09.state.BoardState
-
Creates a new minimal state.
- BoardState(BoardState, int) - Constructor for class ubc.team09.state.BoardState
-
Creates a new state by applying the given move to an old state.
- BOLD - Static variable in class ubc.team09.view.Ansi
C
- C - Class in ubc.team09.state
-
"C" for constants.
- checkTime() - Method in class ubc.team09.search.TimeConstrained
-
Throws a
TimeoutExceptionif the timer is expired. - checkTimeOccasionally() - Method in class ubc.team09.search.TimeConstrained
-
Once every ~1000 calls, this function will check the time and throw a
TimeoutExceptionif the timer is expired. - children() - Method in class ubc.team09.state.State
-
Returns a generator which yields all possible child states.
- clear() - Static method in class ubc.team09.view.Display
- clear(int) - Static method in class ubc.team09.view.Ansi
- clear(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Zeroes a bitboard.
- connect() - Method in class ubc.team09.player.Player
- consult(State) - Method in class ubc.team09.player.EDI
- consult(State) - Method in interface ubc.team09.player.VI
-
Returns the VI's recommended move.
- copy() - Method in class ubc.team09.state.State
-
Returns a copy of this state.
- copy(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Creates a copy of a bitboard.
- copyTo(long[], long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Copies the
srcbitboard into thedstbitboard. - count(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns the number of flags in the bitboard.
- create() - Static method in class ubc.team09.bitboard.BitBoard
-
Creates a new bitboard for representing a 10x10 board (i.e., there are at least 100 bits).
D
- descending - Variable in class ubc.team09.search.HistoryTable
-
A comparator for states that orders them in descending order based on their history scores.
- DIM - Static variable in class ubc.team09.view.Ansi
- Display - Class in ubc.team09.view
-
A class with static methods to display information and prompt users for input via the CLI.
- distance(byte, long[]) - Static method in class ubc.team09.state.QGraph
-
Given an origin, returns the distance from that point to each other point on the board.
E
- E - Static variable in class ubc.team09.bitboard.P
-
Represents the "East" direction; i.e., greater column indices.
- EDI - Class in ubc.team09.player
-
The flagship VI for this project.
- EDI() - Constructor for class ubc.team09.player.EDI
-
Creates a new instance of EDI.
- EDI Core - Section in Overview
- encode(byte, byte, byte, byte) - Static method in class ubc.team09.state.Move
-
Encodes a move as an integer.
- end(int) - Static method in class ubc.team09.state.Move
-
Reads the ending position (of the queen) from a move.
- equals(BoardState) - Method in class ubc.team09.state.BoardState
-
Returns
trueif and only if the given state has the same occupancy board and queen positions as this object. - ERASE_SCREEN - Static variable in class ubc.team09.view.Ansi
- evaluate(State) - Method in interface ubc.team09.eval.HeuristicMethod
-
Returns a number in the range of (-∞, +∞) where lower values indicate a more favorable position for Black, and greater values indicate a more favorable position for White.
- evaluate(State) - Method in class ubc.team09.eval.KMinDist
- evaluate(State) - Method in class ubc.team09.eval.QMinDist
- evaluate(State) - Method in class ubc.team09.eval.X
- Example - Section in class ubc.team09.search.AlphaBeta
F
- FG_BLACK - Static variable in class ubc.team09.view.Ansi
- FG_BLUE - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_BLACK - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_BLUE - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_CYAN - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_GREEN - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_MAGENTA - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_RED - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_WHITE - Static variable in class ubc.team09.view.Ansi
- FG_BRIGHT_YELLOW - Static variable in class ubc.team09.view.Ansi
- FG_CYAN - Static variable in class ubc.team09.view.Ansi
- FG_GREEN - Static variable in class ubc.team09.view.Ansi
- FG_MAGENTA - Static variable in class ubc.team09.view.Ansi
- FG_RED - Static variable in class ubc.team09.view.Ansi
- FG_WHITE - Static variable in class ubc.team09.view.Ansi
- FG_YELLOW - Static variable in class ubc.team09.view.Ansi
- flag(long[], byte) - Static method in class ubc.team09.bitboard.BitBoard
-
Flags the specified index (i.e., sets it to
1in the bitboard). - flagCopy(long[], byte) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns a copy of the given bitboard, but with the specified index flagged.
- flagged(long[], byte) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns
trueif and only if the indexed bit is flagged (i.e., if it is1in the bitboard).
G
- Game Player - Section in package ubc.team09.player
- Game State Representation - Section in package ubc.team09.state
- Game Tree Search - Section in package ubc.team09.search
- General Structure - Section in Overview
- getArrowPosition(int) - Static method in class ubc.team09.player.Util
-
Takes a move from the standard integer encoding and returns a server- appropriate ArrayList that represents it's starting position.
- getEndPosition(int) - Static method in class ubc.team09.player.Util
-
Takes a move from the standard integer encoding and returns a server- appropriate ArrayList that represents it's starting position.
- getGameClient() - Method in class ubc.team09.player.Player
- getGameGUI() - Method in class ubc.team09.player.Player
- getStartPosition(int) - Static method in class ubc.team09.player.Util
-
Takes a move from the standard integer encoding and returns a server- appropriate ArrayList that represents it's starting position.
H
- handleGameMessage(String, Map) - Method in class ubc.team09.player.Player
- handleMessage(String, String) - Method in class ubc.team09.player.Player
- HeuristicMethod - Interface in ubc.team09.eval
-
This defines the interface that describes a heuristic method for evaluating a board state.
- HIDDEN - Static variable in class ubc.team09.view.Ansi
- HistoryTable - Class in ubc.team09.search
-
A history table is used to track which moves have produced cutoffs in the past and increments their score accordingly.
- HistoryTable() - Constructor for class ubc.team09.search.HistoryTable
-
Creates a new, empty history table.
I
- impose(BoardState) - Method in class ubc.team09.state.State
-
Updates this board's occupancy and queen positions to match the given board.
- inclusiveRay - Static variable in class ubc.team09.bitboard.P
-
A matrix that stores the bitboards that represent rays a queen can move along based on (1) the starting position index and (2) the direction of the move.
- increaseScore(int, int) - Method in class ubc.team09.search.HistoryTable
-
Used to indicate that a move is sufficient; i.e., it's score should be increased.
- initial() - Static method in class ubc.team09.state.BoardState
-
Creates the initial board state.
- initialBoard() - Static method in class ubc.team09.player.Util
-
Generates the starting Amazons board state.
- isConsistentWith(State) - Method in class ubc.team09.state.BoardState
-
Returns
trueif and only if the given state has the same occupancy board and queen positions as this object. - isEmpty(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns
trueif and only if the bitboard is all zeros. - isLegal(BoardState, int) - Static method in class ubc.team09.state.Move
-
Returns
trueif and only if a move is legal from a given board state. - isLegal(State, int) - Static method in class ubc.team09.state.Move
-
Returns
trueif and only if a move is legal from a given board state. - isTerminal(byte) - Method in class ubc.team09.state.BoardState
-
Returns
trueif and only if there are no moves that could be made from this position. - ITALIC - Static variable in class ubc.team09.view.Ansi
K
- KGraph - Class in ubc.team09.state
-
This class includes operations that model the board state as a graph, where
- vertices are board positions, and
- two verticesvanduare adjacent if and only if a king could move from one to the other in a single move.
The king-move definition of edges is the reason for the "K" in the name. - kingAttack - Static variable in class ubc.team09.bitboard.P
-
A matrix that stores the squares that are adjacent to the indexed position, meaning that a chess King could move from the position to any of the flagged positions.
- KMinDist - Class in ubc.team09.eval
-
This evaluation is identical to
QMinDist, except that this one claims territory for each color if they would need fewer King moves to reach it, rather than the traditional distance calculation using queen moves. - KMinDist() - Constructor for class ubc.team09.eval.KMinDist
L
- lsb(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns the position index (0-99) of the least-significant bit.
M
- main(String[]) - Static method in class ubc.team09.Main
- Main - Section in package ubc.team09
- Main - Class in ubc.team09
-
The main entrypoint for the program.
- Main() - Constructor for class ubc.team09.Main
- move - Variable in class ubc.team09.state.State
-
The move that created this board state.
- move(long[], byte, byte, long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Moves a flag from one position to another.
- Move - Class in ubc.team09.state
-
This class is used to handle moves on the board.
- Move() - Constructor for class ubc.team09.state.Move
- MOVE_CURSOR_TO_LINE_START - Static variable in class ubc.team09.view.Ansi
- moveCopy(long[], byte, byte) - Static method in class ubc.team09.bitboard.BitBoard
-
Moves a flag from one position to another.
- moveCursor(int, int) - Static method in class ubc.team09.view.Ansi
- msb(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns the position index (0-99) of the most-significant bit.
N
- N - Static variable in class ubc.team09.bitboard.P
-
Represents the "North" direction; i.e., lesser row indices.
- NE - Static variable in class ubc.team09.bitboard.P
-
Represents the "Northeast" direction.
- neighbors(byte, long[]) - Static method in class ubc.team09.state.KGraph
-
Returns a bitboard with flags for each position adjacent to
position. - neighbors(byte, long[]) - Static method in class ubc.team09.state.QGraph
-
Returns a bitboard with flags for each position adjacent to
position. - neighbors(long[], long[]) - Static method in class ubc.team09.state.KGraph
-
Given a set of origins (on a bitboard) and an occupancy board, this returns a board where each position is flagged if and only if it is adjacent to any one of the origins.
- neighbors(long[], long[]) - Static method in class ubc.team09.state.QGraph
-
Given a set of origins (on a bitboard) and an occupancy board, this returns a board where each position is flagged if and only if it is adjacent to any one of the origins.
- next() - Method in class ubc.team09.state.StateGenerator
-
Yields the next child state.
- not(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Inverts all bits on the board.
- notCopy(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns a new bitboard with all the bits opposite of the original, which is left unchanged.
- NULL_MOVE - Static variable in class ubc.team09.state.Move
-
Represents a null move.
- NW - Static variable in class ubc.team09.bitboard.P
-
Represents the "Northwest" direction.
O
- occupancy - Variable in class ubc.team09.state.BoardState
-
An occupancy board; i.e., a bitboard that has a flag wherever there is a queen or an arrow.
- occupancy - Variable in class ubc.team09.state.State
-
An occupancy board; i.e., a bitboard that has a flag wherever there is a queen or an arrow.
- onLogin() - Method in class ubc.team09.player.Player
P
- P - Class in ubc.team09.bitboard
-
This class stores precomputed (abbreviated to "P" for convenience) bitboards.
- parseMove(BoardState, Map) - Static method in class ubc.team09.player.Util
-
Formats the message details of a message of the type
GAME_ACTION_MOVEinto the standard integer representation. - parseState(Map) - Static method in class ubc.team09.player.Util
-
Parses the occupancy board and queen positions from a
GAME_STATE_BOARDorGAME_ACTION_STARTmessage. - player(int) - Static method in class ubc.team09.state.Move
-
Reads the active player from a move.
- Player - Class in ubc.team09.player
-
This class handles communication with the game server.
- Player(String, VI, byte, int) - Constructor for class ubc.team09.player.Player
-
Creates a new game player which consults the given
VIfor decisions. - poll(long[]) - Static method in class ubc.team09.bitboard.BitBoard
-
Removes the least-significant bit from the board and returns its index.
- printBlinkingText(int, String) - Static method in class ubc.team09.view.Display
- printBoard(State, String) - Static method in class ubc.team09.view.Display
-
Prints a board state to the console.
- printBoard(State, String, String, String) - Static method in class ubc.team09.view.Display
-
Prints a board state to the console.
- printGameBoard(BoardState, int, String, String, String, LinkedList) - Static method in class ubc.team09.view.Display
-
Prints a board state to the console.
- printSystemMessages(LinkedList) - Static method in class ubc.team09.view.Display
- printText(int, String) - Static method in class ubc.team09.view.Display
- prompt(String, List) - Static method in class ubc.team09.view.Display
-
Prompts the user for an input string, but only accepts values specified by
options. - prompt(String, Map) - Static method in class ubc.team09.view.Display
-
Prompts the user for a string, but only allows values specified by
options. - promptInt(String) - Static method in class ubc.team09.view.Display
-
Prompts the user for an integer input.
- promptString(String) - Static method in class ubc.team09.view.Display
-
Prompts the user for a string input.
Q
- QGraph - Class in ubc.team09.state
-
This class includes operations that model the board state as a graph, where
- vertices are board positions, and
- two verticesvanduare adjacent if and only if a queen could move from one to the other in a single move.
The queen-move definition of edges is the reason for the "Q" in the name. - QMinDist - Class in ubc.team09.eval
-
This evaluation is identical to
KMinDist, except that this one claims territory for each color if they would need fewer Queen moves to reach it. - QMinDist() - Constructor for class ubc.team09.eval.QMinDist
- queens - Variable in class ubc.team09.state.BoardState
-
The position indices of the queens on the board.
- queens - Variable in class ubc.team09.state.State
-
The position indices of the queens on the board.
R
- randomBoard(double) - Static method in class ubc.team09.player.Util
-
Generates a random Amazons boardstate.
- ray - Static variable in class ubc.team09.bitboard.P
-
A matrix that stores the bitboards that represent rays a queen can move along based on (1) the starting position index and (2) the direction of the move.
- Remarks - Section in class ubc.team09.search.AlphaBeta
- RESET - Static variable in class ubc.team09.view.Ansi
- RESET_CURSOR - Static variable in class ubc.team09.view.Ansi
- restoreCursor() - Static method in class ubc.team09.view.Ansi
- REVERSE - Static variable in class ubc.team09.view.Ansi
S
- S - Static variable in class ubc.team09.bitboard.P
-
Represnts the "South" direction; i.e., greater row indices.
- saveCursor() - Static method in class ubc.team09.view.Ansi
- score(int) - Method in class ubc.team09.search.HistoryTable
-
Gets the history score of a move.
- SE - Static variable in class ubc.team09.bitboard.P
-
Represents the "Southeast" direction.
- search() - Method in class ubc.team09.search.AlphaBeta
- search() - Method in interface ubc.team09.search.SearchMethod
-
Conducts a search of the game tree and yields the best move.
- SearchMethod - Interface in ubc.team09.search
-
Defines the interface of a game tree search method.
- See Also - Section in class ubc.team09.search.AlphaBeta
- setBoard(State) - Method in class ubc.team09.search.AlphaBeta
- setBoard(State) - Method in interface ubc.team09.search.SearchMethod
-
The board state to search from.
- setColor(byte) - Method in class ubc.team09.player.EDI
- setColor(byte) - Method in interface ubc.team09.player.VI
-
Tells the VI which color they should make decisions for; i.e., which player they should try to maximize the score for.
- setColor(byte) - Method in class ubc.team09.search.AlphaBeta
- setColor(byte) - Method in interface ubc.team09.search.SearchMethod
-
Indicates which player we want the search to find the ideal move for.
- setHeuristic(HeuristicMethod) - Method in class ubc.team09.search.AlphaBeta
- setMaxDepth(int) - Method in class ubc.team09.search.AlphaBeta
- setShowOutput(boolean) - Method in class ubc.team09.search.AlphaBeta
- setShowOutput(boolean) - Method in interface ubc.team09.search.SearchMethod
-
Indicates that you want the search to print feedback to the console.
- setTimeLimit(int) - Method in class ubc.team09.player.EDI
- setTimeLimit(int) - Method in interface ubc.team09.player.VI
-
Imposes a time limit for each turn that the VI takes.
- setTimeLimit(int) - Method in interface ubc.team09.search.SearchMethod
-
Sets the a time constraint on the search.
- setTimeLimit(int) - Method in class ubc.team09.search.TimeConstrained
-
Sets a time constraint on the process.
- setTimeLimitMs(long) - Method in interface ubc.team09.search.SearchMethod
-
Sets a time constraint on the search.
- setTimeLimitMs(long) - Method in class ubc.team09.search.TimeConstrained
-
Sets a time constraint on the process.
- square - Static variable in class ubc.team09.bitboard.P
-
Stores bitboards that have only a single square flagged; the indexed position.
- start(int) - Static method in class ubc.team09.state.Move
-
Reads the starting position (of the queen) from a move.
- startTimer() - Method in class ubc.team09.search.TimeConstrained
-
Begins the timer.
- State - Class in ubc.team09.state
-
Represents a complete game state.
- State(long[], byte[], byte, int) - Constructor for class ubc.team09.state.State
-
Creates a new game state.
- State(State, int) - Constructor for class ubc.team09.state.State
-
Creates a new board state by applying a move to an existing one.
- StateGenerator - Class in ubc.team09.state
-
This class is used to iterate over child states, generating them on demand.
- StateGenerator(State) - Constructor for class ubc.team09.state.StateGenerator
-
Creates a new generator to iterate over the children of a given game state.
- Static Game State Evaluation - Section in package ubc.team09.eval
- STRIKETHROUGH - Static variable in class ubc.team09.view.Ansi
- SW - Static variable in class ubc.team09.bitboard.P
-
Represents the "Southwest" direction.
T
- Terminology and Conventions - Section in Overview
- TimeConstrained - Class in ubc.team09.search
-
This class should be extended if you want to impose a time constraint on some process.
- TimeConstrained() - Constructor for class ubc.team09.search.TimeConstrained
U
- ubc.team09 - package ubc.team09
-
Main
- ubc.team09.bitboard - package ubc.team09.bitboard
-
BitBoards
- ubc.team09.eval - package ubc.team09.eval
-
Static Game State Evaluation
- ubc.team09.player - package ubc.team09.player
-
Game Player
- ubc.team09.search - package ubc.team09.search
-
Game Tree Search
- ubc.team09.state - package ubc.team09.state
-
Game State Representation
- ubc.team09.view - package ubc.team09.view
-
User Interface
- UNDERLINE - Static variable in class ubc.team09.view.Ansi
- unflag(long[], byte) - Static method in class ubc.team09.bitboard.BitBoard
-
Un-flags the specified index (i.e., sets it to
0in the bitboard). - unflagCopy(long[], byte) - Static method in class ubc.team09.bitboard.BitBoard
-
Returns a copy of the given bitboard, but with the specified index un- flagged.
- UNREACHABLE - Static variable in class ubc.team09.state.QGraph
- User Interface - Section in package ubc.team09.view
- userName() - Method in class ubc.team09.player.Player
- Util - Class in ubc.team09.player
-
A class that contains a set of general utility functions used for communicating with the game server.
V
- VI - Interface in ubc.team09.player
-
This interface encloses the decision-making part of the program; i.e., one that receives information about the board state and is capable of deciding a move.
W
- W - Static variable in class ubc.team09.bitboard.P
-
Represents the "West" direction; i.e., lesser column indices.
- WHITE - Static variable in class ubc.team09.state.C
X
- X - Class in ubc.team09.eval
-
An implementation of the X term presented in a 2014 paper by Runxing Zhong and Ke Zhou.
- X() - Constructor for class ubc.team09.eval.X
All Classes and Interfaces|All Packages|Constant Field Values