BacktrackTraits
BacktrackTraits<
TState> =object
Defined in: optimize/backtrack.ts:16
How a caller’s state space is expanded, mutated and tested.
Type Parameters
Section titled “Type Parameters”TState
Section titled “TState”TState
Properties
Section titled “Properties”apply: (
state) =>void
Defined in: optimize/backtrack.ts:21
Mutates the caller’s world to reflect having chosen state.
Parameters
Section titled “Parameters”TState
Returns
Section titled “Returns”void
candidatesOf
Section titled “candidatesOf”candidatesOf: (
state) => readonlyTState[]
Defined in: optimize/backtrack.ts:18
Expands a state into the candidates to try from it.
Parameters
Section titled “Parameters”TState | undefined
Returns
Section titled “Returns”readonly TState[]
isExhausted?
Section titled “isExhausted?”
optionalisExhausted?: (state) =>boolean
Defined in: optimize/backtrack.ts:30
Whether state is a dead end that should not be expanded.
Parameters
Section titled “Parameters”TState
Returns
Section titled “Returns”boolean
isGoal
Section titled “isGoal”isGoal: (
state) =>boolean
Defined in: optimize/backtrack.ts:27
Whether state is an acceptable solution.
Parameters
Section titled “Parameters”TState
Returns
Section titled “Returns”boolean
undo: (
state) =>void
Defined in: optimize/backtrack.ts:24
Reverses BacktrackTraits.apply when a branch is abandoned.
Parameters
Section titled “Parameters”TState
Returns
Section titled “Returns”void