# lwillem/stride architecture

> Architecture diagram of the GitHub repository lwillem/stride, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lwillem/stride
- Repository: https://github.com/lwillem/stride

## Overview

Stride is a configurable infectious-disease transmission simulator. The principal workflow is to configure a run, construct and seed a population and simulation, advance disease transmission over calendar steps, and record run outputs. Separate capabilities include survey-panel sampling, public-health interventions and vaccine/MDP control, and Python bindings. The graph follows the controller and builder evidence provided; several internal runtime connections are shown only where their ownership is supported by sampled code or class documentation.

Main entry points: [`main/cpp/sim/SimBuilder.cpp`](https://github.com/lwillem/stride/blob/master/main/cpp/sim/SimBuilder.cpp) (Simulation builder), [`main/cpp/pop/Population.cpp`](https://github.com/lwillem/stride/blob/master/main/cpp/pop/Population.cpp) (Population), [`main/cpp/execs/SimController.cpp`](https://github.com/lwillem/stride/blob/master/main/cpp/execs/SimController.cpp) (Run controller), [`main/cpp/sim/Sim.cpp`](https://github.com/lwillem/stride/blob/master/main/cpp/sim/Sim.cpp) (Simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run setup"]
  node_controller["Run controller<br/>[SimController.cpp]"]
  node_config["Run configuration"]
  node_sim_builder["Simulation builder<br/>[SimBuilder.cpp]"]
  node_summary["Run summary<br/>[SummaryFile.cpp]"]
end

subgraph group_model["Population and disease"]
  node_simulation["Simulation<br/>[Sim.cpp]"]
  node_calendar["Simulation calendar<br/>[Calendar.cpp]"]
  node_population_builder["Population builder<br/>[PopBuilder.cpp]"]
  node_population["Population<br/>[Population.cpp]"]
  node_person["Person health<br/>[Person.cpp]"]
  node_health_seed["Health seeding<br/>[HealthSeeder.cpp]"]
  node_transmission["Transmission profile"]
  node_contact_pools["Contact pools<br/>[ContactPoolSys.cpp]"]
  node_infector["Infection engine<br/>[Infector.cpp]"]
end

subgraph group_intervention["Interventions and analysis"]
  node_survey["Survey manager<br/>[SurveyManager.cpp]"]
  node_agency["Public health agency"]
  node_mdp["Vaccine policy<br/>[MDP.cpp]"]
end

subgraph group_interfaces["User interfaces"]
  node_python["Python bindings<br/>[libstride.cpp]"]
end

node_cli(("CLI user"))
node_python_user(("Python caller"))

node_cli -->|"starts run"| node_controller
node_config -->|"provides config"| node_controller
node_controller -->|"builds simulation"| node_sim_builder
node_sim_builder -->|"configures"| node_simulation
node_sim_builder -->|"initializes"| node_transmission
node_sim_builder -->|"seeds health"| node_health_seed
node_sim_builder -->|"initializes"| node_agency
node_sim_builder -->|"creates"| node_survey
node_controller -->|"advances steps"| node_simulation
node_simulation -->|"uses calendar"| node_calendar
node_simulation -->|"holds population"| node_population
node_population_builder -->|"constructs"| node_population
node_health_seed -->|"seeds health"| node_population
node_health_seed -->|"uses profile"| node_transmission
node_population -->|"contains people"| node_person
node_survey -->|"samples participants"| node_population
node_survey -->|"registers participants"| node_person
node_mdp -->|"controls simulation"| node_simulation
node_mdp -->|"vaccinates people"| node_population
node_python_user -->|"calls bindings"| node_python
node_python -->|"exposes MDP"| node_mdp
node_controller -->|"writes summary"| node_summary

click node_controller "https://github.com/lwillem/stride/blob/master/main/cpp/execs/SimController.cpp"
click node_config "https://github.com/lwillem/stride/blob/master/main/cpp/util/RunConfigManager.cpp"
click node_sim_builder "https://github.com/lwillem/stride/blob/master/main/cpp/sim/SimBuilder.cpp"
click node_summary "https://github.com/lwillem/stride/blob/master/main/cpp/util/SummaryFile.cpp"
click node_simulation "https://github.com/lwillem/stride/blob/master/main/cpp/sim/Sim.cpp"
click node_calendar "https://github.com/lwillem/stride/blob/master/main/cpp/calendar/Calendar.cpp"
click node_population_builder "https://github.com/lwillem/stride/blob/master/main/cpp/pop/PopBuilder.cpp"
click node_population "https://github.com/lwillem/stride/blob/master/main/cpp/pop/Population.cpp"
click node_person "https://github.com/lwillem/stride/blob/master/main/cpp/pop/Person.cpp"
click node_health_seed "https://github.com/lwillem/stride/blob/master/main/cpp/health/HealthSeeder.cpp"
click node_transmission "https://github.com/lwillem/stride/blob/master/main/cpp/health/TransmissionProfile.cpp"
click node_contact_pools "https://github.com/lwillem/stride/blob/master/main/cpp/contact/ContactPoolSys.cpp"
click node_infector "https://github.com/lwillem/stride/blob/master/main/cpp/contact/Infector.cpp"
click node_survey "https://github.com/lwillem/stride/blob/master/main/cpp/pop/SurveyManager.cpp"
click node_agency "https://github.com/lwillem/stride/blob/master/main/cpp/healthcare/PublicHealthAgency.cpp"
click node_mdp "https://github.com/lwillem/stride/blob/master/main/cpp/mdp/MDP.cpp"
click node_python "https://github.com/lwillem/stride/blob/master/main/python/pybind/libstride.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_config,node_sim_builder,node_summary,node_cli toneBlue
class node_simulation,node_calendar,node_population_builder,node_population,node_person,node_health_seed,node_transmission,node_contact_pools,node_infector toneAmber
class node_survey,node_agency,node_mdp toneMint
class node_python toneRose
class node_python_user toneIndigo
```

## Components

### Run setup

- [Run controller](https://github.com/lwillem/stride/blob/master/main/cpp/execs/SimController.cpp): `main/cpp/execs/SimController.cpp`
- [Run configuration](https://github.com/lwillem/stride/blob/master/main/cpp/util/RunConfigManager.cpp): `main/cpp/util/RunConfigManager.cpp`
- [Simulation builder](https://github.com/lwillem/stride/blob/master/main/cpp/sim/SimBuilder.cpp): `main/cpp/sim/SimBuilder.cpp`
- [Run summary](https://github.com/lwillem/stride/blob/master/main/cpp/util/SummaryFile.cpp): `main/cpp/util/SummaryFile.cpp`

### Population and disease

- [Simulation](https://github.com/lwillem/stride/blob/master/main/cpp/sim/Sim.cpp): `main/cpp/sim/Sim.cpp`
- [Simulation calendar](https://github.com/lwillem/stride/blob/master/main/cpp/calendar/Calendar.cpp): `main/cpp/calendar/Calendar.cpp`
- [Population builder](https://github.com/lwillem/stride/blob/master/main/cpp/pop/PopBuilder.cpp): `main/cpp/pop/PopBuilder.cpp`
- [Population](https://github.com/lwillem/stride/blob/master/main/cpp/pop/Population.cpp): `main/cpp/pop/Population.cpp`
- [Person health](https://github.com/lwillem/stride/blob/master/main/cpp/pop/Person.cpp): `main/cpp/pop/Person.cpp`
- [Health seeding](https://github.com/lwillem/stride/blob/master/main/cpp/health/HealthSeeder.cpp): `main/cpp/health/HealthSeeder.cpp`
- [Transmission profile](https://github.com/lwillem/stride/blob/master/main/cpp/health/TransmissionProfile.cpp): `main/cpp/health/TransmissionProfile.cpp`
- [Contact pools](https://github.com/lwillem/stride/blob/master/main/cpp/contact/ContactPoolSys.cpp): `main/cpp/contact/ContactPoolSys.cpp`
- [Infection engine](https://github.com/lwillem/stride/blob/master/main/cpp/contact/Infector.cpp): `main/cpp/contact/Infector.cpp`

### Interventions and analysis

- [Survey manager](https://github.com/lwillem/stride/blob/master/main/cpp/pop/SurveyManager.cpp): `main/cpp/pop/SurveyManager.cpp`
- [Public health agency](https://github.com/lwillem/stride/blob/master/main/cpp/healthcare/PublicHealthAgency.cpp): `main/cpp/healthcare/PublicHealthAgency.cpp`
- [Vaccine policy](https://github.com/lwillem/stride/blob/master/main/cpp/mdp/MDP.cpp): `main/cpp/mdp/MDP.cpp`

### User interfaces

- [Python bindings](https://github.com/lwillem/stride/blob/master/main/python/pybind/libstride.cpp): `main/python/pybind/libstride.cpp`

### Other components

- **CLI user**
- **Python caller**

## Connections

- CLI user → Run controller: starts run
- Run configuration → Run controller: provides config
- Run controller → Simulation builder: builds simulation
- Simulation builder → Simulation: configures
- Simulation builder → Transmission profile: initializes
- Simulation builder → Health seeding: seeds health
- Simulation builder → Public health agency: initializes
- Simulation builder → Survey manager: creates
- Run controller → Simulation: advances steps
- Simulation → Simulation calendar: uses calendar
- Simulation → Population: holds population
- Population builder → Population: constructs
- Health seeding → Population: seeds health
- Health seeding → Transmission profile: uses profile
- Population → Person health: contains people
- Survey manager → Population: samples participants
- Survey manager → Person health: registers participants
- Vaccine policy → Simulation: controls simulation
- Vaccine policy → Population: vaccinates people
- Python caller → Python bindings: calls bindings
- Python bindings → Vaccine policy: exposes MDP
- Run controller → Run summary: writes summary
