Logic Tree Elements
In addition to the And, Or and Not logical elements, GoldSim has an additional element that provides an alternative way to create complex logic: the Logic Tree element A logical element that can be used to create complex logic trees using gate and child nodes and outputs a condition..
The properties dialog for a Logic Tree element looks like this:
Logic Tree elements have a single output, which is a scalar An output consisting of a single value or condition. condition (True or False). The logical framework of Logic Trees is constructed using a number of gate nodes (e.g., AND-gates, OR-gates). The various gate nodes have child nodes (sub-nodes) and the gates are evaluated based on the value (True or False) of their child nodes and the type of gate (e.g., in order for an AND-gate to be True, all of the child nodes defining the gate must be True).
Gates can be nested with no limit (hence, creating a “tree”), which allows very complex logic to be represented. The various nodes in the tree are evaluated hierarchically to determine if the output of the element is True or False.
To illustrate this, consider the simple logic tree shown below:
In this example, there are two gate nodes: the top AND-gate (the top of a logic tree is always an AND-gate) and an OR-gate (that is one of the children of the AND-gate). “Water_Rising” is a child of the AND-gate and “Pump_Failed” and “Water_Level > 10 m” re children of the OR-gate. “Water_Rising” and “Pump_Failed” are element outputs defined as conditions and “Water_Level > 10 m” is a conditional expression An expression which evaluates to (produces) a Condition (rather than a Value)..
Hence, the logic expressed here is:
If
(Water_Rising)
AND (Water_Level>10m OR Pump_Failed)
Then
The Logic Tree is
True
Else
The Logic Tree
is False
The
An example model which uses the Logic Tree element, as well as other logical elements (Logical.gsm) can be found in the General Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).