|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the definition of a Map. It is totally abstract It can search itself for a Path.
Method Summary | |
void |
addAbstractMapListener(AbstractMapEventListener listener)
|
void |
addPathPlaceEventListener(PathPlaceEventListener listener)
|
double |
computeHeuristic(PathPlace origin,
PathPlace dest)
Compute the heuristic for the two PathPlace s. |
double |
computeHeuristic(PathPlace origin,
PathPlace dest,
double factor)
Compute the heuristic for the two PathPlaces |
PathPlaceSet |
fastFindShortestPath(PathPlace origin,
PathPlace dest,
PathUser pu)
Find the best Path with a productive algorithm |
PathPlaceSet |
findShortestPath(PathPlace origin,
PathPlace dest,
PathUser pu)
Find the best Path |
PathPlaceSet |
findShortestPath(PathPlace origin,
PathPlace dest,
PathUser pu,
java.util.Properties algoProperties)
Find the best Path |
void |
firePathComputation(PathPlaceSet path)
This method will be used to notice the Map that a path has been computed. |
void |
firePathPlaceChange(PathPlace mp)
This method should be used if you want to notice the Map when a PathPlace has been modified in some way |
java.util.Vector |
getAbstractMapListener()
Returns the vector of AbstractMapListener |
MapUnit[][] |
getAllMapUnits()
Return as a double Array all the MapUnits making the Map at coordinate z=0 |
double |
getCostToReach(PathPlace from,
PathPlace to,
PathUser pu)
This method computes the cost for a PathUser to move from the PathPlace "from" to the PathPlace "to" |
FillerServer |
getFillerServer()
Returns the FillerServer of the Map |
java.lang.Object[][] |
getMapObjects(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
Return a window of Objects around the (xcenter,ycenter) point. |
MapUnit |
getMapUnit(int xfactor,
int yfactor)
Return the MapUnit by the coordinate x and y. |
MapUnit[][] |
getMapUnit(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
Return a window of MapUnit around the (xcenter,ycenter) point. |
java.lang.String |
getName()
Returns the name of the Map |
java.lang.Object |
getObject(int x,
int y)
Get an object at the specified position |
java.util.Vector |
getPathPlaceEventListeners()
Returns the vector of PathPlaceEventListeners |
int |
getResolution()
Return the resolution of the Map. |
StatServer |
getStatServer()
Returns the StatServer of the Map |
int |
getXFactor()
Return the X factor of the Map, usually it is the width |
int |
getYFactor()
Return the Y factor of the Map, usually it is the height |
int |
getZFactor()
Return the Z factor of the Map. |
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 |
void |
populateMap(Filler fil)
Populate the Map with the given Filler |
void |
removeAbstractMapListener(AbstractMapEventListener listener)
Removes the AbstractMapEventListener |
void |
removeAllListeners()
Removes all listeners, usually used for serialization |
void |
removePathPlaceEventListener(PathPlaceEventListener listener)
Removes the PathPlaceEventListener |
void |
resetAllCellsValue()
Reset all the cell values |
void |
resetAllUnits()
Reset all the Units |
void |
setHeuristicFactor(int f)
Set the heuristic factor for this map. |
void |
setObject(java.lang.Object obj,
int x,
int y)
Put an object at the specified position |
Method Detail |
public double computeHeuristic(PathPlace origin, PathPlace dest, double factor)
origin
- 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 heuristicpublic double computeHeuristic(PathPlace origin, PathPlace dest)
PathPlace
s. Use the built-in heuristic factor. This factor can be change with the setHeuristicFactor
method
origin
- The PathPlace origin from which we want to compute the heuristicdest
- The PathPlace origin from which we want to compute the heuristicpublic void setHeuristicFactor(int f)
f
- the heuristic factorpublic PathPlaceSet findShortestPath(PathPlace origin, PathPlace dest, PathUser pu, java.util.Properties algoProperties)
origin
- The Origin of the Pathdest
- The destination of the Pathpu
- The PathUser that will use the PathalgoProperties
- The properties relative to the AlgorithmPathPlaceSet
object. The set of PathPlace
s that make up the best Path for that PathUser
public PathPlaceSet findShortestPath(PathPlace origin, PathPlace dest, PathUser pu)
origin
- The Origin of the Pathdest
- The destination of the Pathpu
- The PathUser that will use the PathPathPlaceSet
object. The set of PathPlace
s that make up the best Path for that PathUser
public PathPlaceSet fastFindShortestPath(PathPlace origin, PathPlace dest, PathUser pu)
origin
- The Origin of the Pathdest
- The destination of the Pathpu
- The PathUser that will use the PathPathPlaceSet
object. The set of PathPlace
s that make up the best Path for that PathUser
public void firePathComputation(PathPlaceSet path)
path
- The computed PathPlaceSet
public void firePathPlaceChange(PathPlace mp)
mp
- The PathPlace that has been modifiedpublic double getCostToReach(PathPlace from, PathPlace to, PathUser pu)
from
- The originto
- the destinationpu
- The PathUser
public int getResolution()
public int getXFactor()
public int getYFactor()
public int getZFactor()
public MapUnit getMapUnit(int xfactor, int yfactor)
yfactor
- y coordinatexfactor
- x coordinateMapUnit
public MapUnit[][] getMapUnit(int xcenter, int ycenter, int halfWidth, int halfHeight)
xcenter
- x coordinateycenter
- y coordinatehalfWidth
- the number of MapUnit we want to include.halfHeight
- the number of MapUnit we want to includepublic MapUnit[][] getAllMapUnits()
public java.lang.Object[][] getMapObjects(int xcenter, int ycenter, int halfWidth, int halfHeight)
xcenter
- x coordinateycenter
- y coordinatehalfWidth
- the number of Objects we want to include.halfHeight
- the number of Objects we want to includepublic void setObject(java.lang.Object obj, int x, int y)
obj
- The object to putx
- x coordinatey
- y coordinatepublic java.lang.Object getObject(int x, int y)
x
- x coordinatey
- y coordinatepublic boolean isThereRoom(int x, int y, int xWidth, int yHeight)
x
- x coordinatey
- y coordinatexWidth
- length in width of the ObjectyHeight
- length in height of the Object
public void addAbstractMapListener(AbstractMapEventListener listener)
public void removeAbstractMapListener(AbstractMapEventListener listener)
public void addPathPlaceEventListener(PathPlaceEventListener listener)
public void removePathPlaceEventListener(PathPlaceEventListener listener)
public void removeAllListeners()
public void resetAllUnits()
public void resetAllCellsValue()
public void populateMap(Filler fil)
fil
- The Fillerpublic StatServer getStatServer()
public FillerServer getFillerServer()
public java.lang.String getName()
public java.util.Vector getPathPlaceEventListeners()
public java.util.Vector getAbstractMapListener()
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |