Package repast.simphony.space.grid
Class DefaultGrid<T>
java.lang.Object
repast.simphony.space.projection.DefaultProjection<T>
repast.simphony.space.grid.AbstractGrid<T,Map<GridPoint,Object>>
repast.simphony.space.grid.DefaultGrid<T>
- All Implemented Interfaces:
Grid<T>
,Projection<T>
- Direct Known Subclasses:
ContextGrid
A default implementation of a grid backed by a map.
- Author:
- Jerry Vos
-
Nested Class Summary
Nested classes/interfaces inherited from class repast.simphony.space.grid.AbstractGrid
AbstractGrid.PointHolder
-
Field Summary
Fields inherited from class repast.simphony.space.grid.AbstractGrid
accessor, adder, agentLocationMap, dimensions, locationStorage, ok, size, translator
Fields inherited from class repast.simphony.space.projection.DefaultProjection
listeners, name
-
Constructor Summary
ConstructorDescriptionDefaultGrid
(String name, int... size) DefaultGrid
(String name, int[] size, int[] origin) DefaultGrid
(String name, GridAdder<T> adder, GridPointTranslator translator, CellAccessor<T, Map<GridPoint, Object>> accessor, int... size) DefaultGrid
(String name, GridAdder<T> adder, GridPointTranslator translator, CellAccessor<T, Map<GridPoint, Object>> accessor, int[] size, int[] origin) -
Method Summary
Methods inherited from class repast.simphony.space.grid.AbstractGrid
evaluate, getAdder, getCellAccessor, getDimensions, getDistance, getDistanceSq, getGridPointTranslator, getLocation, getObjectAt, getObjects, getObjectsAt, getRandomObjectAt, getTransformedLocation, isPeriodic, moveByDisplacement, moveByVector, moveTo, remove, removeAll, setAdder, setGridPointTranslator, size
Methods inherited from class repast.simphony.space.projection.DefaultProjection
addProjectionListener, fireProjectionEvent, getName, getProjectionListeners, removeProjectionListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface repast.simphony.space.projection.Projection
addProjectionListener, getName, getProjectionListeners, removeProjectionListener
-
Constructor Details
-
DefaultGrid
public DefaultGrid(String name, GridAdder<T> adder, GridPointTranslator translator, CellAccessor<T, Map<GridPoint, Object>> accessor, int... size) - Parameters:
name
- the name of the gridadder
- the adder for adding new objects to the gridtranslator
-accessor
- the accessor used for accessing grid cellssize
- the size of the space
-
DefaultGrid
public DefaultGrid(String name, GridAdder<T> adder, GridPointTranslator translator, CellAccessor<T, Map<GridPoint, Object>> accessor, int[] size, int[] origin) - Parameters:
name
- the name of the gridadder
- the adder for adding new objects to the gridtranslator
-accessor
- the accessor used for accessing grid cellssize
- the size of the spaceorigin
- the origin of the space
-
DefaultGrid
- Parameters:
name
- the name of the gridsize
- the size of the space
-
DefaultGrid
- Parameters:
name
- the name of the gridsize
- the size of the spaceorigin
- the origin of the space
-
-
Method Details
-
createLocationStorage
- Specified by:
createLocationStorage
in classAbstractGrid<T,
Map<GridPoint, Object>>
-