@Component @Lazy public class AStarHeuristicProvider extends BaseGraphCalulationService
imageService, map, pointInterner| Constructor | Description |
|---|---|
AStarHeuristicProvider() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addSourceNodeToHeuristic(javafx.geometry.Point2D source) |
Add a new target node to the heuristic.
|
void |
addTargetNodeToHeuristic(javafx.geometry.Point2D target) |
Add a new target node to the heuristic.
|
protected double |
calculateWeight(javafx.geometry.Point2D from,
javafx.geometry.Point2D to) |
Calculate the weight between two nodes.
|
javafx.geometry.Point2D |
findClosest(javafx.geometry.Point2D point) |
Find the closest point in the graph for a defined point.
|
java.util.Map<javafx.geometry.Point2D,com.carrotsearch.hppc.ObjectDoubleMap<javafx.geometry.Point2D>> |
getHeuristic() |
Retrieve the heuristic map.
|
boolean |
heuristicForSourceAvailable(javafx.geometry.Point2D source) |
Check if the heuristic for a target location is calculated.
|
void |
registerGameLoad(ch.sahits.game.openpatrician.event.GameStateChange gameStateChange) |
getPoint, getSegments, getTangentialSegments, isOnSeapublic void registerGameLoad(ch.sahits.game.openpatrician.event.GameStateChange gameStateChange)
protected double calculateWeight(javafx.geometry.Point2D from,
javafx.geometry.Point2D to)
BaseGraphCalulationServicecalculateWeight in class BaseGraphCalulationServicefrom - source nodeto - destination nodefrom to topublic boolean heuristicForSourceAvailable(javafx.geometry.Point2D source)
source - locationpublic java.util.Map<javafx.geometry.Point2D,com.carrotsearch.hppc.ObjectDoubleMap<javafx.geometry.Point2D>> getHeuristic()
public void addTargetNodeToHeuristic(javafx.geometry.Point2D target)
target - location to be added.public void addSourceNodeToHeuristic(javafx.geometry.Point2D source)
source - location to be added.public javafx.geometry.Point2D findClosest(javafx.geometry.Point2D point)
point - for which the closest defined point should be looked up.pointCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.