Behavior of Elements in
Conditional Containers
Before discussing how conditional Containers can be activated and deactivated, it is useful to first explain how elements behave when they are within a conditional 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..
Elements within conditional Containers behave as follows:
- Before a Container
is activated for the first time in a realization A single model run within a Monte Carlo simulation. It represents one possible path the system could follow through time., any elements it contains behave as
follows:
- Data elements and Expressions that are static (i.e., have constant inputs or are functions of elements with constant inputs) are computed at the beginning of each realization.
- Static Stochastic elements (Stochastics whose inputs are constant, and have no triggers) are sampled at the beginning of each realization.
- Conditional Containers have no effect on most Time Series elements, which always output their results. Time Series elements that are set to record, however, cannot be placed inside a Conditional Container that can be deactivated.
- Outputs with clearly defined non-zero initial values (i.e., Integrators, Reservoirs, Material and Information Delays, Previous Value elements, Status elements An event element that allows you to monitor the status of something that is changed instantaneously (i.e., is triggered) by events., and Milestones) take on their initial values at the beginning of each realization.
- All other outputs are set to zero.
- Once a Container is activated, all the elements that it contains output their normal (computed) output.
- After a Container
is deactivated, any elements it contains behave as follows:
- Most outputs that are continuous (as opposed to discrete) continue to transmit their last active value.
- The exception to this are outputs that represent material flows (e.g., the output of a Material Delay A delay element that delays flows of materials (e.g., masses, volumes, items).; the Overflow Rate from a Reservoir A stock element that integrates and conserves flows of materials.). These outflows are set to zero.
Note: When a Container is triggered to deactivate, all elements inside the Container are updated before the Container deactivates.
- While a Container
is inactive,
- All incoming material flows (e.g., Rates of Addition to Reservoirs, Flows into Material Delays) or discrete changes of material are ignored and discarded. Warning messages are written to the Run Log Text that is stored with a GoldSim model once it has been run. It contains basic information regarding the simulation, and any warning or error messages that were generated. whenever material flows from active elements (outside the conditional Container) to inactive elements are discarded.
- Any other discrete signals sent to inactive elements are ignored and discarded. Warning messages are written to the Run Log when discrete additions or withdrawals of material flows to inactive elements are discarded.
- Any timed events or events triggered using an On Event trigger are ignored and discarded.
- Any discrete or continuous signals or flows that are in transit within Delays are "frozen" (the conveyor is stopped).
- If an inactive Container is activated at exactly the same time as some child elements are triggered, the triggers to the children are not ignored (they are applied immediately upon activation of the Container).
Warning: On Changed, On True and On False events are triggered whenever the element determines that the argument to the event has changed, become true, or become false, respectively. If the element is in a conditional Container, it does not evaluate these arguments while it is inactive, and therefore some On Changed, On True and On False events that occur while the Container is inactive can be "delayed" until the element activates (rather than ignored). For example, if an On True trigger is defined as "Etime > 15 days", and the element is inactive until 20 days, the event will actually be triggered at 20 days (since, from the element's viewpoint, this is first time that it is able to determine that the condition has become true).
As a simple example of the behavior of an element inside a conditional Container, consider an Integrator with an Initial Value of 10, and a Rate of Change of 5 per day. Assume that the Integrator was within a conditional Container that was initially inactive, was activated at 10 days, and deactivated at 20 days.
In this case, the output of the Integrator would behave as shown below:
The Integrator starts at 10. It remains at 10 until the Integrator activates at 10 days. Between 10 and 20 days, the output increases linearly (to 60), and after 20 days, the output stays constant at 60.
- Activating a Container
- Behavior of Elements in Conditional Containers
- Deactivating a Container
- Enabling and Disabling Conditionality
- Outputs of a Conditional Container
- Using Auto Triggers in Conditional Containers
- Using Conditional Containers to Simulate a Project
- Viewing a Conditional Container in the Browser