# guruchiwate06/path_rl architecture

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

- Interactive diagram: https://gitdiagram.com/guruchiwate06/path_rl
- Repository: https://github.com/guruchiwate06/path_rl

## Overview

This is a 2D multi-agent evacuation simulation and scenario-analysis framework. A user selects a scenario and run mode; the system configures a building and occupants, simulates movement and capacity conflicts, then reports metrics or runs repeated parameter sweeps. Major documented capabilities also include exit-configuration generation, regulatory evaluation and search, agent profiles, and interactive/offline visualization. The README documents the simulation’s main dependency flow; sampled source confirms the timestep loop, movement conflict resolution, experiment orchestration, and visualization. Exit-search implementation files are not present in the supplied tree, so that capability is represented at the simulation-directory level.

Main entry points: [`simulation/simulation.py`](https://github.com/guruchiwate06/path_rl/blob/master/simulation/simulation.py) (Timestep simulation), [`main.py`](https://github.com/guruchiwate06/path_rl/blob/master/main.py) (CLI runner), [`simulation/config.py`](https://github.com/guruchiwate06/path_rl/blob/master/simulation/config.py) (Scenario models), [`simulation/experiment.py`](https://github.com/guruchiwate06/path_rl/blob/master/simulation/experiment.py) (Batch experiments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Run Interface"]
  node_cli["CLI runner<br/>[main.py]"]
end

subgraph group_configuration["Scenario Setup"]
  node_scenario["Scenario JSON"]
  node_config["Scenario models<br/>[config.py]"]
  node_exitgen["Candidate exits<br/>[generation.py]"]
  node_exitrules["Exit compliance and search"]
end

subgraph group_engine["Simulation Engine"]
  node_environment["Building grid<br/>[environment.py]"]
  node_agents["Occupant agents<br/>[agent.py]"]
  node_profiles["Agent profiles<br/>[profile.py]"]
  node_navigation["Navigation graph<br/>[pathfinding.py]"]
  node_strategy["Movement strategy<br/>[strategy.py]"]
  node_occupancy["Cell capacity<br/>[occupancy.py]"]
  node_movement["Move resolution<br/>[movement.py]"]
  node_simulation["Timestep simulation<br/>[simulation.py]"]
end

subgraph group_analysis["Analysis Tools"]
  node_metrics["Run metrics<br/>[metrics.py]"]
  node_experiments["Batch experiments<br/>[experiment.py]"]
  node_rl["RL environment<br/>[rl_environment.py]"]
  node_results["Run outputs"]
end

subgraph group_visuals["Visualization"]
  node_mpl["Interactive inspector<br/>[visualize.py]"]
  node_web["Browser visualizer<br/>[visualize.html]"]
end

node_user(("Scenario analyst"))

node_user -->|"selects run"| node_cli
node_cli -->|"loads scenario"| node_scenario
node_cli -->|"validates config"| node_config
node_config -->|"defines geometry"| node_environment
node_exitgen -->|"proposes exits"| node_exitrules
node_exitrules -->|"selects exits"| node_config
node_config -->|"provides layout"| node_environment
node_environment -->|"builds graph"| node_navigation
node_agents -->|"participate in"| node_simulation
node_profiles -->|"sets eligibility"| node_simulation
node_navigation -->|"guides routes"| node_strategy
node_strategy -->|"proposes moves"| node_simulation
node_simulation -->|"resolves requests"| node_movement
node_movement -->|"checks capacity"| node_occupancy
node_simulation -->|"records outcomes"| node_metrics
node_cli -->|"runs simulation"| node_simulation
node_cli -->|"starts batch run"| node_experiments
node_experiments -->|"executes runs"| node_simulation
node_experiments -->|"exports results"| node_results
node_simulation -.->|"supports RL interface"| node_rl
node_user -->|"inspects run"| node_mpl
node_mpl -->|"displays state"| node_simulation
node_user -->|"views visualization"| node_web

click node_cli "https://github.com/guruchiwate06/path_rl/blob/master/main.py"
click node_scenario "https://github.com/guruchiwate06/path_rl/tree/master/scenarios"
click node_config "https://github.com/guruchiwate06/path_rl/blob/master/simulation/config.py"
click node_exitgen "https://github.com/guruchiwate06/path_rl/blob/master/simulation/generation.py"
click node_exitrules "https://github.com/guruchiwate06/path_rl/tree/master/simulation"
click node_environment "https://github.com/guruchiwate06/path_rl/blob/master/simulation/environment.py"
click node_agents "https://github.com/guruchiwate06/path_rl/blob/master/simulation/agent.py"
click node_profiles "https://github.com/guruchiwate06/path_rl/blob/master/simulation/profile.py"
click node_navigation "https://github.com/guruchiwate06/path_rl/blob/master/simulation/pathfinding.py"
click node_strategy "https://github.com/guruchiwate06/path_rl/blob/master/simulation/strategy.py"
click node_occupancy "https://github.com/guruchiwate06/path_rl/blob/master/simulation/occupancy.py"
click node_movement "https://github.com/guruchiwate06/path_rl/blob/master/simulation/movement.py"
click node_simulation "https://github.com/guruchiwate06/path_rl/blob/master/simulation/simulation.py"
click node_metrics "https://github.com/guruchiwate06/path_rl/blob/master/simulation/metrics.py"
click node_experiments "https://github.com/guruchiwate06/path_rl/blob/master/simulation/experiment.py"
click node_rl "https://github.com/guruchiwate06/path_rl/blob/master/simulation/rl_environment.py"
click node_mpl "https://github.com/guruchiwate06/path_rl/blob/master/visualize.py"
click node_web "https://github.com/guruchiwate06/path_rl/blob/master/visualize.html"
click node_results "https://github.com/guruchiwate06/path_rl/tree/master/experiment_output"

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_cli toneBlue
class node_scenario,node_config,node_exitgen,node_exitrules toneAmber
class node_environment,node_agents,node_profiles,node_navigation,node_strategy,node_occupancy,node_movement,node_simulation toneMint
class node_metrics,node_experiments,node_rl,node_results toneRose
class node_mpl,node_web,node_user toneIndigo
```

## Components

### Run Interface

- [CLI runner](https://github.com/guruchiwate06/path_rl/blob/master/main.py): `main.py`

### Scenario Setup

- [Scenario JSON](https://github.com/guruchiwate06/path_rl/tree/master/scenarios): `scenarios`
- [Scenario models](https://github.com/guruchiwate06/path_rl/blob/master/simulation/config.py): `simulation/config.py`
- [Candidate exits](https://github.com/guruchiwate06/path_rl/blob/master/simulation/generation.py): `simulation/generation.py`
- [Exit compliance and search](https://github.com/guruchiwate06/path_rl/tree/master/simulation): `simulation`

### Simulation Engine

- [Building grid](https://github.com/guruchiwate06/path_rl/blob/master/simulation/environment.py): `simulation/environment.py`
- [Occupant agents](https://github.com/guruchiwate06/path_rl/blob/master/simulation/agent.py): `simulation/agent.py`
- [Agent profiles](https://github.com/guruchiwate06/path_rl/blob/master/simulation/profile.py): `simulation/profile.py`
- [Navigation graph](https://github.com/guruchiwate06/path_rl/blob/master/simulation/pathfinding.py): `simulation/pathfinding.py`
- [Movement strategy](https://github.com/guruchiwate06/path_rl/blob/master/simulation/strategy.py): `simulation/strategy.py`
- [Cell capacity](https://github.com/guruchiwate06/path_rl/blob/master/simulation/occupancy.py): `simulation/occupancy.py`
- [Move resolution](https://github.com/guruchiwate06/path_rl/blob/master/simulation/movement.py): `simulation/movement.py`
- [Timestep simulation](https://github.com/guruchiwate06/path_rl/blob/master/simulation/simulation.py): `simulation/simulation.py`

### Analysis Tools

- [Run metrics](https://github.com/guruchiwate06/path_rl/blob/master/simulation/metrics.py): `simulation/metrics.py`
- [Batch experiments](https://github.com/guruchiwate06/path_rl/blob/master/simulation/experiment.py): `simulation/experiment.py`
- [RL environment](https://github.com/guruchiwate06/path_rl/blob/master/simulation/rl_environment.py): `simulation/rl_environment.py`
- [Run outputs](https://github.com/guruchiwate06/path_rl/tree/master/experiment_output): `experiment_output`

### Visualization

- [Interactive inspector](https://github.com/guruchiwate06/path_rl/blob/master/visualize.py): `visualize.py`
- [Browser visualizer](https://github.com/guruchiwate06/path_rl/blob/master/visualize.html): `visualize.html`

### Other components

- **Scenario analyst**

## Connections

- Scenario analyst → CLI runner: selects run (evidence: `README.md`)
- CLI runner → Scenario JSON: loads scenario (evidence: `main.py`)
- CLI runner → Scenario models: validates config (evidence: `README.md`)
- Scenario models → Building grid: defines geometry (evidence: `README.md`)
- Candidate exits → Exit compliance and search: proposes exits (evidence: `README.md`)
- Exit compliance and search → Scenario models: selects exits (evidence: `README.md`)
- Scenario models → Building grid: provides layout (evidence: `README.md`)
- Building grid → Navigation graph: builds graph (evidence: `README.md`)
- Occupant agents → Timestep simulation: participate in (evidence: `README.md`)
- Agent profiles → Timestep simulation: sets eligibility (evidence: `simulation/simulation.py`)
- Navigation graph → Movement strategy: guides routes (evidence: `simulation/strategy.py`)
- Movement strategy → Timestep simulation: proposes moves (evidence: `README.md`)
- Timestep simulation → Move resolution: resolves requests (evidence: `README.md`)
- Move resolution → Cell capacity: checks capacity (evidence: `README.md`)
- Timestep simulation → Run metrics: records outcomes (evidence: `README.md`)
- CLI runner → Timestep simulation: runs simulation (evidence: `main.py`)
- CLI runner → Batch experiments: starts batch run (evidence: `main.py`)
- Batch experiments → Timestep simulation: executes runs (evidence: `simulation/experiment.py`)
- Batch experiments → Run outputs: exports results (evidence: `README.md`)
- Timestep simulation → RL environment: supports RL interface
- Scenario analyst → Interactive inspector: inspects run (evidence: `README.md`)
- Interactive inspector → Timestep simulation: displays state (evidence: `visualize.py`)
- Scenario analyst → Browser visualizer: views visualization (evidence: `README.md`)
