saealib.AcquisitionStage#

class saealib.AcquisitionStage(acquisition, cbmanager=None)[source]#

Bases: Stage

Score offspring via an independent AcquisitionFunction.

Reads state.offspring/state.predictions, writes the resulting score array to state.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_count bump – relevant to async steady-state refill, where gen can stay fixed across several confirmed plans) correctly invalidates it.

Empty candidate input (len(state.offspring) == 0) skips straight to an empty AcquisitionResult without touching the cache or calling prepare()/evaluate(), so it never advances RNG state.

Parameters:
  • acquisition (AcquisitionFunction) – Acquisition function that scores state.offspring against state.predictions.

  • cbmanager (CallbackManager or None) – If provided, AcquisitionStartEvent and AcquisitionEndEvent are dispatched. AcquisitionEndEvent is not dispatched if acquisition.evaluate() raises.

Methods

__init__

Initialize base Stage attributes.

contract

Return this stage's structural and direct state-access contract.

execute

Execute this stage and return the updated state.

to_pseudocode

Render this stage as a LaTeX algorithmic line.

to_text

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:

ComponentContract

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 \State indent 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