Skip to main content

A job shop

The smallest model that tells you something you did not already know. Nothing optional is switched on: no people, no material, no breakdowns, no batching.

Any unfamiliar word is in the glossary.

A job shop: saw, two mills, then inspection

The plant​

A small shop making one bracket. Every bracket is sawn, then milled, then inspected, in that order. There is one saw, two millers, and one inspection bench. Work arrives from the order book at roughly one every seven minutes, unevenly.

How the real world maps to the model​

Two millers are one resource, not two

servers: 2 is a single group with two interchangeable machines. Work queues for the group and goes to whichever frees first. Modelling them as two resources would force a bracket to choose a machine before queueing, which is a different and worse shop.

How the model interacts​

The model​

# yaml-language-server: $schema=https://clockwright.dev/schema/model.json
name: "job shop"
horizon_seconds: 604800.0
warmup_seconds: 86400.0
resources:
- { id: saw, servers: 1 }
- { id: mill, servers: 2 }
- { id: inspect, servers: 1 }
products:
- id: bracket
pieces: 1
steps:
- resource: saw
process_seconds: { kind: constant, value: 120 }
- resource: mill
process_seconds: { kind: erlang, k: 4, mean: 600.0 }
- resource: inspect
process_seconds: { kind: uniform, lo: 60.0, hi: 180.0 }
releases:
- product: bracket
interarrival_seconds: { kind: exponential, mean: 420.0 }

What comes out​

cwright simulate job-shop.yaml --replication 0
{
"released": 1417,
"completed": 1418,
"cycle_seconds_mean": 1253.7,
"resources": {
"saw": {
"utilisation_pct": 28.12, "mean_queue": 0.06,
"mean_wait_seconds": 26.48, "served": 1417,
"state_pct": { "Idle": 71.9, "Processing": 28.1 }
},
"mill": {
"utilisation_pct": 70.47, "mean_queue": 0.88,
"mean_wait_seconds": 374.75, "served": 1418,
"state_pct": { "Idle": 29.5, "Processing": 70.5 }
},
"inspect": {
"utilisation_pct": 28.26, "mean_queue": 0.03,
"mean_wait_seconds": 10.93, "served": 1418,
"state_pct": { "Idle": 71.7, "Processing": 28.3 }
}
}
}

1,418 completed against 1,417 released — the extra one was released during the warm-up and finished after it, which is normal. Every field is explained in Reading the results.

What it says​

cwright validate job-shop.yaml
cwright simulate job-shop.yaml --replication 0
ok: job shop (3 resources, 1 products, 1 releases)
model_hash: 940fb60164b60517
busymean queue
saw28.1%0.06
mill70.5%0.88
inspect28.3%0.03
  • released / completed: 1417 / 1418
  • mean cycle time: 20.9 minutes

Read the queue column, not the busy column​

Total processing is about 13 minutes a bracket. The shop takes 20.9. A third of the time a bracket spends here, it spends waiting — and effectively all of that waiting is in front of the mill.

The mill is at 70% busy, which on a capacity sheet looks like comfortable headroom. It is already holding nine tenths of a job on average. Push it to 85% and the queue roughly doubles again, which is the curve every plant sits on and the reason the busy column misleads.

What to ask next

A third miller, or a faster one, or releasing work more evenly? Those are three different amounts of money. cwright compare will rank them, and will refuse to answer when the evidence is not there rather than guessing.