uchicago.src.sim.space
Class Multi2DGrid
java.lang.Object
|
+--uchicago.src.sim.space.AbsMulti2DGrid
|
+--uchicago.src.sim.space.Multi2DGrid
- All Implemented Interfaces:
- Discrete2DSpace, IMulti2DGrid
- public class Multi2DGrid
- extends AbsMulti2DGrid
A grid object that can hold more than one object in its cells.
The cells themselves store their occupants without
any order. Use an OrderedMulti2DGrid if you need
the cell occupants to be stored in an ordered fashion. The object
return by getObjectAt is a BagCell.
|
Constructor Summary |
Multi2DGrid(int xSize,
int ySize,
boolean sparse)
Creates this Multi2DGrid with the specified dimensions. |
|
Method Summary |
void |
putObjectAt(int x,
int y,
Object object)
Puts the specified Object into the cell at the specified coordinates. |
| Methods inherited from class uchicago.src.sim.space.AbsMulti2DGrid |
clear, getCellAt, getCellSizeAt, getIteratorAt, getMatrix, getMooreNeighbors, getMooreNeighbors, getMooreNeighborsLoc, getMooreNeighborsLoc, getObjectAt, getObjectsAt, getSize, getSizeX, getSizeY, getValueAt, getVNNeighbors, getVNNeighbors, getVNNeighborsLoc, getVNNeighborsLoc, putValueAt, rangeCheck, removeObjectAt, trim |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Multi2DGrid
public Multi2DGrid(int xSize,
int ySize,
boolean sparse)
- Creates this Multi2DGrid with the specified dimensions.
sparse specifies whether the grid will be sparsely filled or not.
- Parameters:
xSize - the number of columns in the gridySize - the number of rows in the gridsparse - whether the grid will be sparsely populated or not
putObjectAt
public void putObjectAt(int x,
int y,
Object object)
- Puts the specified Object into the cell at the specified coordinates.
The contents of the cell are unordered.
- Specified by:
putObjectAt in interface Discrete2DSpace- Specified by:
putObjectAt in class AbsMulti2DGrid
- Parameters:
x - the x coordinatey - the y coordinateobject - the object to put
Bug reports and feature requests to RePast