Each agent type may have specific icon associated with it. Icon is drawn in the graphical editor of the agent type using the same shapes (ovals, rectangles, images, etc.) you use to draw agent’s presentation. Therefore, you should explicitly specify shapes that are components of the agent’s icon.
To add a shape to an icon
- In the graphical editor, select the shape by clicking.
- In Properties, select the Icon checkbox.
Icon also contains agent’s interface elements (ports and public system dynamics variables). Thus you are enabled to connect these elements to interface elements of another agents.
In fact, all flowchart blocks available in AnyLogic libraries have icons drawn with standard AnyLogic presentation shapes. For example, here you can see how the icon of the Delay block looks like:
The icon of the Delay block is composed of a blue rectangle, and white circle and two lines depicting the clock. Two ports are placed on the icon’s border.
Let us describe the most popular use cases of icons.
There are a few example models in AnyLogic examples set, featuring custom flowchart blocks with custom icons, you can study the following one for example.
Demo model: Emergency Department Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).In this model, there are two agent types acting as custom flowchart blocks: USoundProcess and XRayProcess.
When you create a custom flowchart block as described here, the icon is created automatically, and all the block’s ports are placed on the icon’s border.
You can study the whole process of creating a custom flowchart block, including the icon creation, in the following video:
If your agent type contains interface elements and is intended to be connected to other agents via these elements, you need to create an icon for this agent type so that you can place the agent’s interface elements on the icon’s border.
Demo model: Population Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).In the given demo model the stock-and-flow diagram is decomposed into two separate agent types (HousingSector and PopulationSector) that interact via public dynamic variables. The custom icons are created for these agent types to distinguish them on the Main diagram and to place the interface variables as you require on the icon’s border.
When you create a population of agents, the default icon is displayed on the diagram. In most cases, it works for users and they keep the default icons. But sometimes, users may want to create an individual design of their models, including different icons for agent populations of different types.
-
How can we improve this article?
-