Skip to main content

Simulation

Not a statistician?

New to simulation? Start with the plain-English getting started guide first — it explains the key concepts in business terms.

Running a simulation means testing your process many times with slightly different random values — like running the same day at your business 100 times to see how it usually goes and what can go wrong.

Pocketstats uses a discrete-event simulation (DES) engine written in Rust to simulate how work items flow through your process model.

Core concepts

  • Discrete-event simulation — the engine advances a simulation clock from event to event (an arrival, a task start, a task completion) rather than stepping through time in fixed increments. This makes it fast even for long time horizons.
  • Work item — a single unit (customer, order, ticket, etc.) that enters at a Start node and travels through the process until it exits at an End node or the simulation time limit is reached.
  • Service time — how long a task takes to process one work item. You set the distribution for each Task node.
  • Simulation clock — the engine's internal time counter, starting at zero. All timing (arrivals, service, waits) is measured against this clock.
  • Test runs (reps) — independent simulation runs using the same configuration but different random seeds. Running multiple test runs smooths out randomness so that output metrics reflect the stable behavior of your process, not a lucky or unlucky single run.

Running a simulation

  1. Open a scenario in the canvas editor — the canvas loads with your process model.
  2. Click Run in the header — the simulation configuration panel opens.
  3. Choose simulation parameters:
    • Mode: simulate until a certain number of units complete (units) or until a time limit is reached (time).
    • Value: the target unit count or time limit.
    • Time unit: min, hr, day, etc.
    • Test runs: how many times to simulate your process (more runs = more reliable results).
  4. Click Run — the simulation starts and a progress indicator appears. When it finishes, the results panel opens showing output metrics for your process.
tip

You can also open the simulation panel for any node by selecting it and pressing I, or by clicking the sim icon on the node.

Distributions

Set the service time distribution for each Task node, and the arrival distribution for the Start node, in the simulation panel (select the node, then press I or click the sim icon).

DistributionParametersExample use
constantvalueFixed processing time (e.g. always 5 min)
normalmean, stdNormally distributed service time
exponentialrateMemoryless arrivals (classic queuing)
uniformlow, highAny value equally likely in a range
poissonrateCount-based arrival process
lognormalmean, sigmaRight-skewed service times
gammashape, scaleFlexible positive-value distribution
weibullscale, shapeWear-out or reliability modeling
triangularlow, mode, highThree-point estimate

Output metrics

After each run, Pocketstats reports:

MetricDescription
Units completedTotal work items that reached an End node
ThroughputUnits completed per time unit
Avg cycle timeMean time from arrival to completion
Avg queue depthMean number of items waiting at each Queue node
Avg resource utilizationFraction of time each resource was in use
note

When you run multiple reps, the reported metrics are averaged across all reps. This gives you a stable estimate of steady-state performance.

note

Individual rep results are also available in the results panel. Expanding a metric shows the per-rep breakdown so you can inspect variance across runs.

Resources

You can model shared constraints — a person, machine, or license that can only be used by one task at a time (or a limited number) — using resources.

You can add resources in Manage Resources (M), then assign them to Task nodes via the node's resource panel. A task will block until the required resource is available.

tip

Press M to open the Manage Resources dialog from anywhere on the canvas.

See Resources for details.

Troubleshooting

Simulation runs indefinitely or times out If your process has a cycle (a loop back to an earlier node) without a termination condition, work items may circulate forever. Add an End node reachable from every path, or use a time mode to cap the run length.

Queue depth grows unbounded When arrivals are faster than your process can handle, queues grow without limit. Reduce the arrival rate, add capacity (more resource units or parallel task paths), or switch to units mode to cap how many items enter.

Results show zero units completed Check that at least one path from your Start node leads to an End node. If every path ends at a Queue or Task node with no outbound connection, no items will complete.

Next steps

After reviewing your initial results, try adjusting service time distributions to match real data, increasing resource unit counts to reduce utilization bottlenecks, or duplicating the scenario to compare two process designs side by side. See Resources for capacity modeling and Connections for probability-weighted routing between paths.