|
Modeler's Corner
Demystifying Triggering
Andrew Burns
GoldSim Technology Group
aburns@goldsim.com
One of GoldSim’s most powerful tools is triggering, but very few
modelers use anything more than the most basic OnEvent
or OnTrue triggers. In this article I’ll describe
and demonstrate some of GoldSim’s advanced triggering features.
All of the examples described in the model can be downloaded from the
GRC as model #76.
Using the Semicolon in On Event
Triggers
A little-known triggering feature is the semicolon in an On Event type
trigger. A semicolon can be
placed between links to Event-type outputs to indicate that more than one
event must occur before the trigger will fire.
For example:

indicates that Random_Event_A,
Random_Event_B and Random_Event_C
must occur before this element’s trigger will fire. If we were to look at the Cumulative
Emitted output of the three Random_Event
elements and the triggered element we would see the following:

In this realization of the simulation we see that Random_Event_B
occurs first, followed by Random_Event_A. Random_Event_C
is the last to occur, and since the Triggered_Event
element’s trigger is now satisfied, it also emits an event at the
same time.
Precedence Conditions and the
Required Condition Field
Whenever an On Event, On True, On False or On Changed trigger occurs,
GoldSim checks two additional fields, both of which are accessed using
the More button in the
triggering dialog:

A Precedence Condition tells GoldSim that any triggering events must
be queued until that condition is met.
For example, here are Triggering dialogs for two different
Triggered Event elements:


Both elements are initially triggered at 50d. They reference two different condition-type
outputs (one true from 25 d onwards and the other true starting at
75d). If we plot the cumulative
emitted outputs of both elements we would see the following:

Since the Precedence Condition for the first element is already
satisfied at 50d, the event is immediately emitted. The second element waits until its
Precedence Condition is satisfied at 75d before emitting an event.
The Required Condition field is the last item to be checked prior to
the event being emitted. Again,
let’s look at triggering dialogs for two different Triggered Event
elements:


Both elements are initially triggered at 50d. The Required Condition field
references two different condition-type outputs (one true from 75 d
onwards and the other true starting at 25d). If we plot the cumulative emitted
outputs of both elements we would see the following:

Since True_at_25d is true, the event that checks that condition is
emitted. However, True_at_75d is
false at 50d, and as a result the element with that required condition
never emits an event.
Precedence and Required Conditions can be combined in the same
triggering dialog. Again, here are
the Triggering dialogs for two Triggered Event elements:


Both elements are initially triggered at 50d. The first element references
True_at_75d as its Precedence Condition and True_at_25d as its Required Condtion. The
second uses True_at_25d as its Precedence Condition and True_at_75d as
its Required Condtion. If we plot the cumulative emitted
outputs of both elements we would see the following:

The element that has a Precedence Condition of True_at_25d immediately
checks its Required Condition (True_at_75d), which is false. As a result, that Triggered Event does
not emit an event over the course of the simulation. The event with a Precedence Condition
of True_at_75d waits until 75d to check its Required Condition
(True_at_25d). Since this is true,
the Triggered Event emits an event at 75d.
All of these features are described in depth in the GoldSim
User’s Guide and in the Online Help (under Specifying Triggering
Events, Specifying a Precedence Condition for a Trigger and Specifying a
Required Condtion for a Trigger).
Suggestions?
Do you have any suggestions for future Modeler's Corner articles? If
so, we'd love to hear from you. Please contact us at support@goldsim.com.
|