saealib.AcquisitionStage#
- class saealib.AcquisitionStage(acquisition, cbmanager=None)[source]#
Bases:
StageScore offspring via an independent AcquisitionFunction.
Reads
state.offspring/state.predictions, writes the resulting score array tostate.scores.Caches
acquisition.prepare()’s result per(acquisition instance identity, generation, decision_count, archive.value_version, archive.structure_version). A stage instance running the same acquisition against an unchanged archive within one generation does not recompute the reference, while a mid-generation archive append (structure_version bump), value-only mutation (value_version bump), or a newly confirmed evaluation plan (decision_countbump – relevant to async steady-state refill, wheregencan stay fixed across several confirmed plans) correctly invalidates it.Empty candidate input (
len(state.offspring) == 0) skips straight to an emptyAcquisitionResultwithout touching the cache or callingprepare()/evaluate(), so it never advances RNG state.- Parameters:
acquisition (AcquisitionFunction) – Acquisition function that scores
state.offspringagainststate.predictions.cbmanager (CallbackManager or None) – If provided, AcquisitionStartEvent and AcquisitionEndEvent are dispatched. AcquisitionEndEvent is not dispatched if
acquisition.evaluate()raises.
Methods
Initialize base Stage attributes. |
|
Return this stage's structural and direct state-access contract. |
|
Execute this stage and return the updated state. |
|
Render this stage as a LaTeX algorithmic line. |
|
Render this stage as a plain-text algorithmic line. |
Method Details
- AcquisitionStage.__init__(acquisition, cbmanager=None)[source]#
Initialize base Stage attributes.
- Parameters:
name (str, optional) – Override the class-level
name.label (str, optional) – Override the class-level
label.notation (str, optional) – Override the class-level
notation.acquisition (AcquisitionFunction)
cbmanager (CallbackManager | None)
- Return type:
None
- AcquisitionStage.contract()[source]#
Return this stage’s structural and direct state-access contract.
- Return type:
- AcquisitionStage.execute(state)[source]#
Execute this stage and return the updated state.
- Parameters:
state (OptimizationState) – Current optimization state.
- Returns:
Updated state.
- Return type:
OptimizationState
- AcquisitionStage.to_pseudocode(*, expand=False, indent=0)#
Render this stage as a LaTeX algorithmic line.
- Parameters:
expand (bool) – If True and this stage has sub-stages, recursively expand them.
indent (int) – Current indentation level (number of
\Stateindent steps).
- Returns:
LaTeX algorithmic fragment.
- Return type:
str
- AcquisitionStage.to_text(*, expand=False, indent=0)#
Render this stage as a plain-text algorithmic line.
- Parameters:
expand (bool)
indent (int)
- Return type:
str