Changelog
This changelog is generated automatically from GitHub Releases.
v0.3.1 - 2026-11-18
2026-11-18 · GitHub
Minor bug fixes. Only one which caused any change in results at present was the availability schedule fix.
Fixed
- Empirical: Not currently using these, but retaining for now in case want to. Made some bug fixes:
- Expect data to already be provided in minutes from prepare_time_data().
- Use new tidy
categorycolumn from prepare_time_data().
- Input times: Corrected fit_config() to use tidy
categorycolumn from prepare_time_data() (although no impact presently, as the data that had the differentResponseCategoryGroupLevel2categories was the data on resources per incident, not the time data). - Input shifts:
create_availability schedule()was excluding occurences of 0 - fixing this caused a few minor changes in a few schedules of one or two resources here or there.
v0.3.0 - 2026-11-18
2026-11-18 · GitHub
Refactored input modelling (and moved here from ambdes-private), added shared constants and new tests, and fixed arrival-rate overestimation by including zero-patient combinations in averages
Added
- Input modelling:
- Add
input_shifts.py(moved and refactored code fromambdes-private). - Add
input_data.py(to reduce repetitive cleaning of the same data in notebooks! Also introduce new defensive programming which checks mapping when replace labels, conversion froms seconds to minutes once, and bug fixes noted below).
- Add
- Constants: Add
constants.py(for any used in 2+ modules and/or multiple notebooks). - Tests: Added new tests.
Changed
- init.py: Removed
__all__, instead now specify the module to import from. - Input modelling: Separated into more distinct modules.
Fixed
- Input data: Big bug! Was excluding 0 counts when did means. This meant the group mean was the average arrivals on dates when this category / outcome / hour combination had at least one patient, whereas now it is the average arrivals across all possible combinations, including combinations with zero patients. Original calculations were overestimating arrival numbers.
- Arrival config: build_arrival_config saves as NA instead of 0 for outcome probabilities.
v0.2.0 - 2026-10-23
2026-10-23 · GitHub
Model now has arrivals varying by hour of day, resources varying according to shift patterns, which are adjusted for unavailability, meal break and restricted send per hour.
The results have improved - C1 and C2 times a bit higher, but still too quick.
Added
- Empirical: Add build_empirical_config and EmpiricalRunner (moved from
ambdes-private). - Restricted send:
- Add new attribute
restricted_send_scheduletoSimConfig, and a new methodcreate_permit_schedule()which will create a schedule based on ambulance schedule v.s., restricted send schedule. - In Model, add permit schedule and initialise permit store. When request an ambulance, if using restricted send, the C2-C4 patients also have to request a permit first. The various capacity change methods have been amended so they can be used both for varying the ambulance pool and the permit pool.
- Add new class Dispatcher which ensures that patients have to get an ambulance and permit at the same time - else you have an issue where e.g., C4 gets a permit but waiting for an ambulance when C2 comes in. It should be synchronous.
- Add new attribute
- Tests: Add more tests for:
- Restricted send dispatch logic.
SimConfigpermit schedule.- Checking
patientstimings match the vidigi log. - Varying capacity with CapacitySchedule.
- Regression tests for build_arrival_config.
- Resource reduction: Add
reduce_ambulanceswhich can applied to fixed number of ambulances or ambulance schedule schedule. - Outputs: Add all the times to Patient, allowing greater exploration when looking at model results.
Changed
- Configuration:
- Just directly supply the number of ambulances, rather than expecting
SimConfigto calculate it from the resource hours. - Amend build_arrival_config so can build by hour-weekday or just weekday.
- Allow arrives and times to be a dict or path to JSON.
- Just directly supply the number of ambulances, rather than expecting
- Varying capacity:
- Switch from sampling capacity reduction at intervals to instead providing a schedule of resource levels.
- Moved varying capacity logic out of the model and into a new class CapacitySchedule.
- Tests: Amend tests following refactoring changes.
- Model: Separate Model.__init__() into several separate methods to make it easier to read and disentangle what is happening.
- Documentation: Update following recent changes.
Fixed
- Upgrade pandas to resolve future warning.
- Fix for bug identified by
test_resource_released_at_deadline_stays_operational. When release and deadline coincide, we expect the unit to become available at the deadline and remain operational, but this was not happening, at that timepoint it would look like it disappeared. - Fixed bug in creation of
arrival_config. Previous approach summed by day then did mean. But this has changed to just a sum overall. As the current approach would not account for different arrival numbers per day.
Current model structure

v0.1.0 - 2026-10-09
2026-10-09 · GitHub
First release. This contains a working discrete event simulation model of ambulance operations. It includes code for input modelling and choosing model parameters. It is on a Trust-level.
Note: the model results are currently not quite right - C1 and C2 always seen too quick, while C3 and C4 wait far far far too long (or are never seen). Also, the current adjustment for sickness has been identified as the wrong adjustment - should instead be using resource unavailability. This sickness measure is all sickness (e.g., long-term leave that will have planned cover, and on-the-day sickness which might not).
The current simulation model structure is:
