simopt.model
Base class for simulation models used in simulation optimization problems.
Module Contents
- class simopt.model.Model(fixed_factors: dict | None = None)
Bases:
abc.ABCBase class for simulation models used in simulation-optimization problems.
Each model defines the simulation logic behind a given problem instance.
Initialize a model object.
- Parameters:
fixed_factors (dict | None, optional) – Dictionary of user-specified model factors.
- class_name_abbr: ClassVar[str]
Short name of the model class.
- class_name: ClassVar[str]
Long name of the model class.
- config_class: ClassVar[type[pydantic.BaseModel]]
Configuration class for the model.
- n_rngs: ClassVar[int]
Number of RNGs used to run a simulation replication.
- n_responses: ClassVar[int]
Number of responses (performance measures).
- config
- name() str
Name of model.
- specifications() dict[str, dict]
Details of each factor (for GUI, data validation, and defaults).
- property factors: dict
Changeable factors of the simulation model.
- model_created() None
Hook called after the model is constructed.
Subclasses can override this to use custom input models.
- abstractmethod before_replicate(rng_list: list[mrg32k3a.mrg32k3a.MRG32k3a]) None
Prepare the model just before generating a replication.
- Parameters:
rng_list (list[MRG32k3a]) – RNGs used to drive the simulation.
- Raises:
NotImplementedError – If the subclass does not implement this hook.
- abstractmethod replicate() tuple[dict, dict]
Simulate a single replication for the current model factors.
- Parameters:
rng_list (list[
mrg32k3a.mrg32k3a.MRG32k3a]) – List of random-number generators used to generate a random replication.- Returns:
dict: Performance measures of interest.
dict: Gradient estimates for each response.
- Return type:
tuple