Specifying Triggering Events

The top part of the Triggering dialog (which is the only portion visible when you first define a trigger) is where you define the triggering events (the discrete occurrences) that you want the element to respond to:

The More button provides access to advanced triggering options: specifying precedence conditions and required conditions.

By default, when you first create an element that can be triggered, no triggers will exist, and therefore the element will never be triggered.

Note: There is one exception to this rule. The Deactivation trigger for conditional Containers has a default defined trigger.

To define a trigger for the element, you simply press the Add button to add a row to the list of triggering events:

By default, the Type of event added will be will be On Event. If you click on the small button in the Type column, a drop-list will be presented allowing you to edit the event type:

There are eight types of events that can be added:

On Event: The Trigger Definition must be a discrete event or discrete change signal A discrete signal that contains information regarding the response to an event. from another element. The element is triggered whenever the signal is received.

On Changed: The Trigger Definition can be any continuous output (it cannot be an expression or a discrete signal A special category of output that emits information discretely, rather than continuously.). The element is triggered whenever the value of Trigger Definition changes.

On True: The Trigger Definition can be any condition output or conditional expression An expression which evaluates to (produces) a Condition (rather than a Value).. The element is triggered whenever the Trigger Definition becomes True.

On False: The Trigger Definition can be any condition output or conditional expression. The element is triggered whenever the Trigger Definition becomes False.

At Stock Test: The Trigger Definition must be a conditional expression of the form “A>B”, “A>= B”, “A<B”, “A<=B”, or “A=B” where A is the primary output For an element with multiple outputs, the output that has the same name as the element. of a Reservoir A stock element that integrates and conserves flows of materials., a Pool A stock element that integrates and conserves flows of materials. A Pool is a more powerful version of a Reservoir (it has additional features to more easily accommodate multiple inflows and outflows). or a Fund (from the Financial Module). The element is triggered whenever the Trigger Definition becomes True. As discussed below, this triggering event interrupts the clock and adds an unscheduled update.

Warning: The item A cannot be a Reservoir defined as an array A collection of variables that share common output attributes and can be manipulated in GoldSim elements or input expressions., or a scalar An output consisting of a single value or condition. item of a Reservoir defined as an array. The element itself which is being compared must be scalar.

At Date: The Trigger Definition must be a date or date and time, enclosed in quotations. (Alternatively, the date can also be expressed as the amount of time since 30 December 1899). The element is triggered whenever the simulated date reaches the specified date. As discussed below, this triggering event interrupts the clock and adds an unscheduled update.

At ETime: The Trigger Definition must be an elapsed time. The element is triggered whenever the simulated elapsed time reaches the specified elapsed time. As discussed below, this triggering event interrupts the clock and adds an unscheduled update.

Auto Trigger: An Auto Trigger requires no user-defined Trigger Definition and its behavior is defined by its context (i.e., the type of element). Auto Triggers can react to the activation or deactivation of their parent Container An element that acts like a "box" or a "folder" into which other elements can be placed. It can be used to create hierarchical models.. In some special cases (e.g., specialized Reliability elements), they can also be used to respond to other types of actions impacting a parent Container (e.g., preventive maintenance). Depending on the type of element, this option may not always be available.

Note: At Stock Test, At Date and At ETime triggers interrupt the clock and insert an unscheduled update when they occur (whereas On True, On False and On Changed triggers do not create an unscheduled update). To understand the implications of this, consider an example in which your scheduled updates were every 10 days. There are two different ways you could try to trigger an event when the value of Reservoir A became greater than the value B. You could create an At Stock Test trigger of A > B, or you could create an On True trigger of A > B. If we assume that A > B actually became true at 15 days, these two triggers would behave very differently. The At Stock Test trigger would catch this point exactly, and insert an unscheduled update at 15 days. In the absence of any other unscheduled updates Timesteps that are inserted automatically by GoldSim during a simulation and are not directly specified by the user prior to running the model., however, the On True trigger would not be evaluated and implemented until 20 days. Similarly, if you wished to trigger an event at a specific elapsed time (e.g., 17 days), you could try to do so in two different ways. You could trigger the event using an At ETime trigger of 17 days, or you could create an On True trigger with ETime >=17days. Again, these two triggers would behave very differently. The At ETime trigger would catch this point exactly, and insert an unscheduled update at 17 days. In the absence of any other unscheduled updates, however, the On True trigger would not be evaluated and implemented until 20 days.
Warning: Care must be taken if you choose to disable insertion of unscheduled updates while using At Stock Test, At Date or At ETime triggers. These triggers are designed to interrupt the clock and insert a new update, and may not trigger at all if you disable unscheduled updates.

You can add as many triggering events as desired (with different event types). The element is triggered when any one of the events occurs.

The following details should be noted regarding triggering:

The example model Triggers.gsm in the General Examples/Events folder of your GoldSim directory (accessed by selecting File | Open Example... from the main menu) contains examples of the various types of triggers.