Search Logic for Linking to an Output Present in Multiple Scopes

Although the outputs of an element in 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 be referenced outside of the Container only if the output is exposed on that Container, the inputs to the element can come from any location in the model. That is, a localized Container is analogous to a two-way mirrored glass: you cannot look into the Container, but you can look out of it.

In cases where multiple outputs with the same name exist in a model, however, it is important to clearly identify the search logic used by GoldSim to link to outputs.

Consider the following example. Localized container L2 is contained within localized Container L1. Both L1 and L2 contain an element (with a primary output For an element with multiple outputs, the output that has the same name as the element.) named A1. A third element named A1 also exists outside of L1. Within L2, you create an Expression element A function element that produces a single output by calculating user-specified mathematical expressions. (named B1), and specify its definition as 2*A1. Which of the three A1 elements does GoldSim create a link to?

The schematic above illustrates the search logic GoldSim would use to create the link. It would first look within its own 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. (the local scope of B1). If it finds A1 there, it creates the link. If it does not find A1 in its local scope, it moves one level up in the scope hierarchy (in this case within L1) and looks for it there. If it finds A1 there, it creates the link. If it does not find A1 at that level, it continues to search upward through the various scopes that it has access to until it finds an A1, or exhausts the search (and fails to complete the link).

Warning: In the example shown above, if A1 exists in L2, it is impossible to access the outputs of the other A1 elements in the model from within L2. That is, B1 will always try to link to the "nearest" A1, and there is no way for B1 to reference one of the other A1 elements in the model. Even if you use the Link Cursor A special cursor for creating links invoked by double-clicking on an input or output object in a browser. or the Insert Link dialog to explicitly link to one of these other elements, GoldSim will ignore this and link to the "nearest" A1. It will try to do this even if the output of the nearest A1 is incompatible with input requirements (and one of the other A1 has a compatible output). If you needed to access one of the other elements, you would need to change its name (to something that did not exist inside L2).