add_fork_join
Split one entity into N parallel branches and synchronize after all complete. Models parallel workflows that require all branches to finish.
Instructions
Add a ForkJoin (AND-split / AND-join) pattern for parallel branch execution.
A single entity enters, splits into N independent parallel branches, and continues ONLY when ALL N branches have completed. Essential for modeling parallel workflows that must synchronize before proceeding.
Difference from other patterns:
Assembly: waits for N entities from different arrival streams
Duplicate: copies diverge and NEVER rejoin
ForkJoin: one entity → N parallel branches → all must complete before output
Args: name: Instance name (e.g., "PatientExam", "QualityGate") n_branches: Number of parallel branches (default: 2) branch_times: Mean processing time per branch in time_unit. Length must equal n_branches. Default: [30.0] * n_branches branch_distribution: Distribution for branches — "exp", "norm", "unif", "det" time_unit: Time unit for branch_times — "s", "min", "h"
Returns branch IDs in the response for manual wiring when branches are processed by external patterns (retrial queues, machines, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| n_branches | No | ||
| branch_times | No | ||
| branch_distribution | No | exp | |
| time_unit | No | s |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |