And Elements

and2 And elements perform a logical And operation on a list of conditions. Their output is True if and only if all of their inputs are True. Although this can also be done using an Expression, an And element provides a somewhat more convenient and user-friendly way to do this, particularly if a large number of items are involved. More importantly, the element explicitly illustrates the operation being carried out, increasing the transparency of your model and allowing you to create easy-to-read conditional logic diagrams.

The properties dialog for an And element looks like this:

And elements have a single output, which is always a scalar condition. If all of the input conditions to an And element are True, the output is True; otherwise, the output is False.

You add an input to the element by pressing the Add Input button. A browser tree showing all of the elements in the model will be displayed.

Note that this tree is organized by containment in the same manner as the main browser. To insert a link from this dialog, you select a specific output object (or an element having a primary output), and then press OK. If you press Cancel, GoldSim will insert a new blank (False) item. In either case, the dialog will close and the item will be added to the list of inputs for the element.

The inputs to the And element must all be conditions. Note, however, that the inputs can be conditional expressions (in addition to simply links). You can edit any of the input fields after the input is added (and can insert links using the context menu for the input field).

   Note: An And element with no defined input conditions evaluates to False.

The browser view of an And element shows a single output, and an input for each input condition:

   Note: Element inputs and outputs are only shown in the browser if you choose to Show Element Subitems (accessed via the browser context menu by right-clicking in the browser).

An example model which uses the And 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).

Related Topics…