PROJECT STUDY

Mining Haul Dispatch

Send each truck where the plan needs it, and say why.

Haul dispatch for open-pit mines: a linear program plans haul flows inside the coal-quality band, and each truck goes to the excavator furthest behind plan, with the reason logged.

Explore the build
Illustration of the dispatch interface: a pit road graph with haul trucks, four excavators, a dump and a fuel bay beside a dispatch decision that sends truck HT-14 to excavator EX-03 as the face furthest behind plan, with tonnes-against-plan bars and demo KPI tiles.
Original interface illustration · Synthetic demo data.View larger

At a glance

Industry
Mining
Capabilities
8
Technologies
13
Year
2026

The challenge

Without coordinated dispatch, haul trucks bunch up: a queue forms at one excavator while another stands idle, opposing trucks meet on single-lane ramps and the fuel bay jams at shift change.

In an open-pit coal or nickel mine, every truck cycles between excavators, haul roads, waste dumps or the ROM stockpile and the fuel bay, so a delay at one point spreads through the whole cycle.

Weighbridge records show under- and overloaded trucks, and the coal sent to the stockpile has to stay inside a calorific-value and ash band. Sites already collect truck GPS, CCTV, weighbridge and fuel data, but nothing turns those signals into dispatch and traffic decisions with a reason a supervisor can check.

What we built

Mining Haul Dispatch pairs a two-stage dispatch engine with a shift simulator, a FastAPI service and a supervisor dashboard built around the pit map.

A haul plan inside the coal band

A linear program sets the target flow on every excavator-to-dump route within dig rates, dump capacities, truck hours and the calorific-value and ash band at the ROM stockpile, then names the limits that bind and what one more truck would add

A haul plan inside the coal band

A linear program sets the target flow on every excavator-to-dump route within dig rates, dump capacities, truck hours and the calorific-value and ash band at the ROM stockpile, then names the limits that bind and what one more truck would add

Truck assignments that explain themselves

When a truck finishes dumping, it goes to the excavator furthest behind its planned flow, net of the time to get there and the queue it would meet. Every decision stores its reason, the candidates it weighed and the runner-up

Safe single-lane ramps

Time-window bookings keep opposing trucks off the same single-lane segment, ramp control gives loaded trucks priority on the climb, and an entry gate enforces the rule on the road whatever the bookings say

Refuelling spread across the shift

With fuel scheduling on, a truck inside its refuel window goes to the fuel bay only when the predicted wait there is short, instead of every truck refuelling in the shift-change rush, and a truck at the fuel floor always refuels

Payload compliance

Every load is checked against the 10/10/20 payload policy and shown on a payload histogram, and weighed tonnes are reconciled with the plan for each excavator

Site feeds and congestion

Typed adapters read truck GPS, CCTV queue counts, weighbridge and on-board payload tickets and fuel telemetry, fed in the demo by synthetic streams. Slow GPS speeds put a haul road on watch, a camera count of three or more trucks or a deeper slowdown marks it congested, and the CCTV queue counter takes a vision model through a detector interface

A live supervisor dashboard

The pit map with moving trucks, queues and ramp occupancy, shift KPIs, the decision log, the haul plan with a what-if solver, payload compliance, site feeds and the policy comparison, replaying a simulated shift as if it were live

Policy comparison by simulation

A SimPy model of a 12-hour shift with truck and excavator breakdowns runs the same dispatch code to compare fixed assignment, dynamic dispatch, and dynamic dispatch with fuel scheduling and ramp control, with 95 percent confidence intervals and an ablation of each mechanism

How it works

  1. Model the haul roads

    The pit is a directed graph of excavators, dumps, the ROM stockpile, junctions, the fuel bay and single-lane ramps with passing bays. Each road carries its length, a grade from node elevations and loaded and empty travel times from a grade-speed table capped by posted limits, and every route follows the fastest path for a loaded or an empty truck.

  2. Plan the haul flows

    An upper-stage linear program on SciPy's HiGHS solver maximises tonnes per hour, with a penalty for falling short of the stockpile's minimum feed, then a second stage keeps that output and minimises the trucks the plan needs. It plans to 92 percent of each excavator's dig rate, so a face can catch up with its plan, and it is solved again whenever an excavator or a truck breaks down or returns to work.

  3. Dispatch at decision points

    Each time a truck finishes dumping, the dispatcher first checks whether it should refuel, then assigns it to an excavator. Once loaded, the truck goes to the planned dump route furthest behind its share, and under ramp control it books every single-lane climb on that route as it sets off, so empty trucks coming down wait at a passing bay or the crest.

  4. Replay the shift live

    A FastAPI service simulates one shift at start-up and replays it as if it were live, at 20 simulated seconds per real second. REST endpoints serve the plan, what-if plans, decisions, KPIs, payload and site-feed reports and the policy comparison, and a WebSocket sends the React dashboard a live frame every half second, with polling as a fallback while it reconnects.

Engineering insights

The engine has two stages: an upper stage plans the flows, and a lower stage assigns each truck against that plan and records why. The simulator and the live view run the same dispatch code.

