AlphaBetaOptions
Defined in: src/modules/game-search/alpha-beta.ts:19
Options for alphaBetaSearch. With no budget it searches to the end of the game.
Type Parameters
Section titled “Type Parameters”S
P = number
Properties
Section titled “Properties”evaluate
Section titled “evaluate”evaluate: (
state,player) =>number
Defined in: src/modules/game-search/alpha-beta.ts:35
Scores a non-final state from player’s side: higher is better for them,
within ±WIN_SCORE / 2. Called at the depth limit, always for the player to
move at the root.
Parameters
Section titled “Parameters”S
player
Section titled “player”P
Returns
Section titled “Returns”number
optionalkey?: (state) =>string|number
Defined in: src/modules/game-search/alpha-beta.ts:40
Identifies a state: equal keys mean the same position. Turns on a transposition table that skips positions reached by different move orders.
Parameters
Section titled “Parameters”S
Returns
Section titled “Returns”string | number
maxDepth?
Section titled “maxDepth?”
optionalmaxDepth?:number
Defined in: src/modules/game-search/alpha-beta.ts:21
Deepest look-ahead in moves. Depth 1 always completes, so 0 acts as 1.
maxNodes?
Section titled “maxNodes?”
optionalmaxNodes?:number
Defined in: src/modules/game-search/alpha-beta.ts:23
Stop after about this many moves have been tried (apply calls).
maxTableEntries?
Section titled “maxTableEntries?”
optionalmaxTableEntries?:number
Defined in: src/modules/game-search/alpha-beta.ts:25
Entries the transposition table holds before it is cleared. Default 2 ** 20.
optionalnow?: () =>number
Defined in: src/modules/game-search/alpha-beta.ts:42
Clock for timeMs, in milliseconds. Default performance.now.
Returns
Section titled “Returns”number
random?
Section titled “random?”
optionalrandom?:RandomFn
Defined in: src/modules/game-search/alpha-beta.ts:27
Shuffles the root moves once, so equally good moves are chosen differently per seed.
timeMs?
Section titled “timeMs?”
optionaltimeMs?:number
Defined in: src/modules/game-search/alpha-beta.ts:29
Stop after about this many milliseconds.