AnyLogic 9
Expand
Font size

Levels

AnyLogic allows for creating multi-level models: for example, multi-storey buildings in pedestrian simulation. Switch between different levels in design time and use the space markup elements to organize and define the modeled environment on each level separately.

Each model utilizes at least one level, which is created automatically and is named level. At any given time only one level can be active, that is, allowing for adding elements to it.

Most of the time, a single level is enough for a model. The levels are designed to simplify the creation of complex models that represent multi-tiered business centers, shopping malls, warehouses, and elaborate production lines. That being said, avoid using multiple levels without the real necessity.

All elements: shapes, controls, charts, 3D objects, and 3D animation tools (3D windowCameraLight) in the model belong to a certain level. The only exceptions are the Scale element and the view area.

Every level has an absolute Z-coordinate. The elements situated on the level will have a relative Z value which is calculated from the level’s absolute Z-coordinate. If the element is a part of a group (presentation shapes) or network (paths, nodes, and so on), the Z value is calculated for the whole group or network.

To create a level

  1. Open the tab of the needed agent by clicking its name in the models view.
  2. On the tab header’s right, click the Levels menu button.
  3. Click  Create a new level.
  4. Name your new level.
  5. Press Enter.

After this, a new level will be added to the model.

Alternatively, you can create a new level from any element (say, a shape or chart) in the graphical editor.

  1. Click the needed element in the graphical editor to open its properties.
  2. Locate the Level property (usually in the Position and size section).
  3. Click the value of this property.
  4. In the menu that appears, click  Create a new level.
  5. Name your new level.
  6. Press Enter.
When you create a level from a shape’s properties, this shape is placed on the new level immediately.

To switch between levels

  1. Open the tab of the needed agent by clicking its name in the models view.
  2. On the tab header’s right, click the Levels menu button.
  3. Click the name of the level you want to edit.

To modify the level’s properties

  1. Open the elements view.
  2. Expand the Presentation group.

  3. Click the needed level.

The properties of the selected level will appear in the properties view. You can also expand the underlying contents of each level to select individual elements present on this level.

To delete the level

  1. Open the elements view.
  2. Expand the Presentation group.
  3. Click the needed level.
  4. Press Delete.

Visibility of levels

At design time

You can change the visibility of the level’s elements in design time. To do that:

  1. Open the tab of the needed agent by clicking its name in the models view.
  2. On the tab header’s right, click the Levels menu button.

The levels menu displays a list of all levels in your model. The currently active level is highlighted in light blue.

Hover the mouse pointer over the currently inactive level’s name and click one of the icons to modify its visibility:

  •  Show — The content of the level will be always fully displayed in design time in addition to the currently selected level.
  •  Dim — If the level is not active in design time at the moment, its contents will be greyed out.
  •  Hide — If the level is not active in design time at the moment, its contents will be completely hidden from view.

At runtime

A level (including all the elements that belong to it) can be either visible or invisible during the model run. This behavior is set by the Visible parameter of the level’s properties.

To modify the visibility of the level programmatically during the runtime, use the setVisible() function of the level.

Properties

General

Name — The name of the level. The name is used to identify and access the level from code and blocks.

When inactive — Sets the visibility of the level during the design time.

 Show — The content of the level will be always fully displayed in design time in addition to the currently selected level.
 Dim — If the level is not active in design time at the moment, its contents will be greyed out.
 Hide — If the level is not active in design time at the moment, its contents will be completely hidden from view.

Position — Defines the Z-coordinate of this level.

Advanced

Visible in runtime — Specifies whether the level with all its elements is visible on animation at model runtime or not.

How can we improve this article?