pygx.algo.evolution.where¶
Interfaces and utilities for decision point selection.
where
¶
Interfaces and utilities for decision point selection.
DecisionPointFilter
¶
Bases: Object
Base class for decision point filter.
A decision point filter is used for deciding which decision points should be included during recombination and mutation. It takes a list of decision points as the candidates for filtering, and returns a list of decision points as the target that evolutionary operations should work on.
call
abstractmethod
¶
call(
decision_points: list[DecisionPoint],
global_state: AttributeDict | None = None,
step: int = 0,
) -> list[DecisionPoint]
Implementation of filtering logic. Subclass to override.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decision_points
|
list[DecisionPoint]
|
A list of decision points as candidates for filtering. |
required |
global_state
|
AttributeDict | None
|
An optional keyword argument as the global state. |
None
|
step
|
int
|
An optional keyword argument as current step of evolution. |
0
|
Returns:
| Type | Description |
|---|---|
list[DecisionPoint]
|
A list of decision points that should be kept. |
Source code in pygx/algo/evolution/_where.py
Lambda
¶
Lambda(fn: Callable[[list[DecisionPoint]], list[DecisionPoint]], **kwargs)
Bases: DecisionPointFilter
Decision point filter that is converted from a callable object.
Source code in pygx/algo/evolution/_where.py
All
¶
Any
¶
Bases: DecisionPointFilter
Include any K (1 by default) decision point(s).
Source code in pygx/algo/evolution/_where.py
where_spec
¶
where_spec(default=ALL) -> ValueSpec
Returns the value spec for a decision point filter.
Source code in pygx/algo/evolution/_where.py
options: show_root_heading: false show_root_toc_entry: false members_order: source heading_level: 2