Model
Discrete-event simulation model for ambulance responses.
Usage
Model(
run_number,
config,
)The model generates patient calls, allocates ambulance resources and records patients during a single simulation run.
Methods
| Name | Description |
|---|---|
| __init__() | Initialise the simulation model. |
| generate_patients() | Generate patients. |
| request_ambulance() | Join the dispatch queue and wait for the required resources. |
| run() | Run the simulation model. |
| use_ambulance() | Simulate an ambulance response for a patient. |
| warm_up() | Reset results collection after the warm-up period. |
__init__()
Initialise the simulation model.
Usage
__init__(run_number, config)Parameters
run_number: int-
Simulation run identifier.
config: object- Configuration object containing model parameters.
generate_patients()
Generate patients.
Usage
generate_patients()request_ambulance()
Join the dispatch queue and wait for the required resources.
Usage
request_ambulance(patient)First samples the time from call receipt to joining the dispatch queue.
Without restricted send, all patients wait only for an ambulance.
With restricted send: - C1 patients wait only for an ambulance. - C2-C4 patients wait for a permit and then an ambulance.
Parameters
patient: Patient- Patient requiring an ambulance response.
run()
Run the simulation model.
Usage
run()Starts patient generation and resource capacity processes, then runs the simulation for the configured duration.
use_ambulance()
Simulate an ambulance response for a patient.
Usage
use_ambulance(patient, ambulance, permit)Parameters
patient: Patient-
Patient receiving an ambulance response.
ambulance: VidigiResource-
Ambulance allocated by the dispatcher.
permit: VidigiResoure or None- Permit allocated by the dispatcher for C2-C4 patient under restricted send conditions, or None if no permit was required.
warm_up()
Reset results collection after the warm-up period.
Usage
warm_up()