BPMN Mining
VI EN
Log in Sign up free
Docs / Formulas

Monte Carlo simulation

When you need simulation, and how to read P90.

The expected value tells you the average, but it does not tell you how much it varies. Nobody commits to an SLA with an average — half the cases would be late.

How the simulation runs

Each run is one simulated case travelling through the whole process:

  1. At an exclusive gateway: draw a random number, pick the branch according to the declared probabilities.
  2. At a parallel gateway: run every branch, add up the costs, take the max of the simulated branch times.
  3. Landing on a rework branch: go back and run again, exactly as in reality.
  4. Record the total time and total cost of that run.

2.000 runs by default, adjustable on the Units tab of the editor.

How a single simulation run proceeds
join = joins.get(current)
successors = adjacency.get(current, [])

if join and len(successors) > 1:                  # khối song song
    branch_times = []
    for successor in successors:
        branch_time, branch_cost = run_segment(successor, join, budget, seen)
        branch_times.append(branch_time)
        cost_total += branch_cost                 # chi phí: cộng mọi nhánh
    time_total += max(branch_times)               # thời gian: chỉ nhánh chậm nhất
    current = join
else:
    current = choose(current)                     # rẽ nhánh theo xác suất

Reading the results

MetricMeaningUsed for
MeanThe expected value according to the simulationCross-checking against the analytical number
P50 (median)Half the cases finish before this markDescribing “how long it usually takes”
P9090% of cases finish before this markCommitting to an SLA
P9595% of cases finish before this markA tight commitment, a large contract
🧮 Why you should not commit with the mean

A process where 12% of cases are rejected early (15 minutes) and 88% go the whole way (around 420 minutes).

  • Mean: 372 minutes
  • P50: 420 minutes
  • P90: 455 minutes

Committing to “an average of 372 minutes” sounds reasonable, but nearly 90% of cases will exceed that mark — because most cases take the long route, while the few rejected early have pulled the mean down. The right number to commit to is P90.

The distribution chart

The bars in the Simulation tab show the shape of the distribution. Two separated clusters are a sign that the process has an exclusive branch with very different durations — the mean falls between the two clusters and describes no case correctly. In that case you should split the two flows into two separate SLAs.

Repeatability

ℹ
The simulation uses a fixed seed, so rerunning it on the same data always gives the same result. Because of that, when you compare two options, the difference is a real difference between the processes, not the luck of the random number generator.

When to trust the simulation over the analysis

When the process has a parallel block where each branch itself contains a random branch point. In that case E[max] is larger than max E[·], and the simulation reflects reality correctly: one unlucky branch is enough to make the whole block wait. The metric cards at the top of the page display both numbers so you can see the gap for yourself.

Anything unclear or missing?