AnyLogic
Expand
Font size

Shadow

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).

    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 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:

    Figure 3. Shadows of housesExport and householdsToHouseRatio are added to the stock and flow diagram while the original variables are exposed to the object’s icon

Creating a shadow

AnyLogic supports two alternative ways of creating shadows.

To create a shadow in the required place of the diagram

  1. Drag the  Shadow element from the   System Dynamics palette onto the graphical diagram of agent.
  2. 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.

  3. 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

  1. Right-click (macOS: Ctrl + click) the variable and choose  Create Shadow from the popup menu.

  2. 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:

  1. Names of shadows are put into < > symbols.

  2. The label (Shadow) follows the variable type name in the top line of the Properties view:

  3. 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?