@Component @Lazy @DependentInitialisation(value=ch.sahits.game.openpatrician.util.StartNewGameBean.class) public class AStar extends Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
AStar.NodeComparator |
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private GraphAStar<javafx.geometry.Point2D> |
graph |
private AStarGraphProvider |
graphProvider |
private org.apache.logging.log4j.Logger |
logger |
private ch.sahits.game.openpatrician.model.map.IMap |
map |
private ExecutorService |
paralleizationExecutor |
private Map<javafx.geometry.Point2D,Map<javafx.geometry.Point2D,List<javafx.geometry.Point2D>>> |
pathCache
Caching the paths with destination (outer key) and source (inner key)
|
private Executor |
serverThreadPool |
| Constructor and Description |
|---|
AStar() |
| Modifier and Type | Method and Description |
|---|---|
private void |
ensureSetup(javafx.geometry.Point2D source,
javafx.geometry.Point2D destination) |
private List<javafx.geometry.Point2D> |
findCached(javafx.geometry.Point2D destination,
javafx.geometry.Point2D source) |
List<javafx.geometry.Point2D> |
findPath(javafx.geometry.Point2D source,
javafx.geometry.Point2D destination)
Implements the A-star algorithm and returns the path from source to destination
|
private List<javafx.geometry.Point2D> |
path(Map<javafx.geometry.Point2D,javafx.geometry.Point2D> path,
javafx.geometry.Point2D destination) |
private final org.apache.logging.log4j.Logger logger
private GraphAStar<javafx.geometry.Point2D> graph
@Autowired private AStarGraphProvider graphProvider
@Autowired private ch.sahits.game.openpatrician.model.map.IMap map
@Autowired @Qualifier(value="serverThreadPool") private Executor serverThreadPool
@Autowired @Qualifier(value="paralleizationExecutor") private ExecutorService paralleizationExecutor
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
public List<javafx.geometry.Point2D> findPath(javafx.geometry.Point2D source, javafx.geometry.Point2D destination)
source - the source nodeiddestination - the destination nodeidprivate List<javafx.geometry.Point2D> findCached(javafx.geometry.Point2D destination, javafx.geometry.Point2D source)
private void ensureSetup(javafx.geometry.Point2D source,
javafx.geometry.Point2D destination)
Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.