Skip to content

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.

S

P = number

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.

S

P

number


optional key?: (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.

S

string | number


optional maxDepth?: 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.


optional maxNodes?: number

Defined in: src/modules/game-search/alpha-beta.ts:23

Stop after about this many moves have been tried (apply calls).


optional maxTableEntries?: number

Defined in: src/modules/game-search/alpha-beta.ts:25

Entries the transposition table holds before it is cleared. Default 2 ** 20.


optional now?: () => number

Defined in: src/modules/game-search/alpha-beta.ts:42

Clock for timeMs, in milliseconds. Default performance.now.

number


optional random?: 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.


optional timeMs?: number

Defined in: src/modules/game-search/alpha-beta.ts:29

Stop after about this many milliseconds.