# nicolelozadaleon/nicolelozadacuda architecture

> Architecture diagram of the GitHub repository nicolelozadaleon/nicolelozadacuda, 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/nicolelozadaleon/nicolelozadacuda
- Repository: https://github.com/nicolelozadaleon/nicolelozadacuda

## Overview

Equipetrol Delivery is a multithreaded, accelerated-time courier-delivery simulator, with a live map view and JSON event log/summary. Its main workflow is order generation, dispatcher ranking and assignment, courier pickup and delivery, and event recording. Simulation owns the runtime objects and threads; shared monitors coordinate work, while the street graph supports travel and estimates. The README documents the runtime interactions used here; source excerpts are limited, so unshown implementation details and optional behavior are not expanded.

Main entry points: [`src/app/Simulation.cpp`](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/app/Simulation.cpp) (Simulation owner), [`src/actors/Courier.cpp`](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Courier.cpp) (Courier workers), [`src/actors/Dispatcher.cpp`](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Dispatcher.cpp) (Dispatcher), [`src/shared/EventLog.cpp`](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/EventLog.cpp) (Event log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime orchestration"]
  node_main["Program entry<br/>[main.cpp]"]
  node_simulation["Simulation owner<br/>[Simulation.cpp]"]
  node_settings["Run settings<br/>[Settings.h]"]
end

subgraph group_domain["Delivery workflow"]
  node_generator["Order generator<br/>[OrderGenerator.cpp]"]
  node_dispatcher["Dispatcher<br/>[Dispatcher.cpp]"]
  node_courier["Courier workers<br/>[Courier.cpp]"]
end

subgraph group_coordination["Shared coordination"]
  node_fleet["Fleet coordination<br/>[Fleet.cpp]"]
  node_orderbook["Pending orders<br/>[OrderBook.cpp]"]
  node_restaurant["Pickup slots<br/>[Restaurant.cpp]"]
  node_estimatepool["Estimate pool<br/>[EstimatePool.h]"]
end

subgraph group_model["Simulation model"]
  node_config["Configuration<br/>[Config.cpp]"]
  node_graph["Street graph<br/>[Graph.cpp]"]
  node_order["Order data<br/>[Order.h]"]
  node_clock["Simulation clock<br/>[SimClock.h]"]
end

subgraph group_presentation["Output and view"]
  node_eventlog[("Event log<br/>[EventLog.cpp]")]
  node_window["Live map window<br/>[Window.cpp]"]
end

node_operator(("Operator"))

node_operator -->|"starts run"| node_main
node_main -->|"loads config"| node_config
node_main -->|"starts simulation"| node_simulation
node_main -->|"draws frames"| node_window
node_simulation -->|"starts thread"| node_generator
node_simulation -->|"starts thread"| node_dispatcher
node_simulation -->|"starts threads"| node_courier
node_simulation -->|"shuts down"| node_estimatepool
node_simulation -->|"uses settings"| node_settings
node_simulation -->|"builds graph"| node_graph
node_simulation -->|"writes stop event"| node_eventlog
node_generator -->|"submits orders"| node_orderbook
node_generator -->|"records events"| node_eventlog
node_dispatcher -->|"takes orders"| node_orderbook
node_dispatcher -->|"submits estimates"| node_estimatepool
node_dispatcher -->|"waits for change"| node_fleet
node_dispatcher -->|"offers orders"| node_courier
node_dispatcher -->|"records rejection"| node_eventlog
node_courier -->|"notifies changes"| node_fleet
node_courier -->|"acquires slots"| node_restaurant
node_courier -->|"records delivery events"| node_eventlog
node_courier -->|"routes travel"| node_graph
node_window -->|"reads snapshots"| node_courier
node_window -->|"reads delivery nodes"| node_orderbook
node_window -->|"draws map nodes"| node_graph
node_eventlog -->|"timestamps events"| node_clock
node_orderbook -->|"stores orders"| node_order

click node_main "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/main.cpp"
click node_simulation "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/app/Simulation.cpp"
click node_settings "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Settings.h"
click node_generator "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/OrderGenerator.cpp"
click node_dispatcher "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Dispatcher.cpp"
click node_courier "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Courier.cpp"
click node_fleet "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Fleet.cpp"
click node_orderbook "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/OrderBook.cpp"
click node_restaurant "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/Restaurant.cpp"
click node_estimatepool "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/parallel/EstimatePool.h"
click node_eventlog "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/EventLog.cpp"
click node_config "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Config.cpp"
click node_graph "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Graph.cpp"
click node_order "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Order.h"
click node_clock "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/SimClock.h"
click node_window "https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/view/Window.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_main,node_simulation,node_settings toneBlue
class node_generator,node_dispatcher,node_courier toneAmber
class node_fleet,node_orderbook,node_restaurant,node_estimatepool toneMint
class node_config,node_graph,node_order,node_clock toneRose
class node_eventlog,node_window,node_operator toneIndigo
```

## Components

### Runtime orchestration

- [Program entry](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/main.cpp): `src/main.cpp`
- [Simulation owner](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/app/Simulation.cpp): `src/app/Simulation.cpp`
- [Run settings](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Settings.h): `src/core/Settings.h`

### Delivery workflow

- [Order generator](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/OrderGenerator.cpp): `src/actors/OrderGenerator.cpp`
- [Dispatcher](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Dispatcher.cpp): `src/actors/Dispatcher.cpp`
- [Courier workers](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Courier.cpp): `src/actors/Courier.cpp`

### Shared coordination

- [Fleet coordination](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/actors/Fleet.cpp): `src/actors/Fleet.cpp`
- [Pending orders](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/OrderBook.cpp): `src/shared/OrderBook.cpp`
- [Pickup slots](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/Restaurant.cpp): `src/shared/Restaurant.cpp`
- [Estimate pool](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/parallel/EstimatePool.h): `src/parallel/EstimatePool.h`

### Simulation model

- [Configuration](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Config.cpp): `src/core/Config.cpp`
- [Street graph](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Graph.cpp): `src/core/Graph.cpp`
- [Order data](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/Order.h): `src/core/Order.h`
- [Simulation clock](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/core/SimClock.h): `src/core/SimClock.h`

### Output and view

- [Event log](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/shared/EventLog.cpp): `src/shared/EventLog.cpp`
- [Live map window](https://github.com/nicolelozadaleon/nicolelozadacuda/blob/main/src/view/Window.cpp): `src/view/Window.cpp`

### Other components

- **Operator**

## Connections

- Operator → Program entry: starts run (evidence: `README.md`)
- Program entry → Configuration: loads config (evidence: `README.md`)
- Program entry → Simulation owner: starts simulation (evidence: `README.md`)
- Program entry → Live map window: draws frames (evidence: `README.md`)
- Simulation owner → Order generator: starts thread (evidence: `README.md`)
- Simulation owner → Dispatcher: starts thread (evidence: `README.md`)
- Simulation owner → Courier workers: starts threads (evidence: `README.md`)
- Simulation owner → Estimate pool: shuts down (evidence: `README.md`)
- Simulation owner → Run settings: uses settings (evidence: `README.md`)
- Simulation owner → Street graph: builds graph (evidence: `README.md`)
- Simulation owner → Event log: writes stop event (evidence: `README.md`)
- Order generator → Pending orders: submits orders (evidence: `README.md`)
- Order generator → Event log: records events (evidence: `README.md`)
- Dispatcher → Pending orders: takes orders (evidence: `README.md`)
- Dispatcher → Estimate pool: submits estimates (evidence: `README.md`)
- Dispatcher → Fleet coordination: waits for change (evidence: `README.md`)
- Dispatcher → Courier workers: offers orders (evidence: `README.md`)
- Dispatcher → Event log: records rejection (evidence: `README.md`)
- Courier workers → Fleet coordination: notifies changes (evidence: `README.md`)
- Courier workers → Pickup slots: acquires slots (evidence: `README.md`)
- Courier workers → Event log: records delivery events (evidence: `README.md`)
- Courier workers → Street graph: routes travel (evidence: `README.md`)
- Live map window → Courier workers: reads snapshots (evidence: `README.md`)
- Live map window → Pending orders: reads delivery nodes (evidence: `README.md`)
- Live map window → Street graph: draws map nodes (evidence: `README.md`)
- Event log → Simulation clock: timestamps events
- Pending orders → Order data: stores orders
