public class Pathfinder extends Extension implements PathfindingAlgorithm
Modifier and Type | Class and Description |
---|---|
class |
Pathfinder.AStarAlgorithm
Berechnet einen optimalen Pfad von Punkt A nach Punkt B.
|
class |
Pathfinder.FocussedComparator
Bildet den
openList Comparator für eine fokussierende Metrik. |
class |
Pathfinder.UnfocussedComparator
Bildet den
openList Comparator für eine nicht-fokussierende Metrik. |
Modifier and Type | Field and Description |
---|---|
HashSet |
closedList
Hält Referenzen auf Punkte, die bereits expandiert sind.
|
boolean |
gotPath |
PriorityQueue |
openList
Hält Referenzen auf Punkte, die noch expandiert werden müssen.
|
Constructor and Description |
---|
Pathfinder(Operator operator)
Instantiiert ein
Pathfinder -Modul. |
Modifier and Type | Method and Description |
---|---|
boolean |
computePathTo(int x,
int y)
Berechnet einen Pfad zu den Koordinaten (x|y).
|
boolean |
getFocussed()
Gibt zurück, ob eine fokussierende Metrik verwendet wird.
|
void |
init()
Bereitet den Algorithmus auf Berechnungen vor.
|
void |
setFocussed(boolean focussed)
Stellt ein, ob eine fokussierende Metrik verwendet werden soll.
|
Coordinate |
step()
Gibt die Koordinate des nächsten Schrittes aus.
|
getOperator
public HashSet closedList
public boolean gotPath
public PriorityQueue openList
public Pathfinder(Operator operator)
Pathfinder
-Modul.operator
- Der Operator
, der dieses Modul nutzen will.public boolean computePathTo(int x, int y)
PathfindingAlgorithm
computePathTo
in interface PathfindingAlgorithm
x
- Der x-Wert der Zielkoordinate.y
- Der y-Wert der Zielkoordinate.public boolean getFocussed()
PathfindingAlgorithm
getFocussed
in interface PathfindingAlgorithm
public void init()
PathfindingAlgorithm
init
in interface PathfindingAlgorithm
public void setFocussed(boolean focussed)
PathfindingAlgorithm
setFocussed
in interface PathfindingAlgorithm
focussed
- Ob eine Heuristik verwendet werden soll.public Coordinate step()
PathfindingAlgorithm
step
in interface PathfindingAlgorithm