Agents in Social Science
113
5.2.2 Assigning Conditions with Functions
Actor_idle
04
04a
a.function_perform
EQ
0
Actor_project_calculation
04
04a
a.function_perform
NEQ
0
actor_knowledge_expert
Further complexity can be added to the XML file by associating conditions
with functions. The above two functions branch from the same point, but run
depending on the value of the memory variable ‘function perform’. If the value
is equal to zero, the function ‘idle’ is run, else the ‘project calculation’ runs.
This mechanism can prevent modelers to add conditions in the C functions
by handling them here.
5.2.3 Using Dynamic Arrays and Data Structures
The example also shows data structures defined and used in agent memory.
This allows more complex memory variables to be created, such as to recording
plans or records. The MYBONDS variable allows the actor to record its ties
(from itself, to other actors), in one memory variable. This is defined as a
dynamic array, allowing the number of ties to grow, rather than be a defined
maximum (as when using static arrays).
113
5.2.2 Assigning Conditions with Functions
Further complexity can be added to the XML file by associating conditions
with functions. The above two functions branch from the same point, but run
depending on the value of the memory variable ‘function perform’. If the value
is equal to zero, the function ‘idle’ is run, else the ‘project calculation’ runs.
This mechanism can prevent modelers to add conditions in the C functions
by handling them here.
5.2.3 Using Dynamic Arrays and Data Structures
The example also shows data structures defined and used in agent memory.
This allows more complex memory variables to be created, such as to recording
plans or records. The MYBONDS variable allows the actor to record its ties
(from itself, to other actors), in one memory variable. This is defined as a
dynamic array, allowing the number of ties to grow, rather than be a defined
maximum (as when using static arrays).
