public class StreetGraph extends org.jgrapht.graph.ListenableUndirectedWeightedGraph<MapPosition,org.jgrapht.graph.DefaultWeightedEdge>
Constructor and Description |
---|
StreetGraph(AgentScoutEnvironment environment) |
Modifier and Type | Method and Description |
---|---|
MapPosition |
getFarthestNeighborFrom(Point point,
MapPosition node) |
MapPosition |
getMapPosition(java.lang.String id) |
MapPosition |
getNearestNode(Point point)
Returns the closest node to the given point.
|
org.jgrapht.alg.NeighborIndex<MapPosition,org.jgrapht.graph.DefaultWeightedEdge> |
getNeighborIndex() |
MapPosition |
getRandomNeighborOfNode(MapPosition node) |
MapPosition |
getRandomNode() |
void |
loadFromMarshalledMap(Map map)
Returns precomputed d-value (a* distance) between two nodes.
|
void |
normalizeEdgeLength(double desiredLength)
Adds interpolated nodes the graph in order to make the edges of roughly the same length.
|
addEdge, addEdge, addGraphListener, addVertex, addVertexSetListener, clone, fireEdgeAdded, fireEdgeRemoved, fireVertexAdded, fireVertexRemoved, isReuseEvents, removeEdge, removeEdge, removeGraphListener, removeVertex, removeVertexSetListener, setReuseEvents
containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf, setEdgeWeight, toString, vertexSet
assertVertexExist, containsEdge, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toStringFromSets
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet
public StreetGraph(AgentScoutEnvironment environment)
public org.jgrapht.alg.NeighborIndex<MapPosition,org.jgrapht.graph.DefaultWeightedEdge> getNeighborIndex()
public MapPosition getRandomNode()
public void normalizeEdgeLength(double desiredLength)
desiredLength
- the desired length of the edge (step)public MapPosition getMapPosition(java.lang.String id)
public void loadFromMarshalledMap(Map map)
public MapPosition getNearestNode(Point point)
public MapPosition getRandomNeighborOfNode(MapPosition node)
public MapPosition getFarthestNeighborFrom(Point point, MapPosition node)