spawn_agent¶
Synopsis¶
Description¶
This action creates a new agent. If, and only if, the agent belongs to a place called "Household", the new agent will inherit that value.
This action returns the ID of the newly spawned agent. However, it is also valid to call the action without assigning a value to it.
The new agent will enter the simulation's start state on the following (not the current!) step.
Examples¶
An agent with ID 1 can be selected to spawn an agent with the following
statement:
The meta agent can spawn agents. Below is an example of this being done in the startup block.
variables {
shared numeric x
}
startup {
for (x, range(10)) {
# Note that since spawn_agent() sets up the new agent to enter the
# simulation on the next step; the new agents will not enter the
# simulation until step 1.
spawn_agent()
}
}