Description Usage Arguments Value Examples
Set the task for a single agent, or for a list of agents,
which will be executed for each time step when the simulation is run.
The task function must take the arguments agent and population
and must return agent
1 | set_task(x, task, agent_type = "agent")
|
x |
An agent or a list of agents |
task |
A function to be executed in each time step.
You must pass |
The original agent or agent list 'x', with tasks appended
1 | #Build an example simulation in which each agent moves and then prints its coordinates to the console in each time step
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.