Stack by layer

Frontend
  • React
  • TypeScript
  • Vite
  • React Router
  • TanStack Query
  • ts-pattern
  • CSS Modules
  • SVG
Backend
  • Python
  • FastAPI
  • Uvicorn
  • WebSockets
  • Pydantic
Data
  • NetworkX
  • NumPy
AI
  • SciPy
  • HiGHS
  • SimPy
Infrastructure
  • uv
  • Docker
  • Docker Compose
  • pytest
  • Hypothesis
  • Vitest
  • Playwright
  • Ruff
  • mypy
  • Biome
  1. Assign by minutes behind plan

    Each empty truck goes to the face furthest behind plan in minutes of planned digging, counting trucks already sent, accruing the gap across re-plans and capping it at 30 minutes, net of travel and half the predicted queue. Trucks that decide at the same instant, as at shift start or after a breakdown, are matched jointly with the Hungarian method, so the first cannot take the nearest needy face and strand the next on a long empty haul

  2. Policies compared on common random numbers

    Every random source draws from a stream keyed by seed, replication, source and entity, so all policies meet the same breakdowns, load times and payloads. On ten paired 12-hour shifts of the synthetic demo pit with 24 trucks, dynamic dispatch moved 211 t/h more than fixed loops (95 percent interval 148 to 275) and cut excavator idle by 1.3 points, while queue minutes per truck rose by 10 per shift. The tests recompute every published interval from the stored runs

  3. Ramp priority starts when the truck climbs

    A loaded truck books every climb on its route as it sets off, each window chained from the one before, so it holds at the face, where it stands still anyway, instead of stopping part way up the grade. In the ablation on the same synthetic shifts, ramp control removed 25.1 of 25.2 loaded stops part way up a climb per shift, with no clear change in tonnes per hour

  4. Two layers keep single-lane ramps safe

    Bookings clear opposing windows by 0.25 minutes and keep same-direction trucks 0.3 minutes apart, and an entry gate refuses any truck that would meet opposing traffic, whatever the bookings say. A property test over 300 random booking sequences and the recorded ramp occupancy of every simulated policy find no opposing overlap

  5. The coal band stays linear

    A calorific-value or ash limit bounds a tonnage-weighted average, so each bound becomes one linear row: over the coal routes, flow times the quality's margin to the limit must sum to at least zero. When one seam alone cannot meet the band, the plan sends no coal and reports the stockpile shortfall instead of failing, and the dashboard shows the blend actually delivered

  6. Empty trucks may return to another face

    Loaded and empty flows are separate variables tied by conservation, so the plan can send an empty truck to the nearer face instead of back to its own; in one test case, crossing needs 3.0 trucks for 1,200 t/h where returning would need 4.8. A second stage then minimises the trucks the plan needs, so spare trucks become visible

Design system

Pit daylight is a light operations interface for shift supervisors and mine planners in bright site offices. The pit map leads, numbers follow, and the reason for every decision is one click away.

Colour palette

  • Sand#f6f3eePage background behind white panels and the map ground
  • Ink#1f2933Text, headings, the road network outline and site glyphs
  • Muted grey#6b7280Secondary text such as labels, units and table headers, on white panels only
  • Haul orange#c2410cTrucks, primary actions, the selected item and ramp segments held by a climbing truck
  • Flow teal#0f766ePlanned flow on the map, on-plan state, loading excavators and passed checks
  • Warning amber#b45309Behind plan, idle excavators, queues, waiting trucks, single-lane ramps, roads on watch and loads over 110 percent
  • Danger red#b91c1cBreakdowns, congested roads, loads over 120 percent and failed policy checks
  • Colour

    Warm sand surfaces sit under white panels and ink text. Haul orange marks trucks, primary actions and the selected item, flow teal marks planned flow and on-plan state, and amber and red are kept for things that need a response: queues, roads on watch, overloads, congestion and breakdowns

  • Typography

    IBM Plex Sans for interface text, headings and map labels, and IBM Plex Mono with tabular figures for every number and identifier, both bundled through @fontsource with no font CDN

  • Components

    In-house React components over CSS custom properties and CSS modules: a layered SVG pit map with flow and congestion overlays, KPI tiles with sparklines, status pills, a truck card that quotes its last dispatch reason, a decision log with a candidate table, dot-and-whisker confidence-interval charts and a payload histogram with 100, 110 and 120 percent reference lines

  • Accessibility

    Status is carried by shape and label as well as colour, so a waiting truck becomes an amber square and a broken-down one a red square. Text contrast meets WCAG AA and is tested in code, map trucks are keyboard operable, motion respects reduced-motion settings and every page works from 390 px phones to 1440 px desktops without sideways scrolling

Where this fits

Open-pit mines and quarries that run haul fleets can start from the same engine: a plan that respects quality limits, assignments that explain themselves and single-lane rules enforced in code. Explore our business systems, analytics dashboards and AI solutions, or talk about your haul operation.

talk about your haul operation

Let’s connect the dots

Let's put these ideas to work.

Share a process, product, or problem you want to improve. We will work through the possibilities together.

Discuss your project