ambdes ambdes
  • User Guide
  • Reference
  • Changelog

Skills

A skill is a package of structured files that teaches an AI coding agent how to work with a specific tool or framework. The skill below was generated by Great Docs from this project’s documentation. Install it in your agent and it will be able to run commands, edit configuration, write content, and troubleshoot problems without step-by-step guidance from you.

Any agent — install with npx:

npx skills add https://ambmodels.github.io/ambdes/

Codex / OpenCode

Tell the agent:
Fetch the skill file at https://ambmodels.github.io/ambdes/skill.md and follow the instructions.

Manual — download the skill file:

curl -O https://ambmodels.github.io/ambdes/skill.md

Or browse the SKILL.md file.

SKILL.md

---
name: ambdes
description: >
  Ambulance discrete event simulation. Use when writing Python code that uses the ambdes package.
compatibility: Requires Python >=3.13.
---

# ambdes

Ambulance discrete event simulation

## Installation

```bash
pip install ambdes
```

## API overview

### Classes

Core classes

- `CapacitySchedule`: Apply a repeating availability schedule to one resource pool
- `WarmUpAuditor`: Warm-up auditor - records cumulative mean results at intervals
- `SimConfig`: Configuration for a simulation run
- `Dispatcher`: Allocate ambulances and permits to waiting patients
- `EmpiricalRunner`: Run replications using empirical process time distributions
- `FitDist`: Fit distributions using sim-tools and compare samples to real data
- `Model`: Discrete-event simulation model for ambulance responses
- `Patient`: Represents a patient who has called 999
- `Results`: Simulation output for a single model run
- `UtilisationCalculator`: Compute time-weighted ambulance utilisation from an event log
- `Runner`: Run the simulation for one or more replications

### CapacitySchedule Methods

Methods for the CapacitySchedule class

- `CapacitySchedule.validate_schedule`
- `CapacitySchedule.run`
- `CapacitySchedule.apply_target`
- `CapacitySchedule.return_units`
- `CapacitySchedule.remove_units`
- `CapacitySchedule.record_change`
- `CapacitySchedule.assert_resource_invariants`

### Dataclasses

Data-holding classes

- `DispatchRequest`: A patient waiting for ambulance resources

### Functions

Public functions

- `plot_warm_up`: Plot warm-up trajectories for one metric and response category
- `run_warm_up_audit`: Run warm-up audit for one or more replications (can run in parallel)
- `convert_keys_to_int`: Convert dictionary keys to int
- `convert_resource_hours_to_ambulances`: Convert resource hours per week to a fixed number of ambulances
- `resolve_dict`: Return a dictionary unchanged, or load one from a JSON file path
- `build_empirical_config`: Build registry configuration for empirical time distributions
- `build_arrival_config`: Determine arrival parameters and create config dict
- `fit_config`: Fit distributions for each metric and category from raw time data
- `get_dist_params`: Compute sim-tools parameter dict for a given distribution
- `plot_metric_kde`: Plot KDE curve by category (C1-C4)
- `plot_observed_fitted`: Plot overlaid comparison of observed vs fitted data
- `plot_capacity_vs_util`: Plot capacity v.s., utilisation during the model run

### Constants

Module-level constants and data

- `DISTRIBUTIONS`: Built-in mutable sequence

## Resources

- [Full documentation](https://ambmodels.github.io/ambdes/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs

Developed by Amy Heather, Lee Coulson, Irene Irungu, and Thomas Monks.
Site created with Great Docs.