# spades1404/abmcovid architecture

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

- Interactive diagram: https://gitdiagram.com/spades1404/abmcovid
- Repository: https://github.com/spades1404/abmcovid

## Overview

ABMC19 is an agent-based COVID-19 simulation. The visible model setup initializes a grid, scheduler, hubs, and agents; the repository also includes agent behavior, data collection, batch execution, and interactive visualization. Source excerpts are limited, so several domain links are shown as unverified rather than asserted as confirmed calls.

Main entry points: [`ABMC19/Model/model.py`](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/model.py) (COVID model), [`ABMC19/Agents/agent.py`](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/agent.py) (Person agent), [`runIDLE.py`](https://github.com/spades1404/abmcovid/blob/master/runIDLE.py) (Desktop entry), [`ABMC19/Visualisation/visualisation.py`](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Visualisation/visualisation.py) (Simulation visualization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_entrypoint["Desktop entry<br/>[runIDLE.py]"]
  node_gui["GUI<br/>[gui.py]"]
  node_batch["Batch runner<br/>[batchrun.py]"]
end

subgraph group_simulation["Simulation model"]
  node_model["COVID model<br/>[model.py]"]
  node_scheduler["Activation scheduler<br/>[time.py]"]
  node_grid["Spatial grid<br/>[space.py]"]
  node_areas["Special areas"]
  node_coordinates["Coordinate generation<br/>[generateHubs.py]"]
end

subgraph group_agents["Agent behavior"]
  node_agent["Person agent<br/>[agent.py]"]
  node_characteristics["Agent characteristics<br/>[characteristics.py]"]
  node_movement["Movement<br/>[movementUpdate.py]"]
  node_pathfinding["Pathfinding<br/>[pathmaster.py]"]
  node_comparison["Neighbour comparison"]
  node_progression["Disease progression"]
  node_infection["Infection trails<br/>[infectionTrails.py]"]
  node_contact["Contact trails<br/>[contactTrails.py]"]
end

subgraph group_outputs["Visualization and data"]
  node_datacollection["Data collection<br/>[collectors.py]"]
  node_visualisation["Simulation visualization<br/>[visualisation.py]"]
  node_mesa_view["Grid visualization"]
end

node_user(("User"))

node_user -.->|"starts"| node_entrypoint
node_entrypoint -->|"references"| node_gui
node_entrypoint -->|"references"| node_model
node_entrypoint -->|"references"| node_visualisation
node_entrypoint -->|"references"| node_batch
node_model -->|"uses"| node_scheduler
node_model -->|"uses"| node_grid
node_model -->|"imports"| node_agent
node_model -->|"imports"| node_areas
node_model -->|"generates hubs"| node_coordinates
node_model -->|"generates agents"| node_agent
node_model -.->|"collects data"| node_datacollection
node_agent -.->|"uses"| node_characteristics
node_agent -.->|"updates movement"| node_movement
node_agent -.->|"delegates routing"| node_pathfinding
node_agent -.->|"checks neighbours"| node_comparison
node_agent -.->|"checks progression"| node_progression
node_agent -.->|"tracks infection"| node_infection
node_agent -.->|"tracks contacts"| node_contact
node_visualisation -->|"imports"| node_model
node_visualisation -->|"uses grid view"| node_mesa_view

click node_entrypoint "https://github.com/spades1404/abmcovid/blob/master/runIDLE.py"
click node_gui "https://github.com/spades1404/abmcovid/blob/master/ABMC19/GUI/gui.py"
click node_batch "https://github.com/spades1404/abmcovid/blob/master/ABMC19/batchrun.py"
click node_model "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/model.py"
click node_scheduler "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Libs/Mesa/time.py"
click node_grid "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Libs/Mesa/space.py"
click node_coordinates "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/CoordinateScripts/generateHubs.py"
click node_agent "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/agent.py"
click node_characteristics "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Characteristics/characteristics.py"
click node_movement "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/movementUpdate.py"
click node_pathfinding "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/Pathfinding/pathmaster.py"
click node_comparison "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/Comparisons/grabNeighbourAgents.py"
click node_progression "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/progressionCheck.py"
click node_infection "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/infectionTrails.py"
click node_contact "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/contactTrails.py"
click node_datacollection "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/DataCollectors/collectors.py"
click node_visualisation "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Visualisation/visualisation.py"
click node_mesa_view "https://github.com/spades1404/abmcovid/blob/master/ABMC19/Libs/Mesa/visualization/modules/CanvasGridVisualization.py"

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_entrypoint,node_gui,node_batch,node_user toneBlue
class node_model,node_scheduler,node_grid,node_areas,node_coordinates toneAmber
class node_agent,node_characteristics,node_movement,node_pathfinding,node_comparison,node_progression,node_infection,node_contact toneMint
class node_datacollection,node_visualisation,node_mesa_view toneRose
```

## Components

### Application entry

- [Desktop entry](https://github.com/spades1404/abmcovid/blob/master/runIDLE.py): `runIDLE.py`
- [GUI](https://github.com/spades1404/abmcovid/blob/master/ABMC19/GUI/gui.py): `ABMC19/GUI/gui.py`
- [Batch runner](https://github.com/spades1404/abmcovid/blob/master/ABMC19/batchrun.py): `ABMC19/batchrun.py`

### Simulation model

- [COVID model](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/model.py): `ABMC19/Model/model.py`
- [Activation scheduler](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Libs/Mesa/time.py): `ABMC19/Libs/Mesa/time.py`
- [Spatial grid](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Libs/Mesa/space.py): `ABMC19/Libs/Mesa/space.py`
- **Special areas**
- [Coordinate generation](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/CoordinateScripts/generateHubs.py): `ABMC19/Model/CoordinateScripts/generateHubs.py`

### Agent behavior

- [Person agent](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/agent.py): `ABMC19/Agents/agent.py`
- [Agent characteristics](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Characteristics/characteristics.py): `ABMC19/Agents/Characteristics/characteristics.py`
- [Movement](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/movementUpdate.py): `ABMC19/Agents/Actions/movementUpdate.py`
- [Pathfinding](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/Pathfinding/pathmaster.py): `ABMC19/Agents/Actions/Pathfinding/pathmaster.py`
- [Neighbour comparison](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/Comparisons/grabNeighbourAgents.py): `ABMC19/Agents/Actions/Comparisons/grabNeighbourAgents.py`
- [Disease progression](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/progressionCheck.py): `ABMC19/Agents/Actions/progressionCheck.py`
- [Infection trails](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/infectionTrails.py): `ABMC19/Agents/Actions/infectionTrails.py`
- [Contact trails](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Agents/Actions/contactTrails.py): `ABMC19/Agents/Actions/contactTrails.py`

### Visualization and data

- [Data collection](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Model/DataCollectors/collectors.py): `ABMC19/Model/DataCollectors/collectors.py`
- [Simulation visualization](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Visualisation/visualisation.py): `ABMC19/Visualisation/visualisation.py`
- [Grid visualization](https://github.com/spades1404/abmcovid/blob/master/ABMC19/Libs/Mesa/visualization/modules/CanvasGridVisualization.py): `ABMC19/Libs/Mesa/visualization/modules/CanvasGridVisualization.py`

### Other components

- **User**

## Connections

- User → Desktop entry: starts
- Desktop entry → GUI: references (evidence: `runIDLE.py`)
- Desktop entry → COVID model: references (evidence: `runIDLE.py`)
- Desktop entry → Simulation visualization: references (evidence: `runIDLE.py`)
- Desktop entry → Batch runner: references (evidence: `runIDLE.py`)
- COVID model → Activation scheduler: uses (evidence: `ABMC19/Model/model.py`)
- COVID model → Spatial grid: uses (evidence: `ABMC19/Model/model.py`)
- COVID model → Person agent: imports (evidence: `ABMC19/Model/model.py`)
- COVID model → Special areas: imports (evidence: `ABMC19/Model/model.py`)
- COVID model → Coordinate generation: generates hubs (evidence: `ABMC19/Model/model.py`)
- COVID model → Person agent: generates agents (evidence: `ABMC19/Model/model.py`)
- COVID model → Data collection: collects data (evidence: `ABMC19/Model/model.py`)
- Person agent → Agent characteristics: uses
- Person agent → Movement: updates movement
- Person agent → Pathfinding: delegates routing
- Person agent → Neighbour comparison: checks neighbours
- Person agent → Disease progression: checks progression
- Person agent → Infection trails: tracks infection
- Person agent → Contact trails: tracks contacts
- Simulation visualization → COVID model: imports (evidence: `ABMC19/Visualisation/visualisation.py`)
- Simulation visualization → Grid visualization: uses grid view (evidence: `ABMC19/Visualisation/visualisation.py`)
