Diagram Simulation
What you can simulate
Simulation currently works on these diagram types:
- Flowchart
- UML Activity Diagram
- SysML Activity Diagram
The mechanics are the same across all three: nodes perform work, connectors/flows move the token forward, and (optionally) variables collect time/cost/resource stats.
Turn on the simulation tools
Open the sidebars you’ll use most:
- View → Window → Sidebars → Simulation
- View → Window → Sidebars → Simulation Variables
You’ll now have two panels:
- Simulation (controls, run/step tree, results grid)
- Simulation Variables (define time/cost/probability/resource inputs)
Simulation Sidebar
The Simulation sidebar provides a toolbar with these buttons (left → right):
- Simulate – Run the full stochastic simulation (many runs).
- Play – Animate a single run from the current state.
- Play all – Animate a single run to the end.
- Break – Pause a running/playing simulation.
- Next Step – Advance one step in the animated run.
- Stop – Stop the current run/simulation.
- Settings – Open Simulation Settings (see below).
- Export Results – Export the results grid shown in the sidebar (the export mirrors what you see in the grid).
Other parts:
- Tree view – Shows the simulation and its steps, in execution order.
- Results grid – Shows the results produced by your variables across runs/steps.
Tip: “Export Results” exports exactly this grid.
During a visualized run: the currently performing step is highlighted with a distinctive style (red by default). It moves in the order steps are executed.
Simulation Settings
Open via Settings button on the Simulation toolbar.
The dialog provides the following settings:
- Runs – how many Monte Carlo runs to execute (default 1000).
- Max steps per run – per-run safety cap to avoid infinite loops (default 1000).
- Step animation duration – per-step animation time in ms (default 500 ms) for Play/Play all.
Tips
- Increase Runs to stabilize statistics.
- If you have loops, ensure Max steps per run is high enough, but not so high that true infinite loops waste time.
- Set Step animation duration lower (e.g., 100–200 ms) to speed up Play.
The Simulation Variables sidebar (your inputs)
Think of Simulation Variables as the “knobs” that make your diagram behave like the real world. Here you tell the simulator how long steps take, how much they cost, how likely a branch is, and which resources (people, machines, teams) are involved. You attach these inputs to diagram elements (tasks/actions) and to connectors (for probabilities). When a run executes, the simulator walks your diagram and accumulates the values you’ve defined—once per step for Fixed variables, and every time the step transitions for Variable variables.
How it works
- Actions/Tasks: assign processing time and cost using Fixed/Variable variables.
- Fixed = one-off setup (counted only on the first transition of that step).
- Variable = per-item/per-pass effort (counted on every transition).
- Connectors: set Probability to control which branch is taken (considered only on flow connectors).
- Resources: pick any project element to track usage alongside time/cost (e.g., Machine A, Team Blue).
- Results: per run, contributions are summed; across many runs, you get distributions/averages in the results grid.
Tip: Start simple—add VariableProcessingTime and Probability first. Then layer in costs and resources.
Toolbar buttons
- Add (Variable) – Add a general variable (its values contribute every time it’s applied).
- Add Fixed (Variable) – Add a variable that contributes only on the first transition of a step (see “Fixed vs Variable” below).
- Add Resource (Variable) – Choose any project model element as a resource to track (opens a project tree picker).
- Delete – Remove the selected variable from the grid.
- Variables (drop-down) – Choose a variable set. There’s a built-in General set with predefined variables:
- FixedCost : Fixed
- VariableCost : Variable
- FixedProcessingTime : Fixed
- VariableProcessingTime : Variable
- Resource : (resource slot)
- Probability : probability a flow connector is taken (only considered on connectors)
- Add Set – Save your current variables as a named, global variable set (available across projects).
- Delete Set – Remove the selected variable set from the drop-down.
Fixed vs Variable variables
- Fixed variables add to statistics only on the first transition of a step.
- Variable variables add to statistics on each transition.
Use Fixed for one-off costs/setup times; use Variable for per-item costs or per-transition times.
Variable value types (syntax)
You can assign values in three ways:
- Constant
- Example: 123
- (any plain number)
- Normal (Gaussian) sample
- Unbounded: normal(mu, sigma)
- Example: normal(5, 1.2)
- Truncated: normal(mu, sigma, lower, upper)
- Example: normal(10, 2, 5, 20)
- Uniform range - (lower, upper)
- Example: (2, 7)
Note: Set Probability only on flow connectors. It represents the chance that branch is taken.
Quick start: simulate a simple flow
Let’s create a tiny process and simulate it end-to-end.
1) Draw the diagram
Use a Flowchart (or UML Activity Diagram if you prefer) and create:
- Start → Task A → Decision
- Decision has two outgoing connectors:
- to Task B (e.g., “OK path”)
- to Task C (e.g., “Rework path”)
- Both Task B and Task C → End
2) Open Simulation Variables and load the General set
From the drop-down, choose General so you have baseline variables ready.
3) Assign processing times & costs
Select Task A, then in Simulation Variables:
- FixedProcessingTime = 1 (one-off setup time)
- VariableProcessingTime = normal(4, 1) (per-transition time; average 4, σ 1)
- FixedCost = 50 (setup cost once)
- VariableCost = (5, 12) (uniform per-transition cost)
Repeat for Task B and Task C with values that make sense for your scenario, e.g.:
- Task B: VariableProcessingTime = normal(2, 0.5), VariableCost = 8
- Task C: VariableProcessingTime = normal(6, 1.5), VariableCost = (10, 20)
(Adjust freely; these are examples.)
4) Set branch probabilities (on connectors)
Select the connector from Decision → Task B and set Probability = 0.8.
Select the connector from Decision → Task C and set Probability = 0.2.
Only connectors use Probability. Probabilities on outgoing flows from a decision should generally sum to 1.0 (100%).
5) (Optional) Assign a resource
Click Add Resource (Variable) and pick a model element (e.g., a Worker or Machine in your project tree).
Attach that Resource variable to the tasks that consume it. This lets you track/compare resource usage.
6) Save your variable configuration (optional but handy)
Click Add Set, give it a name (e.g., “Assembly-v1”). It will be available across projects.
7) Configure the simulation
Open Settings:
- Runs: start with 1000
- Max steps per run: keep default 1000 (raise if your model uses many loops)
- Step animation duration: 500 ms (reduce for quicker Play)
8) Watch one run (for understanding)
In Simulation sidebar:
- Click Play to animate a single run.
- Use Next Step to advance step-by-step, or Play all to complete the run.
- The currently executing step glows/red-highlights as it runs.
9) Run the full simulation
Click Simulate to execute the configured number of Runs.
When finished:
- The tree lists simulated steps/sequences.
- The results grid shows the numbers accumulated by your variables (e.g., processing times, costs), per the Fixed/Variable rules.
10) Export your results
Click Export Results to export the grid exactly as shown (handy for spreadsheets, reporting, or audits).
New Comment