Technician Dispatch: model notes
Technician Dispatch Example
This example demonstrates the Active Resource (Worker) pattern in odin-des.
Scenario
The model simulates a shop with several machines and a single technician.
- Machines operate normally until a random breakdown occurs.
- When a machine breaks, it enters a wait list and requests a technician.
- The technician (the Worker) is dispatched to the machine.
- The repair process follows the
sim.worker_cyclelifecycle:- Transit: The technician travels from their current location to the machine.
- Execution: The technician performs the repair.
- Release: The technician is now free to be dispatched to another machine.
- Return: The technician returns to their home base.
Key Patterns Used
sim.Worker: The technician is modeled as an active resource rather than a passive capacity.sim.worker_cycle: This helper encapsulates the travel \(\rightarrow\) work \(\rightarrow\) release sequence, removing the need to manually manage multipleeng.advancecalls and state transitions in the puck's tick.- Dispatcher Pattern: A simple dispatcher bridges the gap between the waiting machines and the worker.
CLI
./technician_dispatch [options]
Add --json to emit the uniform envelope (metadata, execution_stats,
metrics, details) instead of the default text output.
| Flag | Type | Default | Description |
|---|---|---|---|
--json |
bool | false |
Emit uniform JSON envelope instead of text. |
Example runs:
./technician_dispatch # default text run
./technician_dispatch --json # uniform envelope
How to Run
odin run examples/technician_dispatch/technician_dispatch.odin