Referencing the Contents of a Localized Container

By design, the contents of a localized 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. can only be "seen" (and hence referenced) by other elements inside the Container. Therefore, if you place an element called A in a localized Container called C, and then try to reference A in an expression (outside of C), GoldSim will report that it cannot find A (since it is "hidden" within the scope The portion of a model from which an element's output can be referenced. You cannot reference an element in a different scope unless that output is specifically exposed. of the localized Container).

Eventually, however, you will need to pull information out of the localized Container to another portion of your model. GoldSim allows you to propagate outputs outside of localized Containers by exposing them as if they were outputs of the localized Container itself. Once an output is exposed, it is referenced in expressions by using the form ContainerID.OutputID.

For example, suppose you had a localized Container L, containing an Expression element A function element that produces a single output by calculating user-specified mathematical expressions. named X. Assume further that another element named X existed outside of Container L. If you exposed X on the localized Container L, then you could access it from other Containers (outside of L) by referencing it as L.X in expressions.

There would be no confusion with the other element named X in the model, since you would be referring to the X within Container L as L.X (not simply X). Within Container L, however, you could access X in the normal way, by entering X directly in expressions.