Rectangular Grid Spatial Model2D
Creates a grid in the 2D plane. The grid is based on the standard user coordinate system, with (x,y) = (0,0) being the upper left most corner point, with the x-axis going from left to right and the y-axis going from the top down
Parameters
The x coordinate of the upper left most corner point
The y coordinate of the upper left most corner point
The width (along the x-axis) of the grid
The height (along the y-axis) of the grid
The number of rows in the grid (0-based)
The number of columns in the grid (0-based)
Constructors
Properties
The line at the bottom of the grid
An iterator over the cells in the grid. The cells are accesses by rows (row, col): (0,0), then (0,1), etc 0th row first,
The cells in the grid as a list. The cells are accesses by rows (row, col): (0,0), then (0,1), etc 0th row first,
The default initial location.
The lower left corner point for the grid
The lower right corner point for the grid
The upper left corner point for the grid
The upper right corner point for the grid
Functions
Returns true if firstLocation is the same as secondLocation within the underlying spatial model. This is not object reference equality, but rather whether the locations within the underlying spatial model can be considered spatially (equivalent) according to the model. This may or may not imply that the distance between the locations is zero. No assumptions about distance are implied by true.
Computes the distance between fromLocation and toLocation based on the spatial model's distance metric
The elements in the cell containing location or an empty list
The elements in the cell containing spatialElement or an empty list.
The row major index is row(number of columns) + col + 1 Labeling starts at 1 and goes by row (across columns). For example for a 3 by 3 grid 4, 5, 6 7, 8, 9
Returns an array with the 1st order Moore neighborhood for the given core cell.
Fills the supplied array with the 1st order Moore neighborhood for the given core cell.
Includes the non-null cells in the neighborhood into a List
The number of elements in the cell containing location
The number of elements in the cell containing spatialElement
Causes the element to be tracked, held, by the spatial model. The user is responsible for maintaining this list