Constructor
new Model(worldOptionsopt)
Creates an instance of Model. The worldOptions define the coordinate system for this model The World options sets xMin, xMax, yMin, yMax and when using 3D: zMin, zMax
Fine point: Can also be an instance of World or GeoWorld
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
worldOptions | Object | <optional> | World.defaultOptions() |
Methods
initModel(worldOptionsopt)
Initialize model to initial state w/ new Patches, Turtles, Links. The worldOptions will default to initial values but can be changed by modeler.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
worldOptions | Object | | <optional> | this.world | World object |
reset(callSetupopt)
Reset the model by clearing the turtles, setting ID & ticks to 0 and calling setup()
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callSetup | boolean | <optional> | true |
tick()
Increment the tick cound. Not needed if autoTick true, the default
(async, abstract) startup()
An abstract method to perform one-time initialization. Subclasses provide their versions of this to import data.
(abstract) setup()
An abstract method for initializing the model Subclasses provide their version of this to initialice the model
(abstract) step()
An abstract method to run the model one step.
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 |
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 |
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 |