A B C D E F G H I K L M N O P R S T U V Z 
All Classes All Packages

A

A - monkey.mnk.ZobristHasher.Symmetry
A symmetry that does nothing (e).
actions() - Method in interface monkey.ai.State
Defines the set of legal Actions, excluding the irrelevant ones.
actions() - Method in class monkey.mnk.Board
Defines the set of legal Actions, excluding the irrelevant ones.
add(SearchResult<A>) - Method in class monkey.ai.table.Entry
Adds a new SearchResult using the TWOBIG1 replacement scheme.
addMark(Player, Board) - Method in class monkey.mnk.Alignment
Adds a new mark for the specified Player.
addOrRemove(Position, Player) - Method in class monkey.mnk.ZobristHasher
Adds/removes a new move to/from the hash code.
AI<S extends State<S,​A>,​A> - Class in monkey.ai
An AI is a generic, backtracking alpha-beta pruner for a deterministic, turn-taking, two-player, zero-sum game of perfect information.
AI(Player, S, long) - Constructor for class monkey.ai.AI
Constructs a new AI for a certain Player given an initial State and a timeout in milliseconds.
Alignment - Class in monkey.mnk
In an MNK-game, an Alignment is one of the possible arrangements in a straight line and of length K.
Alignment(Position, Alignment.Direction, int, MNKCellState, MNKCellState) - Constructor for class monkey.mnk.Alignment
Constructs a new empty Alignment given its coordinates.
Alignment.Direction - Enum in monkey.mnk
Starting from the top left cell of the Alignment, you can move following a cerain Direction to get to the others.
Alignment.State - Enum in monkey.mnk
An Alignment can be in exactly one of the following States, depending on the marks added to it.
ALIGNMENTS - Variable in class monkey.mnk.ThreatsManager
Number of possible Alignments.
apply(Position) - Method in enum monkey.mnk.ZobristHasher.Symmetry
Applies this simmetry to a given Position, returning the result of the transformation and leaving the original one unchanged.

B

B - monkey.mnk.ZobristHasher.Symmetry
90° clockwise rotation.
B - Variable in class monkey.mnk.ThreatsManager
See the project report.
bestNodeLimitedSearch(int) - Method in class monkey.ai.AI
When called in a state in which the player has the move, selects one of the legal actions to be played using best node search with limited depth.
Board - Class in monkey.mnk
A Board describes the State of a m,n,k-game.
Board(int, int, int) - Constructor for class monkey.mnk.Board
Constructs a new Board given its m, n and k parameters.

C

C - monkey.mnk.ZobristHasher.Symmetry
180° clockwise rotation.
clear() - Method in class monkey.mnk.Alignment
Resets every counter of this Alignment to its initializer and updates its Alignment.state accordingly.
clone() - Method in interface monkey.ai.State
Creates a clone of this object.
clone() - Method in class monkey.mnk.Alignment
Creates a clone of this Alignment.
clone() - Method in class monkey.mnk.Board
Creates a clone of this object.
clone() - Method in class monkey.mnk.Position
Creates a clone of this Position.
clone() - Method in class monkey.mnk.ThreatsCounter
Creates a clone of this ThreatsCounter.
clone() - Method in class monkey.mnk.ThreatsManager
Creates a clone of this ThreatsManager.
clone() - Method in class monkey.mnk.ZobristHasher
Create a clone of this ZobristHasher.
clone() - Method in class monkey.util.DirectAddressTable
Creates a clone of this DirectAddressTable.
CLOSED - monkey.mnk.Threat.Category
A not-really-dangerous category.
COLUMNSNUMBER - Variable in class monkey.mnk.Position
Number of columns of the board.
compareTo(SearchResult<Action>) - Method in class monkey.ai.table.SearchResult
Compares to another SearchResult by considering their SearchResult.SEARCHEDNODES.
configurationTest(int, int, int) - Static method in class monkey.Tester
Tests a given m,n,k configuration.
convertToHashedAction(Action) - Method in interface monkey.ai.State
Let r be the hashing representant for this State; if a is a legal action for this State, then this method computes the analogue action for r.
convertToHashedAction(Position) - Method in class monkey.mnk.Board
 
