This project was developed as a semester work for the Discrete Optimization course at the Faculty of Management Science and Informatics (FRI), University of Žilina (2026). The core objective is to simulate a food delivery courier's routes to determine the fastest possible path and to calculate the latest possible departure time that guarantees a timely return. The simulation utilizes custom-built pseudorandom number generators to accurately model real-world variables, such as varying traffic speeds and intersection delays.
- Custom Pseudorandom Generators: Implemented four distinct generators:
DiscreteUniformGen,ContinuousUniformGen,DiscreteEmpiricalGen, andContinuousEmpiricalGen. - Robust Architecture: All generators implement a unified
IGeneratorinterface with adouble Sample()method, ensuring flexibility across the simulation. Generators were rigorously tested on 100 million generated values. - Complex Routing Map: The simulation environment models 18 distinct road sections. Each section type has a specific probability distribution for average speed (ranging from discrete uniform to continuous empirical distributions).
- Dynamic Traffic Jams: Implements a time-dependent delay model at a critical intersection ("K"), where traffic jams build up starting at 6:30 AM.
- Monte Carlo Experiments: The project evaluates 6 different route combinations using millions of replications via a scalable
SimulationCoreabstract class.
Extensive experiments were conducted to find the optimal logistics strategy:
- Optimal Route Selection: After running 100,000,000 replications across 6 possible routes, the simulation determined that ZDRSZ is the fastest route.
- Latest Departure Time: A specific
DeparatureExperimentwas designed to find the exact latest departure time. To guarantee an 80% probability of returning to Žilina before the 7:35 AM deadline, the courier must depart exactly at 7:08:34 AM. Leaving even one second later fails the 80% threshold. Verified using 10,000,000 replications.
- Simulation Engine: Based on an abstract
SimulationCoreclass controlling replications. - Experiment Types: Includes specialized implementations like
FoodDeliveryExperiment(evaluating total route times) andProbabilityExperiment(evaluating binary success/fail states for deadlines). - Data Structures: Heavy reliance on Object-Oriented principles, utilizing enumerations (
SectionType,RouteType), inheritance, and polymorphism.