Skip to contents

A lightweight discrete-event simulation of one loading circuit, useful for (a) validating the analytic finite_source_queue() model and (b) exploring non-exponential time distributions (lognormal), which real haul cycles follow more closely.

Usage

simulate_shift(
  n_trucks,
  n_shovels,
  cycle_min,
  load_min,
  payload_t = 100,
  shift_hours = 12,
  dist = c("exp", "lnorm"),
  cv = 0.35,
  seed = NULL
)

Arguments

n_trucks

Number of trucks assigned to the circuit (N >= 1).

n_shovels

Number of identical loading units (c >= 1).

cycle_min

Mean truck back-cycle time in minutes (haul + dump + return + spot), excluding loading and queueing.

load_min

Mean loading (service) time in minutes.

payload_t

Truck payload in tonnes (used for production KPIs). Default 100.

shift_hours

Length of the simulated shift, in hours. Default 12.

dist

"exp" (matches the analytic model) or "lnorm" for lognormal cycle and load times.

cv

Coefficient of variation for dist = "lnorm". Default 0.35.

seed

Optional integer seed for reproducibility.

Value

A list of class haul_sim with:

cycles

data.frame of every completed haul cycle: truck_id, arrive_min, load_start_min, depart_min, queue_min, load_min.

kpis

One-row data.frame of simulated KPIs (production t/h, mean queue, shovel utilisation, loads).

Examples

sim <- simulate_shift(n_trucks = 7, n_shovels = 2, cycle_min = 18,
                      load_min = 3, payload_t = 90, shift_hours = 12,
                      seed = 42)
sim$kpis
#>   loads prod_tph mean_queue_min p90_queue_min shovel_util mean_load_min
#> 1   215   1612.5      0.2944462     0.8826217   0.4914739      3.261061