System Dynamics element.
is a copy of a system dynamics variable (it can be either flow, stock,
or dynamic variable).
Shadows are typically used in the following cases:
stock-and-flow diagram is rather complex and consists of several
logically dedicated parts - subdiagrams, each one containing a number
interrelated variables. There are few variables used in several
subdiagrams, so that links to these variables are drawn across the
whole canvas and thus make the
diagram ugly looking (see the Figure
1 below). You can create shadows for those
variables in one subdiagram while leave original
variables in another subdiagram. In this case you can draw links
closest elements and thus improve the diagram appearance (see the Figure 2).
Figure 1. Ugly links between
variables of two subdiagrams. No shadows are used
Figure 2. Shadows
make diagrams pretty looking
- You create a hierarchical model with subdiagrams
moved to separate agent types and need
to expose variables that are shared by these subdiagrams
to object interfaces. This requires adding these variables to
agent class. To get compact icon, variables should
all together somewhere aside. But moving variables aside the stock and
diagram pulls all the links as well as the variables and thus makes
the diagram appearance worse. However, you can create shadows for these
variables and place them in the stock and flow diagram while move
the original variables aside in the icon area - this will keep your
diagram pretty looking, see the Figure
Figure 3. Shadows
of housesExport and householdsToHouseRatio
are added in the stock and flow diagram while the original
variables exposed to the object's icon
Creating a shadow
AnyLogic supports two alternative ways of creating shadows.
create a shadow in the required place of the diagram
- Drag the Shadow
element from the System
Dynamics palette onto the graphical diagram of agent.
- You will see the dialog box New
appeared. Here you should choose the variable, the shadow of which you
want to create. To select the variable, double-click it in
create a shadow of the particular variable at once
- Finally, you will see a shadow of the original variable appeared
on the diagram, right in the place where you dragged the Shadow element.
- Right-click (Mac OS: Ctrl+click) the variable and
Shadow from the popup menu.
- You will see a shadow of the original variable appeared aside.
Now you can
drag it to the place where you want to place the shadow.
Discerning shadows from original variables
There are several ways to discern shadows from the original variables:
- Names of shadows are put into < > symbols.
- The label (Shadow) follows
the variable type name in the top line of the Properties view:
- By default shadows are displayed with grey icons,
whereas original variables - with blue ones. However, changing the
color of a variable once sets this new color for
either the variable and all its shadows so they are no more
distinguishable by color.