|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--drasys.or.graph.Graph | +--drasys.or.graph.BaseGraph | +--drasys.or.graph.PointGraph
An implementation of a graph where the vertices are a set of points and the edge values
are the distances between the end points.
The distance between two end points is dependent on the coordinate system.
The edge method 'getCost' returns the distance scaled by 'costPerDistance'.
The edge method 'getTime' returns the distance scaled by 'timePerDistance'.
The edge method 'getDistance' returns the distance between the end points.
The edge method 'getValue()'returns a new 'EdgeValue' containing the values.
The vertex method 'doubleValue()' returns a double value based on the vertex value object.
If the value object is not null and either implements 'DoubleI' or is a subclass of 'Number'
then the returned value is 'value.doubleValue()'.
Otherwise; the value is zero.
References:
Graphs : Theory and Algorithms
K. Thulasiraman, M.N.S. Swamy / Paperback / Published 1992
Fields inherited from class drasys.or.graph.Graph |
_symmetric |
Constructor Summary | |
PointGraph()
|
|
PointGraph(int vertexCapacity)
|
|
PointGraph(VectorI x,
VectorI y)
Initializes the graph with vertices from the values in the vectors. |
|
PointGraph(VectorI x,
VectorI y,
VectorI z)
Initializes the graph with vertices from the values in the vectors. |
Method Summary | |
VertexI |
addVertex(java.lang.Object key,
java.lang.Object value)
Adds a new vertex to the graph. |
CoordinateSystemI |
cordinateSystem()
Returns the coordinate system used by the graph. |
EdgeI |
getEdge(VertexI from,
VertexI to,
java.lang.Object edgeKey)
Get the edge between the 'from' and 'to' vertices whose key matches 'edgeKey'. |
EdgeI |
getMutableEdge(VertexI from,
VertexI to,
java.lang.Object edgeKey)
Get the edge between the 'from' and 'to' vertices whose key matches 'edgeKey'. |
boolean |
isSymmetric()
Returns true if the points are from a symmetric coordinate system, false otherwise. |
GraphI |
newGraph(int vertexCapacity,
int edgeCapacity)
Create a new empty PointGraph. |
protected VertexI |
newVertex(java.lang.Object key,
java.lang.Object value)
|
VertexI |
removeVertex(java.lang.Object key,
boolean removeZeroVertices)
Removes a vertex whose key matches the argument and all its adjacent edges. |
VertexI |
removeVertex(VertexI vertex,
boolean removeZeroVertices)
Removes a vertex whose key matches the key in the argument and all its adjacent edges. |
void |
setCost(double cost)
Sets the cost per distance used to compute travel cost from the distance. |
void |
setSpeed(double speed)
Sets the speed used to compute travel time from the distance. |
java.lang.String |
toString()
|
void |
useDistanceProxy(boolean useProxy)
If useProxy is true then PointI.distanceProxyTo() will be used as the edge value. |
Methods inherited from class drasys.or.graph.BaseGraph |
addVertex,
addVertex,
ensureVertexCapacity,
getChangeCount,
getVertex,
removeAllVertices,
sizeOfDirectedEdges,
sizeOfEdges,
sizeOfVertices,
vertices |
Methods inherited from class drasys.or.graph.Graph |
edges,
equals,
getEdge,
getEdge,
isSubsetOf,
mutableEdges,
setSymmetric,
toString |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public PointGraph()
public PointGraph(int vertexCapacity)
public PointGraph(VectorI x, VectorI y)
public PointGraph(VectorI x, VectorI y, VectorI z)
Method Detail |
public void setSpeed(double speed)
public void setCost(double cost)
public CoordinateSystemI cordinateSystem()
public void useDistanceProxy(boolean useProxy)
public VertexI addVertex(java.lang.Object key, java.lang.Object value) throws DuplicateVertexException
protected VertexI newVertex(java.lang.Object key, java.lang.Object value)
public boolean isSymmetric()
public GraphI newGraph(int vertexCapacity, int edgeCapacity)
public EdgeI getEdge(VertexI from, VertexI to, java.lang.Object edgeKey)
public EdgeI getMutableEdge(VertexI from, VertexI to, java.lang.Object edgeKey)
public VertexI removeVertex(VertexI vertex, boolean removeZeroVertices) throws VertexNotFoundException
public VertexI removeVertex(java.lang.Object key, boolean removeZeroVertices) throws VertexNotFoundException
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |