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.
Elements within conditional Containers behave as follows:
• Before a Container is activated for the first time in a realization, any elements it contains behave as follows:
o 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.
o Static Stochastic elements (Stochastics whose inputs are constant, and have no triggers) are sampled at the beginning of each realization.
o 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.
o Outputs with clearly defined non-zero initial values (i.e., Integrators, Reservoirs, Material and Information Delays, Previous Value elements, Status elements, and Milestones) take on their initial values at the beginning of each realization.
o 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:
o Most outputs that are continuous (as opposed to discrete) continue to transmit their last active value.
o The exception to this are outputs that represent material flows (e.g., the output of a Material Delay; the Overflow Rate from a Reservoir). 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,
o 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 whenever material flows from active elements (outside the conditional Container) to inactive elements are discarded.
o 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.
o Any timed events or events triggered using an On Event trigger are ignored and discarded.
o Any discrete or continuous signals or flows that are in transit within Delays are “frozen” (the conveyor is stopped).
o 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.
Learn more about:
Behavior or Recording Time Series Elements in Conditional Containers