Validation Module
Core module
- class troppo.validation.core.ContextSpecificModelSimulator(model_simulator: ConstraintBasedModelSimulator, scenarios: Optional[dict] = None, post_process=None)[source]
Bases:
objectClass for simulating a model under different contexts.
Parameters
- model_simulatorConstraintBasedModelSimulator
The model simulator to use
- scenariosdict, optional
The scenarios to simulate, by default None
- post_processfunction, optional
The post-processing function to use, by default None
- simulate(contexts: dict, simulation_function, objective_coefficients: dict, minimize: bool, **kwargs) dict[source]
Simulate the model under the given contexts.
Parameters
- contexts: dict
The contexts to simulate under
- simulation_function: function
The simulation function to use
- objective_coefficients: dict
The objective coefficients to use
- minimize: bool
Whether to minimize or maximize the objective
- kwargs: dict
The keyword arguments to pass to the simulation function
Returns
dict : The simulation results