Controlling When a SubModel is to be Run

By default, a SubModel is treated like any other element in GoldSim and is updated (i.e., run) whenever required to do so by the parent model (e.g., when inputs change).

In some cases, however, you may want to manually control when a SubModel is updated.  You can do so by checking the Update (run) SubModel only when triggered checkbox.  When you do this, access is provided to a standard trigger dialog:

You can explicitly control when a SubModel is run by defining one or more triggers (e.g., “On True: X > Y”).

By default, when this box is checked, no triggers are defined.   This means that the SubModel will never run.

   Note: You can tell if a trigger has been defined from the appearance of the Trigger… button.  If a trigger is defined, the rectangle next to the lightning bolt is bright green; otherwise it is dark green.  And like all Trigger… buttons, it displays a tool-tip.  If there is no trigger defined, the tool-tip will display “Never updates SubModel”.

If you wish the SubModel to run when its parent Container activates, set the update trigger to Auto Trigger.  Note that if a SubModel is set to Auto Trigger and it is not within a conditional Container, it activates when the Model (root) Container activates (i.e., at the start of the realization).

Prior to a SubModel being triggered, its outputs are all zero.  The outputs are updated when the SubModel is triggered, and outputs remain constant until the SubModel is triggered again.

Related Topics…

Learn more about: