Patch

Class Patch instances represent a square on the Patches grid. They hold variables that are in the patches the turtles live on. The set of all patches is the world on which the turtles live and the model runs.

You do not use new Patch, rather Class Model creates the patches for you, using the World data passed to the Model.

You never do this:

Constructor

new Patch()

Members

neighbors

Return an array of this patch's 8 Moore neighbors.

neighbors4

Return an array of this patch's 4 Von Neumann neighbors (north, south, east, west).

turtlesHere

Return an Array of the turtles on this patch.

Methods

isOnEdge() → {boolean}

Return whether or not this patch is on the edge of the atches.

Returns:
Type: 
boolean

breedsHere(breed) → {AgentArray}

Returns an Array of the particular breed on this patch.

Parameters:
NameTypeDescription
breedString
Returns:
Type: 
AgentArray