java.lang.Iterable<T>public class GraphAStar<T>
extends java.lang.Object
implements java.lang.Iterable<T>
| Constructor | Description |
|---|---|
GraphAStar(java.util.Map<T,com.carrotsearch.hppc.ObjectDoubleMap<T>> heuristicMap) |
| Modifier and Type | Method | 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.
|
com.carrotsearch.hppc.ObjectDoubleMap<NodeData<T>> |
edgesFrom(T nodeId) |
Returns immutable view of the edges
|
NodeData<T> |
getNodeData(T nodeId) |
The nodedata corresponding to the current nodeId.
|
java.util.Iterator<T> |
iterator() |
Returns an iterator that can traverse the nodes of the graph
|
int |
size() |
public 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 com.carrotsearch.hppc.ObjectDoubleMap<NodeData<T>> 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 java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public int size()
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.