---
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

- `WarmUpAuditor`: Warm-up auditor - records cumulative mean results at intervals
- `SimConfig`: Configuration for a simulation run
- `FitDist`: Fit distributions using sim-tools and compare samples to real data
- `Model`: Discrete-event simulation model for generating patient calls
- `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

### 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)
- `build_arrival_config`: Determine arrival parameters and create config dict
- `fit_config`: Fit distributions for each metric and category from raw time data
- `plot_metric_kde`: Plot KDE curve by category (C1-C4)
- `plot_observed_fitted`: Plot overlaid comparison of observed vs fitted data

### 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
