AnyLogic
Expand
Font size

Icon

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

  1. In the graphical editor, select the shape by clicking.
  2. 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.

The shapes making up an icon do not belong to any level.

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.

The icon size is set automatically to fit all icon shapes. You can see that all icon elements are outlined with a frame named Icon.

Use cases

Let us describe the most popular use cases of icons.

Custom flowchart block icon

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:

Icon for an agent with interface elements

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.

Custom icon for an agent population

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.

It is very rare use case. Usually the highly proficient users who create their own libraries with custom components may require this if they plan to distribute their libraries among other users. We don’t have any examples with custom agent population icons since we don’t find this case practically useful.
How can we improve this article?