optimisation.design_space.constraint module
This module holds Constraint
, which stores a constraint.
It saves it’s name, limits, and methods to evaluate if it is violated or not.
- class Constraint(name: str, element_name: str, limits: tuple[float, float])
Bases:
DesignSpaceParameter
A single constraint.
For now, it can only be a synchronous phase limits.
- __init__(name: str, element_name: str, limits: tuple[float, float]) None
- __post_init__()
Convert values in deg for output if it is angle.
- _abc_impl = <_abc._abc_data object>
- evaluate(simulation_output: SimulationOutput) tuple[float, float]
Check if constraint is respected. They should be < 0.
- get_value(simulation_output: SimulationOutput) float
Get from the
SimulationOutput
the quantity calledself.name
.
- property kwargs: dict[str, bool]
Return the
kwargs
to send aget
method.
- property n_constraints: int
Return number of embedded constraints in this object.
A lower + and upper bound count as two constraints.
- IMPLEMENTED_CONSTRAINTS = ('phi_s',)