Container Terminal Berth Queue

2D companion of the Harbor-X terminal: ships arrive at random, cranes unload them, and the waiting time explodes as the berths approach full use.

Switch to 3D

Presets

Playback

Apparatus

Model checks

The science

What is modelled

Ships arrive at random at a terminal with c berths. A ship stays at a berth for the time its containers need to be moved by the cranes it gets, and it waits at anchor in first-come order when all berths are busy. With random arrivals and random berth times this is the M/M/c queue, whose waiting time follows from the Erlang C formula.

Equations

  • Berth rate μ = k m / N ships per hour (k cranes of m moves per hour, N moves per call), load a = λ / μ, utilisation ρ = a / c.
  • Chance of waiting C(c, a) = (ac/c!) (1/(1 − ρ)) / (Σk<c ak/k! + (ac/c!) / (1 − ρ)).
  • Mean wait Wq = C / (c μ − λ), Little's law L = λ W, tail P(wait > t) = C e−(cμ − λ) t.

Checks run in the page

  • Erlang C from the factorial sum against the Erlang B recursion.
  • A 150,000-ship simulation against the mean wait and chance of waiting.
  • Ships in port counted at random instants against Little's law.
  • Berth utilisation measured against the formula.

Honest simplifications

Exponential arrival gaps and berth times (real berth times vary less, so real queues are somewhat shorter), identical ships, no tides, weather or pilots, no yard or gate limits, and no crane breakdowns. Ships are served first come, first served at any berth. This is a queueing model of the quay, not a terminal planning tool.

What to try
  • Press Congested (one berth) and then add a second berth: the wait falls far more than the berth count suggests.
  • Press Overloaded: utilisation is above 100 percent and the anchorage grows without limit.
  • Press Extra cranes and compare the extra crane cost with an extra berth.
Mean wait against ship arrivals
Mean wait against number of berths
Utilisation and chance of waiting
Waiting-time tail: formula against simulation
Made with 🤖 ChatGPT