Skip to content

BacktrackTraits

BacktrackTraits<TState> = object

Defined in: optimize/backtrack.ts:16

How a caller’s state space is expanded, mutated and tested.

TState

apply: (state) => void

Defined in: optimize/backtrack.ts:21

Mutates the caller’s world to reflect having chosen state.

TState

void


candidatesOf: (state) => readonly TState[]

Defined in: optimize/backtrack.ts:18

Expands a state into the candidates to try from it.

TState | undefined

readonly TState[]


optional isExhausted?: (state) => boolean

Defined in: optimize/backtrack.ts:30

Whether state is a dead end that should not be expanded.

TState

boolean


isGoal: (state) => boolean

Defined in: optimize/backtrack.ts:27

Whether state is an acceptable solution.

TState

boolean


undo: (state) => void

Defined in: optimize/backtrack.ts:24

Reverses BacktrackTraits.apply when a branch is abandoned.

TState

void