saealib.InitializationStage#
- class saealib.InitializationStage(initializer, provider, problem)[source]#
Bases:
StageWrap an
Initializeras a Stage.Delegates to
initializer.initialize(provider, problem)and returns the resultingOptimizationState. The state argument passed toexecute()is ignored — initialization always produces a fresh state from scratch.This stage is intended for use at the head of a user-defined Pipeline when the initializer itself should participate in the pipeline abstraction (e.g. to build custom init-then-optimize flows or to inspect / swap the initialization step via
Pipeline["initialization"]).- Parameters:
initializer (Initializer) – The concrete initializer (e.g.
LHSInitializer).provider (ComponentProvider) – Component provider forwarded to
Initializer.initialize().problem (Problem) – The optimization problem.
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
- InitializationStage.__init__(initializer, provider, problem)[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.initializer (Initializer)
provider (ComponentProvider)
problem (Problem)
- Return type:
None
- InitializationStage.contract()[source]#
Return this stage’s structural and direct state-access contract.
- Return type:
- InitializationStage.execute(state)[source]#
Execute this stage and return the updated state.
- Parameters:
state (OptimizationState) – Current optimization state.
- Returns:
Updated state.
- Return type:
OptimizationState
- InitializationStage.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
- InitializationStage.to_text(*, expand=False, indent=0)#
Render this stage as a plain-text algorithmic line.
- Parameters:
expand (bool)
indent (int)
- Return type:
str