Alpha
The object representing the state of the game
The object representing a move in the game
Extra data used in evaluation not suitable for storing in the gamestate
Callback for getting all the score attached to the node.
Protected
expiredTracks whether a searched has expired due to time
Protected
expireTime the search will expire. 0 disables expiry
Protected
fullFlags that full depth has not been reached when set to false
Protected
presortEnables presort of children internally
Protected
outcomesNumber of leaf or depth = 0 reached during current call
Protected
nodeFlag set if node limit has been reached
Callback to evaluate the value of gamestate attached to node
Original root when tree was created
Active root used for the creation and searching of tree. Set to root in constructor.
Number of nodes in tree
Number of leaf nodes in tree
Protected
activeMaximum depth of current search
Callback to get the moves for a gamestate attached to a Node.
Callback to create a child of a parent node using a move
Protected
evalOverwrite the depth option.
Protected
maxnImplements the negamax algorithm up to a given depth of search.
Recursively calls itself until depth
is 0
or LEAF
node is reached and evaluated.
reason for concluded the search
Node to evaluate or search children
Depth to search from this node
Protected
assignnode to assign values to
Protected
evalSearches the tree repeatedly, incrementing the depth each time. Returns after reaching target depth, or early if tree is complete or time exceeded.
The result of the search
Search the tree according to the options specified by the options (opts).
Result from the tree search
Called during deepening search between each depth. Does nothing until overidden
Protected
checkProtected
checkProtected
getReturns either the array of node children or a generator which may create children on the fly Also presorts children if enabled
An iterable for going through children of node
Node to return an iterable of children
Protected
sortSorts the child nodes of given parent Node according to inherited value. Sort is descending by default
Sorts using the method specififed in opts.SearchOpts.SortMethod.
The child with the highest value
Protected
randomSelects from the nodes children which all have an equal best value (and depth) Uniform random weighting Node.child must already represent best child
randomly selected best child with same value as best
Parent to select best child from
Protected
randomProtected
routeProtected
optimalFunction to return the list of moves starting from the root that are the 'optimal' path.
Must be called after evaluating the tree.
A list of moves from the active root Node that represent the optimal sequence through the game.
Protected
removeProtected
createProtected
createCreates the full game tree starting from activeRoot.
Uses the GetMoves and CreateChildNode callbacks.
Protected
childGenerated using TypeDoc
Interface for performing a maxn search, which can deal with games with an number of players.
Experimental, under development and undocumented.