A list-like class (list of lists) that provides for retrieving patches by [x,y] index. This is not a full coordinate system, and should be subclassed by a full coordinate system.
WARNING: This is an internal class. Its use in user code is not recommended or supported, and its signature can change in future updates without warning. Use one of the suggested functions above instead, if applicable.
Initialization Parameters
dim — tuple(int, int), required
The dimensions of the grid.
props — list[function(Patch)], optional
A list of functions to be assigned to patches as properties by subclasses. For example
PatchesRect
definesPatch.up
,Patch.down
,Patch.left
, andPatch.right
, whereasPatchesPolar
definesPatch.inward
,Patch.outward
,Patch.clockwise
, andPatch.counterclockwise
.Default value: []
funcs — list[function(Agent)], optional
A list of functions to be assigned to non-patch agents by subclasses. For example, subclasses should define
Agent.orientTo()
andAgent.distanceFrom()
based on the coordinate system.Default value: []
Static Properties
geometry — str
The name of the patch geometry, to be set by subclasses.
Initial value: ''
Notes and Examples