Constraint Maker
Factory for making state-based constraints on component methods.
- class vivarium.engine.framework.lifecycle.constraint_maker.ConstraintMaker(lifecycle_manager)[source]
Factory for making state-based constraints on component methods.
- Parameters:
lifecycle_manager (LifeCycleManager)
- check_valid_state(method, permitted_states)[source]
Ensures a component method is being called during an allowed state.
- constrain_normal_method(method, permitted_states)[source]
Only permit a method to be called during the provided states.
Constraints are applied by dynamically wrapping and binding a method to an existing component at run time.