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 GeometricGraphNode interface, associating each node with a specific Point in two-dimensional space.
  • Arcs are represented by instances of classes implementing this GeometricGraphArc interface, associating each arc with a Polyline in 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 Polyline is reversed relative to the original arc.

Illustration of a simple geometric graph:

Author:
Andrey Malykhanov
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    Returns the length of this arc, i.e.
    Returns the Polyline corresponding to this arc.
    Returns the arc that is a reverse to this one, or null if this is a one-way arc.
    double
    getReverseOffset(double offset)
    Returns the absolute offset of this point on the reverse arc, if there is a reverse arc.
    void
    Sets the reverse arc to this one.
  • Method Details

    • getReverseArc

      GeometricGraphArc getReverseArc()
      Returns the arc that is a reverse to this one, or null if 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, returns Double.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

      void setReverseArc(GeometricGraphArc reverseArc)
      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 the Polyline corresponding to this arc.
      Returns:
      Polyline corresponding to this arc
    • getLength

      default double getLength()
      Returns the length of this arc, i.e. the length of the Polyline returned by getPolyline() method.
      Returns:
      length of this arc