@Component @Lazy public class AStarGraphProvider extends BaseGraphCalulationService
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private GraphAStar<javafx.geometry.Point2D> |
graph |
private int |
height |
private Map<javafx.geometry.Point2D,com.carrotsearch.hppc.ObjectDoubleMap<javafx.geometry.Point2D>> |
heuristic |
private AStarHeuristicProvider |
heuristicProvider |
private Object |
lock |
private org.apache.logging.log4j.Logger |
logger |
private Executor |
serverThreadPool |
private int |
width |
imageService, map, pointInternerCHECK_DISTANCE, DIAG_CHECK_DISTANCE| Constructor and Description |
|---|
AStarGraphProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDestinationPoint(javafx.geometry.Point2D newPoint,
boolean isCity)
Add a new destination Node to the graph.
|
(package private) void |
addDestinationPointInternal(javafx.geometry.Point2D newPoint,
boolean isCity) |
private void |
addEdges(javafx.geometry.Point2D from,
javafx.geometry.Point2D to,
boolean isCity,
boolean initial) |
(package private) void |
addSourcePointInternal(javafx.geometry.Point2D source,
boolean isCity) |
protected double |
calculateWeight(javafx.geometry.Point2D from,
javafx.geometry.Point2D to)
Calculate the weight between two nodes.
|
(package private) void |
createGraph() |
GraphAStar<javafx.geometry.Point2D> |
getGraph() |
private void |
init() |
void |
initGraph(HeuristicGraphInitialisationComplete event) |
(package private) void |
initImage() |
getPoint, getSegments, getTangentialSegments, isOnSea@Autowired private AStarHeuristicProvider heuristicProvider
private final org.apache.logging.log4j.Logger logger
@Autowired @Qualifier(value="serverThreadPool") private Executor serverThreadPool
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
private final Object lock
private int width
private int height
private GraphAStar<javafx.geometry.Point2D> graph
private Map<javafx.geometry.Point2D,com.carrotsearch.hppc.ObjectDoubleMap<javafx.geometry.Point2D>> heuristic
@PostConstruct private void init()
public void initGraph(HeuristicGraphInitialisationComplete event)
void createGraph()
public void addDestinationPoint(javafx.geometry.Point2D newPoint,
boolean isCity)
newPoint - new location to add to the graphisCity - flag indicating if the new location is a city, which means the coordinates
may not be located in the sea area.void addDestinationPointInternal(javafx.geometry.Point2D newPoint,
boolean isCity)
void addSourcePointInternal(javafx.geometry.Point2D source,
boolean isCity)
protected double calculateWeight(javafx.geometry.Point2D from,
javafx.geometry.Point2D to)
BaseGraphCalulationServicecalculateWeight in class BaseGraphCalulationServicefrom - source nodeto - destination nodefrom to toprivate void addEdges(javafx.geometry.Point2D from,
javafx.geometry.Point2D to,
boolean isCity,
boolean initial)
void initImage()
throws IOException
IOExceptionpublic GraphAStar<javafx.geometry.Point2D> getGraph()
Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.