saealib.AskStage#
- class saealib.AskStage(algorithm, n_offspring=None, cbmanager=None)[ソース]#
ベースクラス:
StageGenerate offspring candidates via the algorithm's ask() method.
Writes the offspring population to
state.offspring.- パラメータ:
algorithm (Algorithm) -- The evolutionary algorithm that generates candidates.
n_offspring (int or None) -- Number of offspring to request. Passed directly to
algorithm.ask().Nonelets the algorithm decide.cbmanager (CallbackManager or None) -- If provided, PostCrossoverEvent / PostMutationEvent / PostAskEvent are dispatched through this manager.
Methods
Initialize base Stage attributes. |
|
Return this stage's structural and direct state-access contract. |
|
Execute this stage and return the updated state. |
|
Expand into per-operator lines via |
|
Render this stage as a plain-text algorithmic line. |
Method Details
- AskStage.__init__(algorithm, n_offspring=None, cbmanager=None)[ソース]#
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.algorithm (Algorithm | Proposer)
n_offspring (int | None)
cbmanager (CallbackManager | None)
- 戻り値の型:
None
- AskStage.execute(state)[ソース]#
Execute this stage and return the updated state.
- パラメータ:
state (OptimizationState) -- Current optimization state.
- 戻り値:
Updated state.
- 戻り値の型:
OptimizationState
- AskStage.to_pseudocode(*, expand=False, indent=0)[ソース]#
Expand into per-operator lines via
Algorithm.ask_notation.- パラメータ:
expand (bool)
indent (int)
- 戻り値の型:
str
- AskStage.to_text(*, expand=False, indent=0)#
Render this stage as a plain-text algorithmic line.
- パラメータ:
expand (bool)
indent (int)
- 戻り値の型:
str