count(Threat, Player) - Method in class monkey.mnk.ThreatsManager
Returns the number of Threats of the specified nature and threatener.
countHalfOpenThreats(int, Player) - Method in class monkey.mnk.Board
Retrieves the number of half-open Threats stored by this object, filtered by length and threatener.
countRelevantActions() - Method in interface monkey.ai.State
Computes the number of legal, relevant actions for the current State.
countRelevantActions() - Method in class monkey.mnk.Board
Computes the number of legal, relevant actions for the current State.
countThreats(int, Threat, Player) - Method in class monkey.mnk.Board
Retrieves the number of Threats stored by this object, filtered by length, type, and threatener.
countThreatsWithoutHole(int, Player) - Method in class monkey.mnk.Board
Retrieves the number of Threats without hole stored by this object, filtered by length and threatener.
cutoffTest(S, int) - Method in class monkey.ai.AI
During an alpha-beta search, decides when to apply State.eval(monkey.ai.Player).

D

D - monkey.mnk.ZobristHasher.Symmetry
270° clockwise rotation.
decrement(Player) - Method in class monkey.mnk.ThreatsCounter
Decrements a given Player's counter.
DirectAddressTable<T> - Class in monkey.util
A generic direct address table indexed using [0 ..
DirectAddressTable(Class<T>, ToIntFunction<T>, int) - Constructor for class monkey.util.DirectAddressTable
Constructs a new DirectAddressTable.
DIRECTION - Variable in class monkey.mnk.Alignment
The Direction of this Alignment.
distinctDisjuncts(int, int) - Static method in class monkey.mnk.ZobristHasher
Checks whether the pseudo-random disjuncts generated for a Board are distinct or not.
DRAWUTILITY - Static variable in class monkey.mnk.Board
Quantifies the satisfaction earned when the game ends in a draw.

E

E - monkey.mnk.ZobristHasher.Symmetry
A flip around the primary diagonal.
EMPTY - monkey.mnk.Alignment.State
Every cell is free.
Entry<S extends State<S,​A>,​A> - Class in monkey.ai.table
An Entry for two-level transposition tables.
Entry(SearchResult<A>) - Constructor for class monkey.ai.table.Entry
Constructs a new Entry given its first SearchResult.
equals(Object) - Method in class monkey.mnk.Position
Indicates whether some other object is "equal to" (memberwise) this one.
eval(Player) - Method in interface monkey.ai.State
Returns an estimate of the expected utility of the game from the current State for a certain Player.
eval(Player) - Method in class monkey.mnk.Board
Returns an estimate of the expected utility of the game from the current State for a certain Player.

F

F - monkey.mnk.ZobristHasher.Symmetry
A flip around the vertical axis.
FIRSTCELL - Variable in class monkey.mnk.Alignment
The Position of the top left cell of this Alignment.
FIVE - monkey.mnk.Threat
N aligned pieces with a single jump location and whose location at one extremity is free while the second is occupied.
FLAG - Variable in class monkey.ai.table.SearchResult
Indicates whether the score is a true value, an upper bound or a lower bound.
formatTimeInterval(long) - Static method in class monkey.MoNKey
Formats a number of milliseconds converting it into seconds and milliseconds.
FOUR - monkey.mnk.Threat
N aligned pieces with a single jump location and whose extremities are free.

G

G - monkey.mnk.ZobristHasher.Symmetry
A flip around the secondary diagonal.
generateActionCandidates() - Method in class monkey.mnk.Board
Generates a sequence containing all of the Positions of this Board, sorted by decreasing heuristic value.
generateDisjuncts(int, int) - Method in class monkey.mnk.ZobristHasher
Generates the needed random disjuncts.
get(Player) - Method in class monkey.mnk.ThreatsCounter
Returns the current value of a given Player's counter.
getAdjacencyCounter(Position) - Method in class monkey.mnk.Board
A getter for the adjacency counters.
getCellState(int, int) - Method in class monkey.mnk.Board
A getter for the cells of the grid.
getCellState(Position) - Method in class monkey.mnk.Board
A getter for the cells of the grid.
getColumn() - Method in class monkey.mnk.Position
Getter for column index.
getDisjunct(Position, Player) - Method in class monkey.mnk.ZobristHasher
Retrieves the disjunct for a given Position-Player couple.
getFreeCells() - Method in class monkey.mnk.Alignment
The number of free cells in this Alignment.
getRow() - Method in class monkey.mnk.Position
Getter for row index.
getSymmetryUsed() - Method in class monkey.mnk.ZobristHasher
getThreat() - Method in class monkey.mnk.Alignment
A getter for the current Threat.
getThreatener() - Method in class monkey.mnk.Alignment
Computes the Player who caused the current Threat, if there is any.

H

H - monkey.mnk.ZobristHasher.Symmetry
A flip around the horizontal axis.
H - Variable in class monkey.mnk.ThreatsManager
See the project report.
HALFOPEN - monkey.mnk.Threat.Category
A mildly threatening category.
hashCode() - Method in class monkey.mnk.Board
Returns a hash code value for the object.
hashCode() - Method in class monkey.mnk.ZobristHasher
Returns a hash code value for the object.
hasHole() - Method in enum monkey.mnk.Threat
Checks whether this kind of Threat features a hole or not.
HORIZONTAL - monkey.mnk.Alignment.Direction
From left to right.

I

immediateSearch() - Method in class monkey.ai.AI
When called in a state in which the player has the move, selects one of the legal actions to be played using immediate search.
increment(Player) - Method in class monkey.mnk.ThreatsCounter
Increments a given Player's counter.
initialAlpha(Player) - Method in interface monkey.ai.State
Defines the alpha value of the relative initial State for a certain Player.
initialAlpha(Player) - Method in class monkey.mnk.Board
 
initialBeta(Player) - Method in interface monkey.ai.State
Defines the beta value of the relative initial State for a certain Player.
initialBeta(Player) - Method in class monkey.mnk.Board
 
initialCellStates() - Method in class monkey.mnk.Board
Helper function to initialize cell states.
initPlayer(int, int, int, boolean, int) - Method in class monkey.MoNKey
insert(T) - Method in class monkey.util.DirectAddressTable
Inserts an element in the table, updating it if already present.
isLegal(Action) - Method in interface monkey.ai.State
Checks if a certain Action is legal.
isLegal(Position) - Method in class monkey.mnk.Board
 
iterativeDeepeningSearch() - Method in class monkey.ai.AI
When called in a state in which the player has the move, selects one of the legal actions to be played using iterative deepening search.
iterator() - Method in class monkey.util.DirectAddressTable
 

K

K - Variable in class monkey.mnk.Board
Number of symbols to be aligned.

L

L - Variable in class monkey.mnk.ThreatsManager
LASTCELL - Variable in class monkey.mnk.Alignment
The Position of the bottom right cell of this Alignment.
length() - Method in class monkey.util.DirectAddressTable
The number of possible keys.
LENGTH - Variable in class monkey.mnk.Alignment
The length of this Alignment.
LOSSUTILITY - Static variable in class monkey.mnk.Board
Quantifies the satisfaction earned by losing the game.
LOWERBOUND - monkey.ai.table.SearchResult.ScoreType
Indicates that the SearchResult.SCORE is a lower bound.

M

M - Variable in class monkey.mnk.Board
Number of rows.
main(String[]) - Static method in class monkey.Tester
Runs some utility tests useful for development and debugging.
max(C, C) - Method in class monkey.util.ObjectUtils
Null safe comparison of Comparables.
maxValue(S, int, int, int) - Method in class monkey.ai.AI
Executes a "max" alpha-beta pruning step using depth limited search.
min(C, C) - Method in class monkey.util.ObjectUtils
Null safe comparison of Comparables.
minValue(S, int, int, int) - Method in class monkey.ai.AI
Executes a "min" alpha-beta pruning step using depth limited search.
MIXED - monkey.mnk.Alignment.State
All three kinds of cells can be found here.
monkey - package monkey
 
MoNKey - Class in monkey
A MoNKey offers a possible implementation of MNKPlayer using an instance of AI.
MoNKey() - Constructor for class monkey.MoNKey
 
monkey.ai - package monkey.ai
 
monkey.ai.table - package monkey.ai.table
 
monkey.mnk - package monkey.mnk
 
monkey.util - package monkey.util
 
MOVE - Variable in class monkey.ai.table.SearchResult
Contains either the best move in the position (which obtained the highest score) or the refutation move (which caused a cutoff).

N

N - Variable in class monkey.mnk.Board
Number of columns.
nextGuess(int, int, int) - Method in class monkey.ai.AI
Suggests a separation value for a best node search.
not() - Method in enum monkey.ai.Player
Returns the other Player.

O

ObjectUtils - Class in monkey.util
Operations on Object.
ObjectUtils() - Constructor for class monkey.util.ObjectUtils
 
ONE - monkey.mnk.Threat
N consecutive pieces whose extremities are free.
OPEN - monkey.mnk.Threat.Category
The most menacing category.
overestimatedHeight() - Method in interface monkey.ai.State
Computes an overestimate of the height of the game tree whose root is this State.
overestimatedHeight() - Method in class monkey.mnk.Board
 

P

P1 - monkey.ai.Player
The first agent to play.
P1FULL - monkey.mnk.Alignment.State
Every cell has been marked by Player.P1.
P1PARTIAL - monkey.mnk.Alignment.State
Some cells are free, some were marked by Player.P1.
P2 - monkey.ai.Player
The second agent to play.
P2FULL - monkey.mnk.Alignment.State
Every cell has been marked by Player.P2.
P2PARTIAL - monkey.mnk.Alignment.State
Some cells are free, some were marked by Player.P2.
pickSearchResult(S, int) - Method in class monkey.ai.table.Entry
Decides which SearchResult should be used.
player() - Method in interface monkey.ai.State
Defines which Player should play next.
player() - Method in class monkey.mnk.Board
 
Player - Enum in monkey.ai
A Player can refer to one of the two agents partaking in the game.
playerName() - Method in class monkey.MoNKey
PLAYERS - Static variable in class monkey.mnk.ZobristHasher
Number of Players to be considered.
Position - Class in monkey.mnk
A Position refers to a single cell of the Board.
Position(int, int, int, int) - Constructor for class monkey.mnk.Position
Constructs a new Position given the numbers of rows and columns and its coordinates.
Position(int, int, MNKCell) - Constructor for class monkey.mnk.Position
Constructs a new Position given an [MNKCell].
Position(Board, int, int) - Constructor for class monkey.mnk.Position
Constructs a new Position given its parent Board and its coordinates.
PRIMARY_DIAGONAL - monkey.mnk.Alignment.Direction
From top left to bottom right.
printTest(boolean, String) - Static method in class monkey.Tester
Displays the results of a test in a formatted fashion.

R

removeMark(Player, Board) - Method in class monkey.mnk.Alignment
Removes an old mark for the specified Player.
result(Action) - Method in interface monkey.ai.State
Defines the result of a certain move updating the State accordingly.
result(Position) - Method in class monkey.mnk.Board
Defines the result of a certain move updating the State accordingly.
revert() - Method in interface monkey.ai.State
Reverts the state to its parent.
revert() - Method in class monkey.mnk.Board
Reverts the state to its parent.
revert(Position) - Method in enum monkey.mnk.ZobristHasher.Symmetry
Inverts the application of this simmetry to a given Position, returning the result of the transformation and leaving the original one unchanged.
revertFromHashedAction(Action) - Method in interface monkey.ai.State
Let r be the hashing representant for this State; if a is a legal action for r, then this method computes the analogue action for this State.
revertFromHashedAction(Position) - Method in class monkey.mnk.Board
 
ROWSNUMBER - Variable in class monkey.mnk.Position
Number of rows of the board.

S

SCORE - Variable in class monkey.ai.table.SearchResult
Contains the value of SearchResult.MOVE.
search(int) - Method in class monkey.util.DirectAddressTable
Given a key, returns the value associated to it, or null if such a value does not exist.
SEARCHDEPTH - Variable in class monkey.ai.table.SearchResult
Contains the actual depth of the search.
SEARCHEDNODES - Variable in class monkey.ai.table.SearchResult
Contains the number of nodes of the subtree searched.
SearchResult<Action> - Class in monkey.ai.table
A SearchResult stores the aftermath of a brute-force search.
SearchResult(Action, int, SearchResult.ScoreType, int, long) - Constructor for class monkey.ai.table.SearchResult
Constructs a new SearchResult.
SearchResult.ScoreType - Enum in monkey.ai.table
A ScoreType indicates the nature of the SearchResult.SCORE.
SECONDARY_DIAGONAL - monkey.mnk.Alignment.Direction
From bottom left to top right.
SEED - Static variable in class monkey.mnk.ZobristHasher
Seed to be used for the generated pseudo-random sequence.
selectCell(MNKCell[], MNKCell[]) - Method in class monkey.MoNKey
setBoard(Board) - Method in class monkey.mnk.ThreatsManager
Sets a new Board whose dimensions must be the same for the previous one.
setFirstExtremity(MNKCellState, Board) - Method in class monkey.mnk.Alignment
Sets the first extremity.
setSecondExtremity(MNKCellState, Board) - Method in class monkey.mnk.Alignment
Sets the second extremity.
SIX - monkey.mnk.Threat
N aligned pieces with a single jump location and whose extremities are occupied.
SIZE - Variable in class monkey.mnk.Board
Number of cells of the Board.
SIZE - Static variable in enum monkey.mnk.Threat
The number of types of Threats.
SIZE - Static variable in enum monkey.mnk.ZobristHasher.Symmetry
The number of Symmetries.
State<Self extends State<Self,​Action>,​Action> - Interface in monkey.ai
A State represents a single scenario between those which can be encountered when playing a deterministic, turn-taking, two-player, zero-sum games of perfect information.

T

terminalTest() - Method in interface monkey.ai.State
Checks for terminal States.
terminalTest() - Method in class monkey.mnk.Board
 
Tester - Class in monkey
A tester class for the whole monkey package.
theoreticalGameValue() - Method in class monkey.mnk.Board
Computes the theoretical game value of the current configuration looking it up in a small knowledge base.
Threat - Enum in monkey.mnk
A Threat can refer to one of the six types of configurations.
THREAT - Variable in class monkey.mnk.ThreatsCounter
The kind of Threat to keep track of.
Threat.Category - Enum in monkey.mnk
The types of configuration are partitioned so that each of them has its own Category.
ThreatsCounter - Class in monkey.mnk
A ThreatsCounter keeps track of the number of Threats of a certain type.
ThreatsCounter(Threat) - Constructor for class monkey.mnk.ThreatsCounter
Constructs a new ThreatsCounter.
ThreatsManager - Class in monkey.mnk
A ThreatsManager for a certain L counts the L-long Threats with no hole and the L-1-long Threats with a hole in them.
ThreatsManager(int, Board) - Constructor for class monkey.mnk.ThreatsManager
Constructs a new ThreatsManager given the L parameter and a Board.
THREE - monkey.mnk.Threat
N consecutive pieces whose extremities are occupied.
timeCheck() - Method in class monkey.ai.AI
Asserts the fact that the time is not almost over, or throws an exception if this is not the case.
toKey - Variable in class monkey.util.DirectAddressTable
A function associating each value to an integer key in the range [0 ..
toString() - Method in class monkey.ai.table.Entry
Returns a string representation of the object.
toString() - Method in class monkey.ai.table.SearchResult
Returns a string representation of the object.
toString() - Method in class monkey.mnk.Alignment
Returns a string representation of the object.
toString() - Method in class monkey.mnk.Board
Returns a string representation of the object.
toString() - Method in class monkey.mnk.Position
Returns a string representation of the object.
toString() - Method in class monkey.mnk.ThreatsCounter
Returns a string representation of the object.
toString() - Method in class monkey.mnk.ThreatsManager
toString() - Method in class monkey.util.DirectAddressTable
Returns a string representation of the object.
TRUEVALUE - monkey.ai.table.SearchResult.ScoreType
Indicates that the SearchResult.SCORE is a true value.
ttSuggestedCapacity() - Method in interface monkey.ai.State
Suggests a reasonable transposition table capacity assuming this instance is used as initial State.
ttSuggestedCapacity() - Method in class monkey.mnk.Board
Suggests a reasonable transposition table capacity assuming this instance is used as initial State.
TWO - monkey.mnk.Threat
N consecutive pieces whose location at one extremity is free while the second is occupied.

U

update(A) - Method in class monkey.ai.AI
Updates the current State with the given action.
updateAlignments(Position, Player) - Method in class monkey.mnk.ThreatsManager
(Un)records a mark for the whole Board.
UPPERBOUND - monkey.ai.table.SearchResult.ScoreType
Indicates that the SearchResult.SCORE is an upper bound.
utility(Player) - Method in interface monkey.ai.State
When called on a terminal State, defines the payoff of such an ending for a certain Player.
utility(Player) - Method in class monkey.mnk.Board
 

V

validate(int, int) - Method in class monkey.mnk.Position
Implements bounds checking for both rows and columns.
validateColumn(int) - Method in class monkey.mnk.Position
Implements bounds checking for columns.
validateRow(int) - Method in class monkey.mnk.Position
Implements bounds checking for rows.
validateSquareBoard(Position) - Static method in enum monkey.mnk.ZobristHasher.Symmetry
Validates the fact that a given Position is part of a square Board or not.
valueOf(String) - Static method in enum monkey.ai.Player
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum monkey.ai.table.SearchResult.ScoreType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum monkey.mnk.Alignment.Direction
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum monkey.mnk.Alignment.State
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum monkey.mnk.Threat.Category
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum monkey.mnk.Threat
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum monkey.mnk.ZobristHasher.Symmetry
Returns the enum constant of this type with the specified name.
values() - Static method in enum monkey.ai.Player
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum monkey.ai.table.SearchResult.ScoreType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum monkey.mnk.Alignment.Direction
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum monkey.mnk.Alignment.State
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum monkey.mnk.Threat.Category
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum monkey.mnk.Threat
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum monkey.mnk.ZobristHasher.Symmetry
Returns an array containing the constants of this enum type, in the order they are declared.
VERTICAL - monkey.mnk.Alignment.Direction
From top to bottom.
VICTORYUTILITY - Static variable in class monkey.mnk.Board
Quantifies the satisfaction earned by winning the game.

Z

ZobristHasher - Class in monkey.mnk
A ZobristHasher stores the data needed for Zobrist hashing.
ZobristHasher(int, int) - Constructor for class monkey.mnk.ZobristHasher
Constructs a new ZobristHasher from the board's extents.
ZobristHasher.Symmetry - Enum in monkey.mnk
A symmetry is a transformation that leaves an empty Board unchanged.
A B C D E F G H I K L M N O P R S T U V Z 
All Classes All Packages