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.
All elements: shapes, controls, charts, 3D objects, and 3D animation tools (3D window, Camera, Light) 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
- Open the tab of the needed agent by clicking its name in the models view.
- On the tab header’s right, click the button.
- Click Create a new level.
- Name your new level.
- 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.
- Click the needed element in the graphical editor to open its properties.
- Locate the Level property (usually in the Position and size section).
- Click the value of this property.
- In the menu that appears, click Create a new level.
- Name your new level.
- Press Enter.
To switch between levels
- Open the tab of the needed agent by clicking its name in the models view.
- On the tab header’s right, click the button.
- Click the name of the level you want to edit.
To modify the level’s properties
- Open the elements view.
- Expand the Presentation group.
- 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
- Open the elements view.
- Expand the Presentation group.
- Click the needed level.
- Press Delete.
You can change the visibility of the level’s elements in design time. To do that:
- Open the tab of the needed agent by clicking its name in the models view.
- On the tab header’s right, click the 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.
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.
- 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?
-