constraint module
Define Constraint, which stores a constraint.
It saves it’s name, limits, and methods to evaluate if it is violated or not.
- class Constraint(name, element_name, limits)[source]
Bases:
DesignSpaceParameterA single constraint.
For now, it can only be a synchronous phase limits. By convention, all calculations are done in rad, and phases are always printed in deg.
- property n_constraints: int
Return number of embedded constraints in this object.
A lower + and upper bound count as two constraints.
- get_value(simulation_output)[source]
Get from the
SimulationOutputthe quantity calledself.name.Currently bugged. When trying too access
phi_s, we get the value stored inSimulationOutput.eltsinstead of the one inSetOfCavitySettings. So we end up with thephi_sfrom the broken linac instead of the ones in the cavity settings we just tried.- Parameters:
simulation_output (
SimulationOutput)- Return type:
- evaluate(simulation_output)[source]
Check if constraint is respected.
They should be < 0.
- Parameters:
simulation_output (
SimulationOutput)- Return type:
- __init__(name, element_name, limits)
- _abc_impl = <_abc._abc_data object at 0x7318fb560600>