# Mine Throughput Simulation
This project contains a discrete-event simulation of a synthetic mine haulage operation using **SimPy**. The model simulates truck cycles including travel, loading, and dumping to estimate the ore throughput to the primary crusher over an 8-hour shift.
## Installation and Execution
1. **Install dependencies**:
Ensure you have Python 3 installed. Install the required packages via pip:
```bash
pip install simpy pandas numpy networkx pyyaml
```
2. **Run the simulation**:
Execute the main script from the project root:
```bash
python3 sim.py
```
This will read all input data from the `data/` directory, execute 30 replications for all 6 scenarios, and generate the output files: `results.csv`, `summary.json`, and `event_log.csv`.
## Conceptual Model & Assumptions
Please refer to `conceptual_model.md` for a complete breakdown of the system boundary, entities, resources, events, state variables, and model limitations.
### Key Assumptions
- Trucks travel at a uniform speed corresponding to the road segment's speed limit multiplied by a state-dependent speed factor (loaded vs empty).
- Stochastic travel time is added dynamically using a truncated normal distribution with a Coefficient of Variation (CV) of 10%.
- Service times (loading and dumping) are modelled using truncated normal distributions to prevent negative durations.
- Capacity-constrained roads (e.g. ramps and single-lane pit access) are explicitly modelled as SimPy resources.
### Routing and Dispatching Logic
- **Routing**: Calculated dynamically using Dijkstra's shortest path algorithm (optimised for lowest expected travel time based on distance and speed limit) via `networkx`. If a road is closed (e.g. ramp closed), the route automatically adapts.
- **Dispatching**: When a truck is dispatched (either from parking or after dumping at the crusher), it evaluates all available loading points. It calculates a "score" equal to the travel time to the loader plus the expected queueing time at the loader (number of trucks in queue * mean load time). The truck selects the loader with the lowest score.
## Key Results and Operational Answers
Based on the 30 replications of an 8-hour shift, we observe the following:
**1. What is the expected ore throughput to the crusher during the baseline 8-hour shift?**
The baseline average throughput is **1,561 tonnes per hour**, equating to **~12,493 tonnes** total delivered per 8-hour shift.
**2. What are the likely bottlenecks in the haulage system?**
The **primary crusher** is the overarching bottleneck. In the baseline scenario, its utilisation is over **91%**, and the average time trucks spend queuing for the crusher is ~3.76 minutes. The South Pit loader (`LOAD_S`) is a secondary bottleneck with ~79% utilisation, whereas the North Pit loader is underutilised (~60%).
**3. Does adding more trucks materially improve throughput, or does the system saturate?**
The system **saturates**. Increasing the fleet from 8 to 12 trucks only yields a negligible increase in throughput (from 12,493 to 12,636 tonnes). However, the average truck cycle time jumps from ~29.8 minutes to ~43.5 minutes, and average crusher queue time explodes to over 15 minutes. Truck utilisation plummets to ~55%, indicating that extra trucks spend their shift queuing.
**4. Would improving the narrow ramp materially improve throughput?**
No. The `ramp_upgrade` scenario (removing capacity constraints and increasing ramp speed) results in ~12,503 tonnes, effectively identical to the baseline. Because the crusher is the actual system bottleneck, speeding up travel only means trucks reach the crusher queue faster; it does not increase overall system throughput.
**5. How sensitive is throughput to crusher service time?**
Highly sensitive. The `crusher_slowdown` scenario (increasing mean dump time to 7.0 minutes) drastically reduces throughput to **~6,413 tonnes** (down nearly 50%). Crusher queue times explode to ~28.3 minutes on average, and truck utilisation drops to ~46%. Since the crusher is the primary bottleneck, any degradation in its performance directly cripples system output.
**6. What is the operational impact of losing the main ramp route?**
Surprisingly, there is **virtually no impact** on total throughput. The `ramp_closed` scenario yields ~12,493 tonnes, identical to the baseline. The shortest-path routing smoothly diverts traffic via the longer bypass. While individual travel times increase, the delay is essentially absorbed by the reduced queuing time at the crusher. The crusher limits the system, so as long as trucks arrive fast enough to keep it busy (which they do via the bypass), throughput remains stable.
## Limitations and Future Improvements
- The model uses a greedy, myopic dispatch algorithm. A global predictive fleet management algorithm could yield slight improvements by balancing loader queues more effectively.
- Acceleration and deceleration times are not modelled.
- Intersections are only constrained if the segments are constrained; intersection interference delays are not explicitly modeled.
- **Suggested Additional Scenario**: Upgrade Crusher. Since the crusher is the bottleneck, adding a secondary dump point or upgrading the crusher processing rate would likely yield a massive increase in throughput, fully utilizing the 8-truck fleet.README.md
← Back to submission · View raw on GitHub