Glossary
Key terms used in the DAA_DES tutorial.
This glossary lists the key terms used in the tutorial, in alphabetical order, each with a link to the chapter that introduces it.
- active callsign groups
-
The set of crews currently out on a job, kept so that the same crew is never sent twice. Groups are added when a resource is allocated and removed again in
return_resource(). Chapter 6 - activity time
-
The sampled duration, in simulated minutes, of one stage of a job (for example
time_on_scene) for a given vehicle type. It is drawn from a fitted distribution and re-drawn until it lies within the allowable bounds. Chapter 3 - actual_data folder
- The folder of CSV files that describe the scenario being modelled, such as the rota, servicing rules and school holidays. The simulation reads it and the Streamlit app overwrites it. Chapter 1
- Ad hoc unavailability
- A resource that is on shift and not being serviced but still cannot attend, for a reason such as weather or crew. The probabilities come from historical data. Chapter 3
- Ambulance
-
The generic “something that responds to an incident” class, holding a type, a callsign and placeholders for the stages of a job.
HEMSis a subclass that adds the attributes needed for allocation. Chapter 5 - AMPDS card
- The triage code assigned to a call by the dispatch system. It is sampled for each patient and drives the sampling of age, sex and care category. Chapter 4
- best-fit distribution
-
The name and parameters of whichever candidate distribution, from a fixed list, matched the data most closely, as chosen by the
Fitterlibrary. Most continuous inputs, such as activity times and ages, are stored this way. Chapter 8 - call generator
-
The
generate_callsprocess, which runs once per simulation run and creates arrivals. Each day it samples the number of calls, spreads them over the hours and starts a patient process for each one. Chapter 4 - calls per day
- A sample of one historical daily call count for the current quarter, which the model multiplies by the demand multiplier and truncates to an integer. Chapter 4
- callsign
-
The name by which a crew is called on the radio, for example
H70orCC72. Chapter 5 - callsign group
- An integer, such as 70, that ties together the vehicles sharing one crew, so that the helicopter and car of a group are never out at the same time. Chapter 5
- care category
-
The clinical level assigned to a patient:
CC(critical care),EC(enhanced care) orREG(regular). It is sampled from the AMPDS card. Chapter 4 - DEFAULT parameter files
-
For each file in
actual_data/, a sibling named<name>_DEFAULT.csvholding the shipped values. Resetting copies these back over the working files. Chapter 1 - discrete event simulation
- A simulation in which the state of the system changes only at discrete events, such as a call arriving or a job stage ending. Index
- distribution fitting pipeline
-
The offline sequence of steps that turns a job-level CSV into the files in
distribution_data/andhistorical_data/. It is run occasionally from the command line rather than during a simulation. Chapter 8 - distribution_data folder
- The repository folder holding the fitted probabilities and distributions that the simulation samples from. Nothing in a simulation run writes to it. Chapter 3
- DistributionFitUtils
- The class that runs the distribution fitting pipeline. It reads a cleaned job extract and writes the distribution files, the historical aggregates and the simulated historical baseline. Chapter 8
- event log
-
A list of dictionaries, one per step per patient, turned into a DataFrame at the end of a run. Each row has an
event_typeand atime_type. Chapter 4 - event_type
-
The event log column saying what kind of event a row is, for example
arrival_departure,queue,resource_useorresource_use_end. Chapter 4 - FilterStore
-
A SimPy store of objects whose
getcan take a filter function, returning the first item that satisfies it. The model uses it to hold resources that may be dispatched. Chapter 5 - graceful_methods
-
A decorator on the results classes that wraps each method (any name not starting with two underscores) so an error shows a message instead of stopping the app. A failing method then returns
None. Chapter 7 - helicopter benefit
- A flag saying whether a job is one where a helicopter specifically would help. It is sampled with a probability that depends on the care category. Chapter 4
- HEMS
- Helicopter emergency medical service: here, the helicopters and rapid-response cars used for the most serious calls. Chapter 5
- HEMS resource
-
One helicopter or car, as an instance of the
HEMSclass. A single physical vehicle can appear as more than one HEMS resource. Chapter 5 - HEMS result
- The historical outcome of a tasking, sampled in the patient journey. Results such as Stand Down shorten the journey by skipping stages. Chapter 4
- HEMS rota
-
The file
actual_data/HEMS_ROTA.csv, which has one row per callsign and care category rather than one per vehicle. Each row becomes its ownHEMSobject. Chapter 5 - historical aggregates
-
Summaries of what actually happened, such as jobs per month or missed calls by hour, written to
historical_data/in the shape thatHistoricResultsexpects. Chapter 8 - historical_data folder
-
The folder of aggregated historical files, including a calculated subfolder holding the simulated baseline.
HistoricResultsloads it for comparison with simulated results. Chapter 7 - HistoricResults
-
The class that loads the observed data and the simulated historical baseline from
historical_data/, so that simulated results can be shown beside real ones. Chapter 7 - hourly arrival profile
-
The historical proportion of calls falling in each hour of the day for a quarter, used by
calls_per_hour()to spread a day’s calls over the hours. Chapter 4 - incidents per day samples
-
Lists of observed daily call counts, keyed by season and quarter and weighted towards recent years, saved to
inc_per_day_samples.json. Drawing from a list reproduces the observed spread of busy and quiet days. Chapter 8 - master seed
- The single integer the user controls. Every per-run seed is derived from it, so the same master seed always gives the same set of runs. Chapter 2
- missed call (missed job)
-
A job where allocation returned no HEMS resource, so the journey logs “No HEMS available” and “No Resource Available” instead of any HEMS activity. It is recorded in the event log as a
resource_request_outcomeevent whosetime_typeisNo Resource Available. Chapter 6, Chapter 7 - named random stream
-
A separate
numpyrandom generator reserved for one sampling purpose, such asrngs["calls_per_day"]. Changing one part of the model therefore does not shift the random numbers used elsewhere. Chapter 3 - parameter template
- An Excel workbook, downloadable from the setup page, with one sheet per input file plus a few extra sheets. It can be filled in and uploaded to set up a scenario. Chapter 1
- Patient
-
A plain object of attributes, defined in
class_patient.py, that represents one call. It holds the patient’s characteristics and the details of whichever vehicle is eventually allocated. Chapter 4 - patient journey
-
The
patient_journeyprocess, run once per HEMS call whether or not a resource was found, which steps through the stages of a job (allocation, mobile, to scene, on scene, to hospital and clear). It logs each stage and returns the resource at the end. Chapter 4 - patient outcome
- The outcome sampled for a patient, for example deceased or injured, which later influences the HEMS result. Chapter 4
- per-run seed
-
The integer seed given to one replication, derived from the master seed using
SeedSequence.spawn. Each is computed up front, so it does not depend on the order in which runs finish. Chapter 2 - predefined scenario
-
A template-shaped workbook stored in the repository’s
scenarios/folder, which can be chosen on the setup page instead of uploading a file. Chapter 1 - preferred callsign group
- A value sampled for each patient from historical data, expressing which callsign group tended to be sent rather than what is available now. Chapter 6
- preferred vehicle type
- A value sampled for each patient from historical data, expressing which type of vehicle tended to be sent rather than what is available now. Chapter 6
- primary and secondary resource
-
The best eligible resource taken from the store for a patient, plus optionally a second resource from the same crew. Allocation returns both together with a text reason, although the secondary resource currently always comes back as
None(see the bug note in chapter 6). Chapter 6 - rota
- The shift pattern saying which helicopters and cars are staffed at which hours of the day. Chapter 5
- registration
-
The identifier of the physical vehicle, for example
g-daasorcc70. Servicing is a property of the registration, not the callsign. Chapter 5 - replication
- One complete run of the simulation with its own random seed. Results are compared across replications to see how much chance matters. Chapter 2
- reset to defaults
-
The action, performed by
reset_to_defaults(), that restores session state fromDEFAULT_INPUTSand copies each_DEFAULTCSV back over its working file inactual_data/. Chapter 1 - resource allocation
-
The process by which
HEMSAvailabilityranks the eligible resources, claims the best one from the store, returns a text reason, and releases it when the job ends. Chapter 6 - ResourceAllocationReason
-
An
IntEnumnaming each possible outcome of allocation. Each value maps to the text written to the event log as aresource_preferred_outcomerow. Chapter 6 - results collation
-
The step, performed by
collateRunResults(), that merges the per-run output files into a singlerun_results.csvand deletes the per-run files. Chapter 2 - run_params_used.csv
- A file recording the settings under which a batch was run. It is written once, by the first run, and is read back later by the results classes. Chapter 2
- run_results.csv
- The combined event log from all replications, which the results classes consume. Each row carries its run number. Chapter 2
- school holidays
-
Date ranges loaded from
actual_data/school_holidays.csv. The servicing logic steers service windows away from them. Chapter 5 - SeededDistribution
-
A small wrapper pairing a frozen scipy distribution with its own
numpygenerator, so thatsample()needs no random-state argument. Chapter 3 - SeedSequence spawning
- NumPy’s way of deriving statistically independent child seeds from a parent. The model uses it to turn one seed into many independent streams. Chapter 3
- service store
- A second SimPy store that holds resources currently in the workshop. Moving a resource into it takes that resource out of circulation. Chapter 5
- servicing schedule
-
A small table of
service_start_dateandservice_end_daterows, calculated up front for each resource and used to decide when it is unavailable for servicing. Chapter 5 - session state defaults
-
The values in
DEFAULT_INPUTSthatsetup_state()copies intost.session_statethe first time a session starts. Chapter 1 - SimPy process
-
A Python generator registered on the SimPy environment with
env.process; eachyield env.timeout(n)pauses it fornsimulated minutes. Chapter 4 - SimPy environment
-
The clock and scheduler for one simulation run, created in the
DES_HEMSconstructor. Chapter 4 - simulated historical baseline
- A set of model runs using historic rotas and servicing rather than the user’s scenario, giving the simulation’s own picture of how things were. It allows a changed scenario to be compared with like for like. Chapter 8
- simulation time in minutes
- The unit of the model’s clock. Durations given in days or hours in the app are converted to minutes before the run. Chapter 2
- SimulationInputs
-
The class that loads the run parameters, rota, servicing and callsign files used by a run into DataFrames, so that
TrialResultscan read them. Chapter 7 - Streamlit app
-
The multipage web app in
app/, which is the main user entry point. It collects parameters, writes them toactual_data/, runs the model and displays the results. Chapter 1 - Stand Down
- A HEMS result meaning the crew was activated and then cancelled before reaching the scene. Chapter 4
- summer and winter shift hours
-
Four hour-of-day values giving when a resource starts and stops work in each season. The months that count as summer are read from
actual_data/rota_start_end_months.csv. Chapter 5 - theoretical available hours
- For each callsign, the minutes per day that the rota says the resource is on shift between the end of the warm-up and the end of the simulation. They form the denominator of utilisation. Chapter 7
- time_type
- The event log column saying which value a row holds, such as “arrival”, a stage label like “HEMS mobile”, or a number of minutes for a duration row. Chapter 4
- TrialResults
- The class that takes the combined event log and derives job counts, event durations, utilisation and missed-job figures, and provides the plotting and display methods used by the app. Chapter 7
- upper allowable time bounds
-
Per-activity minimum and maximum durations in minutes, read from
actual_data/upper_allowable_time_bounds.csv. Sampled activity times outside them are rejected. Chapter 3 - utilisation
- How busy a helicopter or car was: the time it was in use divided by the time it could have been in use according to the rota. Chapter 7
- Utils
-
The class in
air_ambulance_des/utils.pythat loads the fitted inputs and owns the named random streams from which every random draw in a run comes. Chapter 3 - vehicle type
-
Whether a resource is a
helicopteror acar. Chapter 5 - warm-up period
- Simulated time at the start of a run during which events happen but no rows are written to the event log, so that results are not distorted by starting from an empty system. Chapter 2