How alfredozc/rider_and_threads works
Equipetrol Delivery is a concurrent, accelerated-time C++ delivery-dispatch simulator. Its main workflow loads and validates JSON configuration, generates orders, admits them to a bounded order book, dispatches them to couriers, and records delivery outcomes and a summary. Restaurants impose pickup-slot constraints; routing uses the configured street graph, while breakdowns and optional reinforcements affect fleet operations. The live map and event log expose the run. Edges below reflect README-described behavior and visible startup code; several implementation details are unsampled, so their internal links are omitted.
Main entry points: main.cpp Simulation and map view · Dispatcher.cpp Dispatcher · CourierActor.cpp Courier actor · OrderBook.cpp Order book
Components 21
Configuration and map
- JSON configuration
src/Config.cpp - Street graph
src/CityGraph.cpp - Route planner
src/Router.cpp
Order lifecycle
- Order generator
src/OrderGenerator.cpp - Order factory
src/OrderFactory.cpp - Order book
src/OrderBook.cpp - Restaurant slots
src/Restaurant.cpp - Order state
src/Order.h
Dispatch and fleet
- Courier quotes
src/Quote.cpp - Quote pool
src/QuotePool.cpp - Dispatcher
src/Dispatcher.cpp - Courier actor
src/CourierActor.cpp - Courier fleet
src/Fleet.cpp - Courier state
src/Courier.h
Simulation runtime
- Simulation clock
src/SimClock.h - Shared context
src/SimContext.h - Domain identifiers
src/Ids.h - Simulation and map view
src/main.cpp
Observability
- Event log
src/EventLog.cpp - Run summary
src/Summary.cpp
Other components
- Operator
Connections 25
- Operator → Simulation and map view: starts run
README.md - Simulation and map view → JSON configuration: loads
src/main.cpp - Simulation and map view → Street graph: builds graph
src/main.cpp - Street graph → Route planner: routes over
- Simulation and map view → Order generator: starts generator
src/main.cpp - Order generator → Order factory: creates orders
- Order generator → Order book: submits orders
- Simulation and map view → Dispatcher: starts dispatcher
src/main.cpp - Dispatcher → Order book: reads waiting orders
README.md - Dispatcher → Quote pool: collects quotes
- Quote pool → Courier quotes: produces quotes
- Dispatcher → Courier actor: assigns orders
README.md - Courier actor → Route planner: plans trips
- Courier actor → Order book: updates order state
README.md - Courier actor → Restaurant slots: waits for pickup slot
README.md - Dispatcher → Courier fleet: requests reinforcements
README.md - Courier fleet → Courier actor: starts couriers
- Simulation and map view → Event log: records events
README.md - Order book → Event log: logs transitions
- Simulation and map view → Run summary: prints results
README.md - Simulation and map view → Order book: renders live state
src/main.cpp - Simulation and map view → Simulation clock: times simulation
src/main.cpp - Simulation and map view → Shared context: shares runtime state
src/SimContext.h - Order state → Domain identifiers: uses identifiers
src/Order.h - Courier state → Domain identifiers: uses identifiers
src/Courier.h