Constructor
new Patches(model, AgentClass, name)
Creates an instance of Patches.
Name | Type | Description |
---|---|---|
model | Model | An instance of class Model |
AgentClass | Patch | The Patch class managed by Patches |
name | string | Name of the AgentSet |
- Source
Methods
neighbors(patch) → {AgentList}
Return the 8 patch "Moore" neighbors of the given patch. Will be less than 8 on the edge of the patches
Name | Type | Description |
---|---|---|
patch | Patch | a Patch instance |
- Source
An array of the neighboring patches
- Type:
- AgentList
neighbors4(patch) → {AgentList}
Return the 4 patch "Van Neumann" neighbors of the given patch. Will be less than 4 on the edge of the patches
Name | Type | Description |
---|---|---|
patch | Patch | a Patch instance |
- Source
An array of the neighboring patches
- Type:
- AgentList
importDataSet(dataSet, property, useNearestopt)
Assign a DataSet's values into the patches as the given property name
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataSet | DataSet | An instance of DataSet | ||
property | string | A Patch property name | ||
useNearest | boolean | <optional> | false | Resample to nearest dataset value? |
- Source
exportDataSet(property, Typeopt) → {DataSet}
Extract a property from each Patch as a DataSet
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
property | string | The patch numeric property to extract | ||
Type | Type | <optional> | Array | The DataSet array's type |
- Source
A DataSet of the patche's values
- Type:
- DataSet
patchIndex(x, y) → {number}
Return index into Patches given valid x,y integers
Name | Type | Description |
---|---|---|
x | number | Integer X value |
y | number | Integer Y value |
- Source
Integer index into Patches array
- Type:
- number