Branch Gates
A branch gate functions as a "switch" statement in an event analysis flowchart. It checks the incoming value against a number of cases and passes different outputs depending on which case or branch evaluates to true. It has one incoming path and multiple outgoing paths.
A branch gate may be used in place of a series of conditional blocks. For example, the flowchart on the left, as shown next, has three conditional blocks that evaluate an automobile's mileage. If the first condition is met, the value is passed to the "true" (T) path to "Result Storage A," but if the condition is not met, the value is passed down the "false" (F) path to the next conditional block for evaluation. The evaluation continues until all paths end. The flowchart on the right shows an example of how a branch gate may be used to replace the conditional blocks.
The following picture shows the Block Properties window of the branch gate in the example. The branch gate checks the incoming value against each branch sequentially, based on the order shown in the Block Properties window (you can move a block up or down in priority by clicking the arrows that appear next to the block's name). The branch gate then passes only the output of the first branch that evaluates to true.
The Condition and Condition Value fields allow you to configure the conditional expression of the block. The drop-down list in the Condition field includes the following relational signs:
= |
equal to |
<= |
less than or equal to |
< |
less than |
>= |
greater than or equal to |
> |
greater than |
FP<=% |
a special case where the conditional block itself draws a random number uniformly distributed from 0 to 100, and then evaluates whether the number is less than or equal to the condition value. |
<> |
not equal to |
For the condition value, as well as the outgoing values, the expression can include:
-
Numerical values
-
Predefined mathematical functions (exp, log, sin, etc.)
-
References to any ReliaSoft Workbooks
You can enter the equation manually, or you can use the function selector or the equation editor to assist you. Resources, ReliaSoft Workbooks and internal functions are automatically color-coded while you are editing the equation, to improve readability.
When the cursor is positioned on a resource, ReliaSoft Workbook or predefined or internal function, a preview area appears and displays a summary of the item. If a function requires parameters, the preview area indicates (in all capital letters) which parameter you are currently entering; additionally, for nested functions, the preview area displays the current function and the parent function. If the item is a resource, you can click the View icon in the preview area to open that resource's properties window.
You can enclose a resource name in single quotes to reference it by name. When the item using the expression is transferred to another project or database, any resource referenced by name will not be transferred along with it. If the destination project contains a resource with the same name as the one referenced by name, that resource will be used during simulation of the transferred item. For example, if you export a diagram that contains a block using the expression 'Model1'(1000) from Project1 to Project2, Model1 will not be transferred along with that diagram. If Project2 already contains a model called Model1, that model will be used in simulating the transferred diagram. You can also reference ReliaSoft Workbooks by name.
IMPORTANT: All values and results are assumed to be in terms of the default unit specified for the database. See Using Time Units in Event Analysis Flowcharts for details on how this may affect your analysis.
Advanced Configurations
- If you wish to have the branch gate pass an output when a branch evaluates to false, select the Continue Execution on FALSE Branch check box and enter a value in the Condition is FALSE field that appears, as shown next. In this example, if the incoming value is 6,000, then the branch gate will pass two outputs: the value 10 to the "Result Storage A" branch, and the value 2 to the "Result Storage B" branch.
- By default, the branch gate passes only the output of the first branch that evaluates to true. You can configure the branch gate to pass the output of every branch that evaluates to true by selecting the Check Condition on Every Branch check box. With this setting, the order of the branches does not affect the output of the branch gate.
In the following example, if the incoming value is 50, then the branch gate will pass two outputs: the value 1 to the "Result Storage A" branch and the value 2 to the "Result Storage B" branch.