Class RoadInformation


  • public class RoadInformation
    extends java.lang.Object

    Class containing information for road that may be shared by multiple arcs.

    Sharing information between arcs reduces memory footprints of the program (a long road is often split into multiple arcs at each intersection).

    • Constructor Detail

      • RoadInformation

        public RoadInformation​(RoadInformation.RoadType roadType,
                               AccessRestrictions access,
                               boolean isOneWay,
                               int maxSpeed,
                               java.lang.String name)
        Create a new RoadInformation instance containing the given parameters.
        Parameters:
        roadType - Type of the road (see RoadInformation.RoadType).
        access - Access restrictions for the road (see AccessRestrictions).
        isOneWay - true if this road is a one way road, false otherwise.
        maxSpeed - Maximum speed for the road (in kilometers-per-hour).
        name - Name of the road.
    • Method Detail

      • getAccessRestrictions

        public AccessRestrictions getAccessRestrictions()
        Returns:
        Access restrictions for this road.
      • isOneWay

        public boolean isOneWay()
        Returns:
        true if the road is a one-way road.
      • getMaximumSpeed

        public int getMaximumSpeed()
        Returns:
        Maximum speed for this road (in kilometers-per-hour).
      • getName

        public java.lang.String getName()
        Returns:
        Name of the road.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object