saealib.InitializationStage#

class saealib.InitializationStage(initializer, provider, problem)[ソース]#

ベースクラス: Stage

Wrap an Initializer as a Stage.

Delegates to initializer.initialize(provider, problem) and returns the resulting OptimizationState. The state argument passed to execute() 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"]).

パラメータ:
  • initializer (Initializer) -- The concrete initializer (e.g. LHSInitializer).

  • provider (ComponentProvider) -- Component provider forwarded to Initializer.initialize().

  • problem (Problem) -- The optimization problem.

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

InitializationStage.__init__(initializer, provider, problem)[ソース]#

Initialize base Stage attributes.

パラメータ:
  • 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)

戻り値の型:

None

InitializationStage.contract()[ソース]#

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

戻り値の型:

ComponentContract

InitializationStage.execute(state)[ソース]#

Execute this stage and return the updated state.

パラメータ:

state (OptimizationState) -- Current optimization state.

戻り値:

Updated state.

戻り値の型:

OptimizationState

InitializationStage.to_pseudocode(*, expand=False, indent=0)#

Render this stage as a LaTeX algorithmic line.

パラメータ:
  • expand (bool) -- If True and this stage has sub-stages, recursively expand them.

  • indent (int) -- Current indentation level (number of \State indent steps).

戻り値:

LaTeX algorithmic fragment.

戻り値の型:

str

InitializationStage.to_text(*, expand=False, indent=0)#

Render this stage as a plain-text algorithmic line.

パラメータ:
  • expand (bool)

  • indent (int)

戻り値の型:

str