Constructor
new Model(worldOptionsopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
worldOptions | Object | | <optional> | World.defaultOptions() | Can be Object of min/max X,Y,Z values or an instance of World or GeoWorld |
Methods
linkBreeds(breedNames)
Create breeds (sub-arrays) of Links. Used in Roads model:
- this.linkBreeds('trips')
Name | Type | Description |
---|---|---|
breedNames | string | A string of space separated breeds names |
patchBreeds(breedNames)
Create breeds (sub-arrays) of Patches. Used in the Exit model:
- this.patchBreeds('exits inside wall')
Name | Type | Description |
---|---|---|
breedNames | string | A string of space separated breeds names |
reset(worldOptionsopt)
Resets model to initial state w/ new Patches, Turtles, Links. The worldOptions will default to initial values but can be changed by modeler. Setup() often called after reset() to re-initialize the model.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
worldOptions | Object | | <optional> | this.world | World object |
(abstract) setup()
An abstract method for initializing the model
Note: can be used with reset(). This will reinitialize the Patches, Turtles, Links for re-running the model
- reset()
- setup()
(async, abstract) startup()
An abstract method to perform one-time initialization.
(abstract) step()
An abstract method to run the model one step.
tick()
Increment the tick cound. Not needed if autoTick true, the default
turtleBreeds(breedNames)
Create breeds (sub-arrays) of Turtles. Used in Wallfollower model:
- this.turtleBreeds('lefty righty')
Name | Type | Description |
---|---|---|
breedNames | string | A string of space separated breeds names |