Agents
Icon
Additional References
- For a clear understanding of the term Agent, please refer to our Basic Concepts and Entities chapters.
- Refer to the Entities chapter for basic modeling operations.
- For an in-depth examination of the built-in properties and behaviors of Agents, please take a look at the relevant detailed chapters.
- See the Interactions between Entities chapter for interactions with other entities and the relationships and interactions between Agents and the Cell space, Agents and Links.
- Detailed guidelines and rules for customizing Agent behaviors are available in the Processes chapter.
Basic Settings for Agents
Initial Number of Individuals
- Set as a non-negative integer; the default is 1.
- The actual number of individuals in an Agent population may dynamically increase or decrease during simulation due to the creation or destruction dictated by modeling logic. Therefore, the initial number of individuals specified here may not remain constant throughout the simulation.
Individual Properties Settings
Here, you can only set the properties for all individuals within an Agent. To set properties for the Agent's observer, please assign the initial value directly to the data objects belonging to the observer.
Default Settings
-
For each property, the system initializes each individual with the initial values specified in the data object.
-
When using default settings, the Default word will appear next to the detailed settings
...
button, as shown in the figure below. -
If you need to configure all properties collectively, click the detailed settings
...
button to open the configuration window, as shown below. -
Initial Number: Enter a natural number in the input field at the top left corner. This serves the same purpose as setting the initial number on the properties panel.
-
Each row corresponds to a property of all individuals in the Agent. The first two columns on the left display the property's name and data format. In the third column, Default, you can enter expressions that return values in the format specified in the second column to assign initial values to the properties.
-
If there are no modifications, the system assigns values based on the data object. If modifications are made, the initial values in the data object will be updated accordingly.
- You can easily assign initial values to all properties using the Indv.Properties on the Agent's properties panel, saving the hassle of setting them individually. For example, in the Quick Start section, the properties
Shape
,Color
, andCoordinates
for the wolf were configured here. - There are two ways to set unified default initial values for individual properties: either in the data object's properties panel or as described in this section. Both methods are equivalent and synchronized in real-time. However, the former allows for defining the data format of the data object, such as the keys in a Dict, which the latter does not.
- It cannot support complex data types like containers, Dicts, and Lists due to the indirect involvement of data types.
- This method only covers setting initial values for individual properties and does not support adding or deleting properties.
- The default setting results in all individuals in the Agent population having identical properties values, except for
ID
.
Individual Settings
-
Use the same configuration window as mentioned above to individually initialize each property for every individual in the population.
-
First, select the Individual mode in the window's top right corner. This will add a checkbox column on the left and individual columns on the right.
-
The checkbox on the left indicates whether to enable individual settings.
- If unchecked, the default settings are applied, and the corresponding input fields are disabled.
- If selected, individual settings are enabled, allowing for input of assignment expressions. If no expression is entered, the default settings are applied.
-
The syntax for input expressions is identical to that for unified default values.
- When using Individual settings, you can also modify the unified default values in the Default column, as described in the Default Settings section.
- Since you can individually set each initial property value for all individuals in the Agent population, you can achieve an individualized initial state for them. For example, in the figure above, the
Color
,Coordinates
,health
, andstrength
of the two individuals in the Wolf Agent are different.
-
Changing the initial number at the top left will add or delete columns for individuals in the configuration table accordingly.
-
After setting it up, click the Confirm button at the bottom right of the configuration window to close it. The Individuation mode will appear next to the detailed settings
...
button, as shown in the figure below.
Agent Block Settings
Instance Settings
This displays the original definition and includes a link to the definition page. You can specify the number of Agents and initialize their properties, choosing either the default settings or your individuation settings.
Block Definition Settings
- Clicking the canvas blank area in the block editing interface automatically opens the properties panel; no additional settings are required.
- This area also shows the current version number to help you decide if your model's instances need updating.