# stevenfap1815/equipeproyecto architecture

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

- Interactive diagram: https://gitdiagram.com/stevenfap1815/equipeproyecto
- Repository: https://github.com/stevenfap1815/equipeproyecto

## Overview

Equipetrol Delivery simulates concurrent food-order dispatch on a street map. The principal workflow is configuration and network setup, order generation, queued dispatch with parallel courier estimates, assignment and pickup, then delivery or breakdown/rescue; event logging and live rendering expose results. The README documents concurrency channels, shutdown, experiments, and map tooling. Some implementation paths were not excerpted, so their documented relationships cite the README rather than implying source inspection.

Main entry points: [`src/main.cpp`](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/main.cpp) (Simulation entry), [`src/sim/Courier.cpp`](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Courier.cpp) (Courier lifecycle), [`src/sim/OrderGenerator.cpp`](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/OrderGenerator.cpp) (Order generator), [`src/sim/Dispatcher.cpp`](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Dispatcher.cpp) (Dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and map"]
  node_config["Config loader<br/>[ConfigLoader.cpp]"]
  node_streets["Street network<br/>[StreetNetwork.cpp]"]
  node_pathfinder["Route finding<br/>[PathFinder.cpp]"]
  node_osm["OSM conversion<br/>[osm_to_config.py]"]
end

subgraph group_dispatch["Order dispatch"]
  node_generator["Order generator<br/>[OrderGenerator.cpp]"]
  node_book["Pending orders<br/>[OrderBook.cpp]"]
  node_dispatcher["Dispatcher<br/>[Dispatcher.cpp]"]
end

subgraph group_delivery["Courier operations"]
  node_fleet["Courier fleet<br/>[Fleet.cpp]"]
  node_courier["Courier lifecycle<br/>[Courier.cpp]"]
  node_desk["Restaurant queues<br/>[PickupDesk.cpp]"]
end

subgraph group_runtime["Runtime and output"]
  node_main["Simulation entry<br/>[main.cpp]"]
  node_clock["Simulation clock<br/>[SimClock.cpp]"]
  node_change["Availability signal<br/>[ChangeSignal.cpp]"]
  node_shutdown["Shutdown control<br/>[ShutdownToken.cpp]"]
  node_log[("Event log<br/>[EventLog.cpp]")]
  node_renderer["Live map renderer<br/>[Renderer.cpp]"]
  node_experiments["Experiment runner<br/>[run_experiment.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts simulation"| node_main
node_main -->|"loads configuration"| node_config
node_main -->|"builds network"| node_streets
node_osm -.->|"generates map config"| node_config
node_main -->|"starts producer"| node_generator
node_generator -->|"pushes orders"| node_book
node_book -->|"provides orders"| node_dispatcher
node_dispatcher -->|"estimates routes"| node_pathfinder
node_dispatcher -->|"selects couriers"| node_fleet
node_fleet -->|"starts courier threads"| node_courier
node_courier -->|"joins pickup queue"| node_desk
node_courier -->|"signals availability"| node_change
node_dispatcher -->|"waits for availability"| node_change
node_courier -->|"waits for travel"| node_clock
node_generator -->|"waits between orders"| node_clock
node_main -->|"requests stop"| node_shutdown
node_main -->|"reads summary"| node_log
node_generator -->|"records order events"| node_log
node_courier -->|"records delivery events"| node_log
node_main -->|"starts renderer"| node_renderer
node_renderer -->|"reads courier state"| node_fleet
node_renderer -->|"reads summary"| node_log
node_experiments -->|"runs scenarios"| node_main

click node_main "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/main.cpp"
click node_config "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/infra/ConfigLoader.cpp"
click node_streets "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/core/StreetNetwork.cpp"
click node_pathfinder "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/core/PathFinder.cpp"
click node_osm "https://github.com/stevenfap1815/equipeproyecto/blob/main/tools/osm_to_config.py"
click node_generator "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/OrderGenerator.cpp"
click node_book "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/OrderBook.cpp"
click node_dispatcher "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Dispatcher.cpp"
click node_fleet "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Fleet.cpp"
click node_courier "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Courier.cpp"
click node_desk "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/PickupDesk.cpp"
click node_clock "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/SimClock.cpp"
click node_change "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/ChangeSignal.cpp"
click node_shutdown "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/ShutdownToken.cpp"
click node_log "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/infra/EventLog.cpp"
click node_renderer "https://github.com/stevenfap1815/equipeproyecto/blob/main/src/viz/Renderer.cpp"
click node_experiments "https://github.com/stevenfap1815/equipeproyecto/blob/main/tools/run_experiment.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_config,node_streets,node_pathfinder,node_osm toneBlue
class node_generator,node_book,node_dispatcher toneAmber
class node_fleet,node_courier,node_desk toneMint
class node_main,node_clock,node_change,node_shutdown,node_log,node_renderer,node_experiments toneRose
class node_operator toneIndigo
```

## Components

### Setup and map

- [Config loader](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/infra/ConfigLoader.cpp): `src/infra/ConfigLoader.cpp`
- [Street network](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/core/StreetNetwork.cpp): `src/core/StreetNetwork.cpp`
- [Route finding](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/core/PathFinder.cpp): `src/core/PathFinder.cpp`
- [OSM conversion](https://github.com/stevenfap1815/equipeproyecto/blob/main/tools/osm_to_config.py): `tools/osm_to_config.py`

### Order dispatch

- [Order generator](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/OrderGenerator.cpp): `src/sim/OrderGenerator.cpp`
- [Pending orders](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/OrderBook.cpp): `src/concurrency/OrderBook.cpp`
- [Dispatcher](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Dispatcher.cpp): `src/sim/Dispatcher.cpp`

### Courier operations

- [Courier fleet](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Fleet.cpp): `src/sim/Fleet.cpp`
- [Courier lifecycle](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/Courier.cpp): `src/sim/Courier.cpp`
- [Restaurant queues](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/PickupDesk.cpp): `src/concurrency/PickupDesk.cpp`

### Runtime and output

- [Simulation entry](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/main.cpp): `src/main.cpp`
- [Simulation clock](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/sim/SimClock.cpp): `src/sim/SimClock.cpp`
- [Availability signal](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/ChangeSignal.cpp): `src/concurrency/ChangeSignal.cpp`
- [Shutdown control](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/concurrency/ShutdownToken.cpp): `src/concurrency/ShutdownToken.cpp`
- [Event log](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/infra/EventLog.cpp): `src/infra/EventLog.cpp`
- [Live map renderer](https://github.com/stevenfap1815/equipeproyecto/blob/main/src/viz/Renderer.cpp): `src/viz/Renderer.cpp`
- [Experiment runner](https://github.com/stevenfap1815/equipeproyecto/blob/main/tools/run_experiment.py): `tools/run_experiment.py`

### Other components

- **Operator**

## Connections

- Operator → Simulation entry: starts simulation
- Simulation entry → Config loader: loads configuration (evidence: `src/main.cpp`)
- Simulation entry → Street network: builds network (evidence: `src/main.cpp`)
- OSM conversion → Config loader: generates map config
- Simulation entry → Order generator: starts producer
- Order generator → Pending orders: pushes orders
- Pending orders → Dispatcher: provides orders (evidence: `src/concurrency/OrderBook.cpp`)
- Dispatcher → Route finding: estimates routes (evidence: `src/sim/Dispatcher.cpp`)
- Dispatcher → Courier fleet: selects couriers
- Courier fleet → Courier lifecycle: starts courier threads
- Courier lifecycle → Restaurant queues: joins pickup queue
- Courier lifecycle → Availability signal: signals availability
- Dispatcher → Availability signal: waits for availability
- Courier lifecycle → Simulation clock: waits for travel
- Order generator → Simulation clock: waits between orders
- Simulation entry → Shutdown control: requests stop (evidence: `src/main.cpp`)
- Simulation entry → Event log: reads summary (evidence: `src/main.cpp`)
- Order generator → Event log: records order events
- Courier lifecycle → Event log: records delivery events
- Simulation entry → Live map renderer: starts renderer
- Live map renderer → Courier fleet: reads courier state (evidence: `src/viz/Renderer.cpp`)
- Live map renderer → Event log: reads summary
- Experiment runner → Simulation entry: runs scenarios (evidence: `tools/run_experiment.py`)
