cad.simcad.maps
Class ToroidalCellMapNoDiag

java.lang.Object
  |
  +--cad.simcad.maps.CellMap
        |
        +--cad.simcad.maps.ToroidalCellMap
              |
              +--cad.simcad.maps.ToroidalCellMapNoDiag
All Implemented Interfaces:
AbstractMap, PathFindable, java.io.Serializable

public class ToroidalCellMapNoDiag
extends ToroidalCellMap

Version:
1.0
Author:
Charles-Philip Bentley
See Also:
Serialized Form

Field Summary
 
Fields inherited from class cad.simcad.maps.ToroidalCellMap
_hh, _hw
 
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
ToroidalCellMapNoDiag(java.lang.Integer w, java.lang.Integer h, int res, FillerServer fs, StatServer ss)
          Creates new ClassicCellMap
ToroidalCellMapNoDiag(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 POST : An array of Cell.
 java.lang.String toString()
           
 
Methods inherited from class cad.simcad.maps.ToroidalCellMap
getAdjacentUnits, getAdjacentUnits, getMapObjects, getMapObjectsFromRef, getMapUnit, getMapUnitFromRef, isThereRoom, xdec, xincr, ydec, yincr
 
Methods inherited from class cad.simcad.maps.CellMap
addAbstractMapListener, addPathPlaceEventListener, clearAll, fastFindShortestPath, fillMap, findShortestPath, findShortestPath, firePathComputation, firePathPlaceChange, flushAllObjects, generateBlankMap, getAbstractMapListener, getAdjacent, getAllMapUnits, getCell, getCostToReach, getDefaultFiller, getFillerServer, getFillerTypes, getMapHeight, getMapResolution, getMapUnit, getMapWidth, getMoveStat, getName, getObject, getObjects, getPathPlaceEventListeners, getResolution, getStatServer, getSteepRatio, getSteepRatio, getXFactor, getYFactor, getZFactor, populateMap, removeAbstractMapListener, removeAllListeners, removePathPlaceEventListener, resetAllCells, resetAllCellsValue, resetAllUnits, setHeuristicFactor, setName, setObject, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToroidalCellMapNoDiag

public ToroidalCellMapNoDiag(int w,
                             int h,
                             int res,
                             FillerServer fs,
                             StatServer ss)
Creates new RoundCellMap


ToroidalCellMapNoDiag

public ToroidalCellMapNoDiag(java.lang.Integer w,
                             java.lang.Integer h,
                             int res,
                             FillerServer fs,
                             StatServer ss)
Creates new ClassicCellMap

Method Detail

areAdjacent

public boolean areAdjacent(MapUnit mu1,
                           MapUnit mu2)
Overrides:
areAdjacent in class ToroidalCellMap

getAdjacent

public CellGroup[] getAdjacent(CellGroup g)
Returns every possible CellGroups adjacent to the CellGroup given in argument It depends of the resolution

Overrides:
getAdjacent in class ToroidalCellMap

computeHeuristic

public double computeHeuristic(PathPlace origin,
                               PathPlace dest)
calculates the heuristic for the Cell C The heuristic depends on the Map. On a

Specified by:
computeHeuristic in interface AbstractMap
Overrides:
computeHeuristic in class ToroidalCellMap
Parameters:
origin - The PathPlace origin from which we want to compute the heuristic
dest - The PathPlace origin from which we want to compute the heuristic
Returns:
a double value

computeHeuristic

public double computeHeuristic(PathPlace origin,
                               PathPlace dest,
                               double factor)
calculates the heuristic for the Cell C The heuristic depends on the Map. On a

Specified by:
computeHeuristic in interface AbstractMap
Overrides:
computeHeuristic in class ToroidalCellMap
Parameters:
origin - The PathPlace origin from which we want to compute the heuristic
dest - The PathPlace origin from which we want to compute the heuristic
factor - 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
Returns:
a double value

getAdjacent

public Cell[] getAdjacent(Cell c)
Description copied from class: ToroidalCellMap
Returns

Overrides:
getAdjacent in class ToroidalCellMap

getAdjacent

public MapUnit[] getAdjacent(MapUnit c)
Returns POST : An array of Cell. Can contains null

Overrides:
getAdjacent in class ToroidalCellMap

toString

public java.lang.String toString()
Overrides:
toString in class ToroidalCellMap

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be