This simulation demonstrates how to initialize your simulation given the recent changes to the init.json
file. It uses published behaviors and agent templates.
Published creators first run and generate the agents as you've defined them in the globals.json
and init.json
file. Then any custom creators/updaters are run. Since the published creators are defining agents them and then adding them to the state.agents
object, the custom updaters can still modify them using functions (like random number generators, or pulling from a distribution) imported data, and the properties file. Finally, the last two behaviors actually dispatch the create_agent
messages to the engine, and then remove this creator agent.
NOTE that you need to import the published behaviors by locating them in the lower left-hand list and clicking on them.
Published creator behaviors
-
"Create Grids": Grids are for any agent that is distributed evenly across the topology
-
"Create Stacks": Stacks are for any agent that has one or more of it all placed in the same location
-
"Create Scatters": Scatters are for any agent that has one or more copies of it placed at random locations in the bounds
The agent templates are defined in the initialState, and additional information may be contained in the properties.
Custom creators/updaters
- These behaviors will be written by the user if they need to add random values to generated agents, or create specific complex agents
Published final behaviors
-
"Create Agents": This dispatches a "create_agent" message for every agent
-
"Remove Self": This removes the creator
Note that you could also, in some cases, explicitly define an agent in the initialState.