Interface GeometricGraphArc
- All Known Subinterfaces:
AgentGraphArc,LongAgentGraphArc
- All Known Implementing Classes:
AgentGraphArcImpl,LongAgentGraphArcImpl,RailArc
public interface GeometricGraphArc
Defines the contract for types that represent arc values in a geometric graph.
A geometric graph is a Graph where:
- Nodes are represented by instances of types implementing
GeometricGraphNodeinterface, associating each node with a specificPointin two-dimensional space. - Arcs are represented by instances of classes implementing this
GeometricGraphArcinterface, associating each arc with aPolylinein two-dimensional space that starts at the source node and ends at the destination node. - Each arc may have a corresponding reverse arc, where the source and destination nodes are swapped,
and the
Polylineis reversed relative to the original arc.
Illustration of a simple geometric graph:

- Author:
- Andrey Malykhanov
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault doubleReturns the length of this arc, i.e.Returns thePolylinecorresponding to this arc.Returns the arc that is a reverse to this one, ornullif this is a one-way arc.doublegetReverseOffset(double offset) Returns the absolute offset of this point on the reverse arc, if there is a reverse arc.voidsetReverseArc(GeometricGraphArc reverseArc) Sets the reverse arc to this one.
-
Method Details
-
getReverseArc
GeometricGraphArc getReverseArc()Returns the arc that is a reverse to this one, ornullif this is a one-way arc.- Returns:
- reverse arc, or
null
-
getReverseOffset
double getReverseOffset(double offset) Returns the absolute offset of this point on the reverse arc, if there is a reverse arc. Otherwise, returnsDouble.NaN.- Parameters:
offset- absolute offset of the point on this arc- Returns:
- absolute offset of the same point on the reverse arc, or
Double.NaN
-
setReverseArc
Sets the reverse arc to this one. Normally used only when constructing the graph.- Parameters:
reverseArc- reverse arc to this one- See Also:
-
getPolyline
Polyline getPolyline()Returns thePolylinecorresponding to this arc.- Returns:
Polylinecorresponding to this arc
-
getLength
default double getLength()Returns the length of this arc, i.e. the length of thePolylinereturned bygetPolyline()method.- Returns:
- length of this arc
-