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.
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.
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.
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.
The list of existing elements is available from the menu that appears when you click on the 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.
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
- Click next to the property to which you want to add the reference. You will automatically switch to the drawing mode.
- 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.
- 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:
- Click in the property field where you want to specify the markup element.
- In the property edit menu that appears, select Create new. You will automatically switch to the drawing mode.
- Draw the element on the canvas. When you are finished drawing, the name of the element appears in the property field.
- 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
-
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. - In the menu that appears, specify the name, animation, and parameters (if necessary).
- Click the Create agent button to complete the process.
- If you change your mind and don’t want to create a new element, click Cancel button in the agent creation menu to exit.
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.
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
- In the Actions section of the properties click Add action.
- Select the action you need from the side menu.
-
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.
To remove the action field that you no longer need, click next to the field.
-
How can we improve this article?
-