System Dynamics element.
Shadow 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:
- Your stock-and-flow diagram is rather complex and consists of several logically dedicated parts — subdiagrams, each one containing a number of tightly 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 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 to the closest elements and thus improve the diagram appearance (see Figure 2).
- 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 icon of agent class. To get compact icon, variables should be placed all together somewhere aside. But moving variables aside the stock and flow 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 Figure 3 below:
AnyLogic supports two alternative ways of creating shadows.
To 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 Shadow appeared. Here you should choose the variable, the shadow of which you want to create. To select the variable, double-click it in the list.
- Finally, you will see a shadow of the original variable appeared on the diagram, right in the place where you dragged the Shadow element.
To create a shadow of the particular variable at once
- Right-click (macOS: Ctrl + click) the variable and choose Create 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.
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.
How can we improve this article?