Operation Simulation
The simulation system runs a calendar-based batch production simulation for an operation. It replays real shift schedules, stochastic variation of step durations, and all phases of the production cycle β from setup to shift-end finishing. The result is a complete picture of equipment utilisation, workforce loading, and time metrics.
Purpose
The simulation answers the following questions:
- What is the actual per-piece time when producing a batch under a real shift schedule?
- What is the equipment and workforce utilisation throughout the run?
- How is time distributed between main cycle steps, preparation, finishing, and idle periods?
- How stable is the process β what is the spread of per-piece time from item to item?
- What is the ratio of paid to calendar time (Kshift)?
How the Simulation Works
Operation Structure
All steps are extracted from the operation on the canvas and classified into three groups:
- Main (group 0) β manufacturing steps repeated for every item in the batch
- Preparing (group 1) β executed once at the start and/or end of each shift
- Setup (group 2) β executed once at the very beginning of the batch
Phase Queue
The engine builds a task queue for the batch:
- Setup β once at the start
- Shift preparation (preparing) β at the start of each working day
- Manufacturing cycle β for each item from 1 to N, respecting the intensity mode
- Shift finishing β at the end of each working day (injected proactively)
Each task in the queue contains a step index, a target duration (randomly sampled), and an item number.
Shift Model
The simulation uses a combined shift model: work only occurs when both schedules β workplace and profession β are simultaneously in the 'work' phase.
Shift schedules are extracted from environment resource bindings on the operation. If no bindings are found, the default 8MH schedule is used (MonβFri, 08:00β17:15 with breaks).
Each schedule describes a day as a sequence of blocks: work, break, rest, before/after allowances, idle.
Simulation Tick
Each tick (50 ms of real time Γ speed multiplier) the engine:
- Checks whether the current moment falls within a combined work block
- If work started on a new calendar day β injects shift preparation tasks
- If the remaining time in the last work block of the day β€ estimated finishing duration β proactively injects shift finishing tasks
- During work β accumulates TMU towards the current task
- During breaks β halts personnel, but machine-only steps continue running
- On task completion β records a timeline entry and samples the next task
Intensity
Steps with a "quantity" intensity mode do not execute for every item:
- "from start, every v" β items 1, v+1, 2v+1, β¦
- "each K" β items v, 2v, 3v, β¦
This models sampling inspection, periodic calibration, and other regular operations.
Controls
Toolbar
- Start date β calendar simulation starting point
- Batch size β number of items (from the operation's `minBatchSize` parameter)
- Play / Pause / Step / Reset β playback controls
- Speed β multiplier from Γ1 to Γ128,000 (17 levels)
- Runs β number of repeats for statistical analysis (1β10,000)
Multi-Run
When multiple runs are started, the system sequentially executes complete batches with different random realisations (same seed, incremental pass counter). After all runs complete, a line chart of average paid time per item is displayed by run number, with markers for minimum, maximum, and average.
Visualisation
Timeline Chart
Each step is rendered as a row with phase-coded colours:
- Setup β red
- Preparing/Finishing β orange
- Manufacturing cycle β blue
- Shift finishing β green
- Breaks β grey
Non-working intervals (nights, weekends) are adaptively compressed for compact display.
Data Columns
Four columns are shown for each step:
| Column | Content |
|---|---|
| P | Normative time (base Γ TMUβms) |
| AVG | Actual average time |
| MED | Actual median time |
| T | Live timer of the currently executing / last completed step |
Item Count Band
Below the step rows β a band with vertical markers at each item completion. Labels are placed at regular intervals.
p / pβ / xΜ Bar Chart
Horizontal bars:
- p β normative per-piece cycle time (blue)
- pβ β per-piece including overhead (purple)
- xΜ/item β actual average paid time per item (orange)
For normative bars, the ratio to the actual value is shown.
Shift Schedule Graphs
Two rows β workplace and profession schedules β synchronised with the upper time axis. Work, break, rest, before/after, and idle blocks are rendered in distinct colours.
Statistics Block
Resources
Two-column layout: Workplace (left) and Profession (right):
| Metric | WP | Prof |
|---|---|---|
| Ξ£M / Ξ£H | Total machine time | Total human time |
| M/item / H/item | Machine per piece | Human per piece |
| Mβ/item / Hβ/item | Normative machine/pcs | Normative human/pcs |
| Util | Equipment utilisation % | Worker utilisation % |
| Idle | Idle time + % | β |
Utilisation colour coding: green > 70%, amber 40β70%, red < 40%.
General Metrics
- Calendar β total elapsed wall-clock time from start to last item completion
- Paid β total paid time (work + break blocks)
- Kshift β shift coefficient = paid / calendar. Shows how effectively calendar time is used
- Overhead β setup + preparing + finishing time, absolute and as percentage of paid time
- Throughput β items per hour based on work time
- Avg Cycle β production work time Γ· items produced
P Distribution Histogram
Appears after β₯ 2 items have been produced. Built from the array of actual per-piece cycle times (cycle-P per item in ms).
Histogram Construction
- Binning β FreedmanβDiaconis rule: bin width = 2 Γ IQR Γ n^(β1/3)
- Range β Q1 β 2.5Β·IQR to Q3 + 2.5Β·IQR, extended to include the expected zone
- Bin count β 5 to 50
Overlays
- Expected zone β shaded band at Β±3Ο from normative P (light blue, dashed boundaries). Variance is aggregated across all cycle steps weighted by intensity execution probability
- Pβ line β normative value (grey dashed)
- ΞΌ line β sample mean (blue dashed)
- Gaussian curve β robust fit: centre = median, Ο = IQR / 1.349 (red curve)
Why Pβ and ΞΌ Appear to the Right of the Peak
The Pβ and ΞΌ (arithmetic mean) lines are often positioned to the right of the visible histogram peak. This is not an error β it is a mathematical property of the distribution.
Main reason β bimodality from intensity. If the operation contains steps with an intensity mode of "every v-th item" (v > 1), the distribution becomes bimodal: most items skip that step and fall into the lower (dominant) peak, while ~1/v items execute it and form an upper peak. The arithmetic mean (ΞΌ) and normative value (Pβ) are weighted sums that lie between the two peaks β i.e. to the right of the dominant one. The red Gaussian curve is centred on the median, which coincides with the dominant peak, so the curve peak appears visually to the left of ΞΌ and Pβ.
Second reason β truncated distribution asymmetry. Each step duration is sampled from a truncated normal distribution (time cannot be negative). When several steps are summed, the left tail is clipped more aggressively than the right, producing a slight rightward skew β mean > median.
This is a classic property of right-skewed and bimodal distributions: mean > median > mode.
Statistical Indicators
Shown below the histogram:
- n β item count
- ΞΌ β mean cycle duration
- Ο β standard deviation
- Cv β coefficient of variation
- skew β skewness (Fisher's coefficient)
- def β items outside spec limits (LSLβ¦USL = Pβ Β± 3Οβ)
- DPMO β defects per million opportunities (def/n Γ 1,000,000)
- Cpk β process capability index: min((USL β ΞΌ)/(3Ο), (ΞΌ β LSL)/(3Ο))
Spec limits (LSL/USL) are computed automatically from the normative model: normative Pβ Β± 3 aggregate Οβ (Οβ accounts for each step's physical variation model weighted by execution probability). The spec zone is shown as a blue band on the histogram.
Stability Score
Displayed in the histogram corner as a score from 0 to 100, composed of 4 components of 25 points each:
| Component | Formula | "Good" threshold | ||||
|---|---|---|---|---|---|---|
| Variation | max(0, 1 β Cv/0.30) Γ 25 | Cv < 12% | ||||
| Symmetry | max(0, 1 β \ | skew\ | /25) Γ 25 | \ | skew\ | < 13 |
| Defects | max(0, 1 β def%/10%) Γ 25 | β€ 5% of sample | ||||
| Modality | 25 if β€ 1 mode, else penalty | β€ 1 mode |
Next to the score, Cpk (process capability index) is displayed. Colour: green Cpk β₯ 1.33, yellow Cpk β₯ 1.0, red Cpk < 1.0.
Cpk β₯ 1.33 means the process fits within spec limits with margin (Six Sigma β 4Ο level). Cpk < 1.0 means the process exceeds spec limits.
Score colour: green β₯ 75, yellow β₯ 40, red < 40.
Mode detection β 3-wide moving average smoothing, count local maxima exceeding 10% of the tallest bin.
Physical Variation Model
Process Stability
Stability determines the width of each step's time distribution:
stab = clamp(0β¦1, 0.6 Γ mechanisation/5 + 0.4 Γ productionType/3)
Higher stability β narrower distribution β times cluster closer to the base value.
Physical Bounds
- sigma = CV Γ base time
- lo = base β k Γ sigma (physical minimum)
- hi = base + k Γ sigma (physical maximum)
The factor k scales with the quality level QL (3.0β5.8). These bounds ensure that sampled values stay within a physically realistic range.
Random Number Generation
The simulation uses a truncated Gaussian distribution via inverse CDF. For reproducibility, an XorShift32 seeded generator is used β given the same experiment seed, results are identical.
What the Simulation Is NOT
- Not an animation β there is no visual playback of operator movements
- Not a queueing model β it does not model inter-operation buffers or resource contention
- Not a physics engine β it does not simulate forces or motion
The simulation is a calendar-based production model: for a given operation, shift schedule, and batch size, it replays item production and collects detailed utilisation and time-variation statistics.
Practical Use
Process Capability Assessment
Run bulk samples and observe the distribution. If the spread is too wide for your tolerance, increase mechanisation or confirm that the production type reflects actual conditions.
Rejection Limit Validation
Compare the sampled distribution against the rejection limits (rjl_min, rjl_max). The fraction of samples falling outside these limits should approximate the DPMO metric.
Sensitivity Analysis
Change mechanisation or production type and re-sample. Compare the distributions to see how each parameter affects timing predictability.
Connection to Quality Metrics
The simulation and quality metrics share the same underlying model:
- Both derive from the same stability formula
- QL computed during simulation matches the QL on the result block
- DPMO from simulation matches the analytical DPMO
This ensures consistency: the statistical metrics shown on the result block accurately predict what the simulation would produce if you sampled enough times.