AnyLogic 9
Expand
Font size

Properties

In AnyLogic 9, the Properties section is docked to the right side of the model editor workspace and displays the properties of the currently selected element. If no elements are selected, the properties of the currently selected agent are displayed.

AnyLogic 9: The Properties viewProperties of the PedSource block

The properties of an element are organized in groups, which you can expand or collapse as you see fit.

When you change the value of a property, that property is highlighted with a vertical blue line.

Sometimes, elements have properties that cannot be left unspecified, otherwise an error will occur when you try to run the model. Such properties are marked by a vertical red line to alert you.

Types of properties

As of now, AnyLogic 9 supports static properties, dynamic properties and code fields (actions). Switching between editing modes for dynamic properties will be implemented in later versions.

Referring to model elements

During model development, you often need to refer to a markup element from the properties of a block. The model editor in AnyLogic 9 supports all familiar options, such as selecting an element from the list of existing elements or selecting the element on canvas, which you can access from the property edit menu.

Property edit menu

The list of existing elements is available from the menu that appears when you click on the property:

AnyLogic 9: The list of existing elementsProperty edit menu opened from Appears at property

To select the element on the canvas, either use the button next to the property, or use the Select on canvas command from the property edit menu.

Creating new elements from properties

Sometimes you need to refer to an element that you haven’t created yet. We have improved the workflow and now you can create a new element directly from the properties.

  • Target lines from the properties of Pedestrian Library blocks
  • Storage tanks, pipes, bulk conveyors belts from the properties of the Fluid Library blocks
  • Nodes from the Agent location properties

To create a new element from properties

  1. Click next to the property to which you want to add the reference. You will automatically switch to the drawing mode.
  2. Draw the element on the canvas. When you are finished drawing, you will switch back to the default mode and the name of the element will appear in the property field.
  3. If you change your mind and don’t want to create a new element, click Cancel in the property field to exit the drawing mode.

Another scenario is as follows:

  1. Click in the property field where you want to specify the markup element.
  2. In the property edit menu that appears, select Create new. You will automatically switch to the drawing mode.
  3. Draw the element on the canvas. When you are finished drawing, the name of the element appears in the property field.
  4. If you change your mind and don’t want to create a new element, click Cancel in the property field to exit the drawing mode.

In the same way, you can create a new agent type, if necessary.

To create a new agent type from the properties

  1. Click next to the property to which you want to reference the new agent type, or
    Click in the property field. In the property edit menu that appears, select Create agent.
  2. In the menu that appears, specify the name, animation, and parameters (if necessary).
  3. Click the Create agent button to complete the process.
  4. If you change your mind and don’t want to create a new element, click Cancel button in the agent creation menu to exit.

Quick navigation to the referenced element

For quick navigation to the element from the properties, you can click next to the property. The focus of the graphical editor will move to the referenced element.

Actions

The properties of elements and blocks can be quite extensive, especially actions, which are extension points where you can customize the behavior of a model element by writing your own code. To minimize clutter, we decided to let you choose which actions you want to see in the properties.

To add an action field

  1. In the Actions section of the properties click Add action.
  2. Select the action you need from the side menu.

    Add action menu

  3. Enter your code in the edit box of the action and continue developing your model.
    When typing the code, press Ctrl + Space (Cmd + Space or Ctrl + Shift + Space on macOS) to use the code completion assistant.

    Action field

To remove the action field that you no longer need, click next to the field.

How can we improve this article?