|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--cad.simcad.maps.CellMap
|
+--cad.simcad.maps.ToroidalCellMap
Map where cells at the top and bottom of viewable portion are adjacent Map where cells at the right and left of viewable portion are adjacent Conclusion : It is not an earth like map
| Field Summary | |
protected int |
_hh
Rounded down half height of the map |
protected int |
_hw
Rounded down half width of the map |
| Fields inherited from class cad.simcad.maps.CellMap |
_abstractMapEventListeners, _art, _cell, _cex, _cgex, _fillerServer, _h, _heurFactor, _mapResolution, _name, _objects, _pathPlaceEventListeners, _regions, _statServer, _w |
| Constructor Summary | |
ToroidalCellMap(java.lang.Integer w,
java.lang.Integer h,
int res,
FillerServer fs,
StatServer ss)
Creates new ClassicCellMap |
|
ToroidalCellMap(int w,
int h,
int res,
FillerServer fs,
StatServer ss)
Creates new RoundCellMap |
|
| Method Summary | |
boolean |
areAdjacent(MapUnit mu1,
MapUnit mu2)
|
double |
computeHeuristic(PathPlace origin,
PathPlace dest)
calculates the heuristic for the Cell C The heuristic depends on the Map. |
double |
computeHeuristic(PathPlace origin,
PathPlace dest,
double factor)
calculates the heuristic for the Cell C The heuristic depends on the Map. |
Cell[] |
getAdjacent(Cell c)
Returns |
CellGroup[] |
getAdjacent(CellGroup g)
Returns every possible CellGroups adjacent to the CellGroup given in argument It depends of the resolution |
MapUnit[] |
getAdjacent(MapUnit c)
Returns |
MapUnit[] |
getAdjacentUnits(MapUnit mu)
|
MapUnit[] |
getAdjacentUnits(MapUnit[] mu)
|
java.lang.Object[][] |
getMapObjects(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
Return a window of Objects around the (xcenter,ycenter) point. |
java.lang.Object[][] |
getMapObjectsFromRef(int x,
int y,
int width,
int height)
|
MapUnit[][] |
getMapUnit(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
This method is abstract because you need specific knowledge of the map |
MapUnit[][] |
getMapUnitFromRef(int x,
int y,
int width,
int height)
|
boolean |
isThereRoom(int x,
int y,
int xWidth,
int yHeight)
Return true if there is no object in the range specified by the parameters. false if there is one |
java.lang.String |
toString()
|
int |
xdec(int x)
|
int |
xincr(int x)
|
int |
ydec(int y)
|
int |
yincr(int y)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int _hw
protected int _hh
| Constructor Detail |
public ToroidalCellMap(int w,
int h,
int res,
FillerServer fs,
StatServer ss)
public ToroidalCellMap(java.lang.Integer w,
java.lang.Integer h,
int res,
FillerServer fs,
StatServer ss)
| Method Detail |
public java.lang.String toString()
toString in class CellMap
public boolean areAdjacent(MapUnit mu1,
MapUnit mu2)
areAdjacent in class CellMappublic MapUnit[] getAdjacent(MapUnit c)
public int yincr(int y)
public int xincr(int x)
public int xdec(int x)
public int ydec(int y)
public Cell[] getAdjacent(Cell c)
getAdjacent in class CellMappublic CellGroup[] getAdjacent(CellGroup g)
getAdjacent in class CellMappublic MapUnit[] getAdjacentUnits(MapUnit mu)
getAdjacentUnits in class CellMappublic MapUnit[] getAdjacentUnits(MapUnit[] mu)
getAdjacentUnits in class CellMap
public double computeHeuristic(PathPlace origin,
PathPlace dest)
computeHeuristic in interface AbstractMapcomputeHeuristic in class CellMaporigin - The PathPlace origin from which we want to compute the heuristicdest - The PathPlace origin from which we want to compute the heuristic
public double computeHeuristic(PathPlace origin,
PathPlace dest,
double factor)
computeHeuristic in interface AbstractMapcomputeHeuristic in class CellMaporigin - The PathPlace origin from which we want to compute the heuristicdest - The PathPlace origin from which we want to compute the heuristicfactor - the factor by which we want to multiply the heuristic. Typically, more the factor is high, more we want to give weight to the heuristic
public MapUnit[][] getMapUnit(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
getMapUnit in interface AbstractMapgetMapUnit in class CellMapxcenter - x coordinateycenter - y coordinatehalfWidth - the number of MapUnit we want to include.halfHeight - the number of MapUnit we want to include
public MapUnit[][] getMapUnitFromRef(int x,
int y,
int width,
int height)
public java.lang.Object[][] getMapObjects(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
AbstractMap
getMapObjects in interface AbstractMapgetMapObjects in class CellMapxcenter - x coordinateycenter - y coordinatehalfWidth - the number of Objects we want to include.halfHeight - the number of Objects we want to include
public java.lang.Object[][] getMapObjectsFromRef(int x,
int y,
int width,
int height)
public boolean isThereRoom(int x,
int y,
int xWidth,
int yHeight)
AbstractMap
isThereRoom in interface AbstractMapisThereRoom in class CellMapx - x coordinatey - y coordinatexWidth - length in width of the ObjectyHeight - length in height of the Object
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||