AbstractState

abstract class AbstractState(val context: ClassicExecutionContext) : State

Common base of every :solve-classic State: wraps computeNext with a shared timeout check, so no concrete state has to implement SolveOptions.timeout handling itself.

next first compares executionTime against ClassicExecutionContext.startTime/ClassicExecutionContext.maxDuration; if the budget is exceeded it short-circuits straight to an EndState (StateHalt) carrying a TimeOutException, bypassing any pending catch/3 (resource exhaustion is treated as unrecoverable); otherwise it delegates to computeNext, the actual per-state transition logic.

Inheritors

Constructors

Link copied to clipboard
constructor(context: ClassicExecutionContext)

Properties

Link copied to clipboard
open override val context: ClassicExecutionContext

The execution context this state operates on.

Link copied to clipboard

Whether this state is a terminal one for the current resolution step, i.e. an EndState.

Functions

Link copied to clipboard
open fun asEndState(): EndState?

This state as an EndState, or null if isEndState is false.

Link copied to clipboard

This state as an EndState.

Link copied to clipboard
abstract fun clone(context: ClassicExecutionContext = this.context): State

Returns a copy of this state, replacing context with the given one (defaulting to the current context).

Link copied to clipboard
open override fun next(): State

Computes the state the machine transitions into from here -- a pure function of context.