| Modifier and Type | Field and Description |
|---|---|
private Map<T,Map<NodeData<T>,Double>> |
graph |
private Map<T,Map<T,Double>> |
heuristicMap |
private Map<T,NodeData<T>> |
nodeIdNodeData |
| Constructor and Description |
|---|
GraphAStar(Map<T,Map<T,Double>> heuristicMap) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(T nodeIdFirst,
T nodeIdSecond,
double length)
Adds an edge from source node to destination node.
|
void |
addEdgeInternal(T nodeIdFirst,
T nodeIdSecond,
double length)
Adds an edge from source node to destination node.
|
void |
addNode(T nodeId,
boolean isTargetNode)
Adds a new node to the graph.
|
void |
addNodeInternal(T nodeId)
Adds a new node to the graph.
|
boolean |
containsNode(T nodeId)
Check if the nodeid is already present in the data.
|
Map<NodeData<T>,Double> |
edgesFrom(T nodeId)
Returns immutable view of the edges
|
NodeData<T> |
getNodeData(T nodeId)
The nodedata corresponding to the current nodeId.
|
Iterator<T> |
iterator()
Returns an iterator that can traverse the nodes of the graph
|
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic void addNode(T nodeId, boolean isTargetNode)
nodeId - the node to be addedisTargetNode - flag indicatin the the node is a target node. Only target nodes are contained in the heuristic.public void addNodeInternal(T nodeId)
nodeId - the node to be addedpublic void addEdge(T nodeIdFirst, T nodeIdSecond, double length)
nodeIdFirst - the first node to be in the edgenodeIdSecond - the second node to be second node in the edgelength - the length of the edge.public void addEdgeInternal(T nodeIdFirst, T nodeIdSecond, double length)
nodeIdFirst - the first node to be in the edgenodeIdSecond - the second node to be second node in the edgelength - the length of the edge.public Map<NodeData<T>,Double> edgesFrom(T nodeId)
nodeId - the nodeId whose outgoing edge needs to be returnedpublic NodeData<T> getNodeData(T nodeId)
nodeId - the nodeId to be returnedpublic boolean containsNode(T nodeId)
nodeId - to be looked up.public int size()
Copyright © 2011-2016 Sahits GmbH. All Rights Reserved.