SimConfig
Configuration for a simulation run.
Usage
SimConfig(
arrivals_config,
times_config,
warm_up_period,
data_collection_period,
n_reps,
cores=-1,
n_ambulances=None,
ambulance_schedule=None,
restricted_send_schedule=None,
ambulance_schedule_period=None
)Stores input data and run settings used by the model.
Attributes
dist_config: dict-
Dictionary with all distribution settings, in required format for sim-tools DistributionRegistry.
warm_up_period: int-
Duration of the warm-up period in minutes.
data_collection_period: int-
Duration of the data collection period in minutes.
n_reps: int-
Number of replications to run.
cores: int-
Number of CPU cores for parallel execution. Use
-1for all available cores and1for sequential execution. n_ambulances: int-
Number of ambulances in the resource pool.
ambulance_schedule: dict-
Used to mimic ambulance shifts or varying resource over time. The dictionary keys should be time (int, in minutes) and values are
n_ambulancesfor that time period. restricted_send_schedule: dict-
Dictionary containing the count of ambulances over time that are in restricted send.
ambulance_schedule_period: int- Required if ambulance_schedule is provided. Defines the end time for the schedule, at which point it should run again, on loop.
Methods
| Name | Description |
|---|---|
| __init__() | Initialise simulation configuration. |
| create_permit_schedule() | Calculate the number of ambulances eligible for C2-C4. |
| validate_inputs() | Validate inputs to SimConfig. |
__init__()
Initialise simulation configuration.
Usage
__init__(
arrivals_config,
times_config,
warm_up_period,
data_collection_period,
n_reps,
cores=-1,
n_ambulances=None,
ambulance_schedule=None,
restricted_send_schedule=None,
ambulance_schedule_period=None
)Parameters
arrivals_config: dict | str | Path-
Dictionary or path to JSON file containing arrival distribution configuration.
times_config: dict | str | Path-
Dictionary or path to JSON file containing time distribution configuration.
warm_up_period: int-
Duration of the warm-up period in minutes.
data_collection_period: int-
Duration of the data collection period in minutes.
n_reps: int-
Number of replications to run.
cores: int = -1-
Number of CPU cores for parallel execution. Use
-1for all available cores and1for sequential execution. n_ambulances: int = None-
Number of ambulances in the resource pool.
ambulance_schedule: dict | str | Path | None = None-
Dictionary or path to a JSON file containing ambulance availability over time. Keys are times in minutes and values are the number of ambulances available from that time. Provide exactly one of
n_ambulancesorambulance_schedule. restricted_send_schedule: dict | str | Path | None = None-
Dictionary or path to a JSON file containing the count of ambulances over time that are in restricted send. In this model, meal breaks cannot overlap restricted send - should be one or the other.
ambulance_schedule_period: int | None = None- Required if ambulance_schedule is provided. Defines the end time for the schedule, at which point it should run again, on loop.
create_permit_schedule()
Calculate the number of ambulances eligible for C2-C4.
Usage
create_permit_schedule()Returns
permit_schedule: dict- Count of ambulances over time that are eligible for C2-C4.
validate_inputs()
Validate inputs to SimConfig.
Usage
validate_inputs()