On this page

# 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()

Source
  - Patch.js, line 28

## Members

### neighbors

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

Source
  - Patch.js, line 84

### neighbors4

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

Source
  - Patch.js, line 97

### turtlesHere

Return an Array of the turtles on this patch.

Source
  - Patch.js, line 113

## Methods

### isOnEdge() → {boolean}

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

Source
  - Patch.js, line 69

Returns:

Type:
  boolean

### breedsHere(breed) → {AgentArray}

Returns an Array of the particular breed on this patch.

Parameters:

Name | Type | Description
--- | --- | ---
`breed` | String |

Source
  - Patch.js, line 131

Returns:

Type:
  AgentArray

Type anything to view search result