Enum LongitudinalDirectionality

    • Enum Constant Detail

      • DIR_PLUS

        public static final LongitudinalDirectionality DIR_PLUS
        Direction the same as the direction of the graph, increasing fractional position when driving in this direction.
      • DIR_MINUS

        public static final LongitudinalDirectionality DIR_MINUS
        Direction opposite to the direction of the graph, decreasing fractional position when driving in this direction.
    • Method Detail

      • values

        public static LongitudinalDirectionality[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (LongitudinalDirectionality c : LongitudinalDirectionality.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LongitudinalDirectionality valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getDirectionalities

        public final ImmutableSet<GTUDirectionality> getDirectionalities()
        Retrieve the permitted driving directions.
        Returns:
        ImmutableSet<GTUDirectionality>; immutable set containing the permitted driving directions
      • contains

        public final boolean contains​(LongitudinalDirectionality directionality)
        This method looks if this directionality "contains" the provided other directionality. The logic table looks as follows:
         
        THIS ↓   OTHER → DIR_BOTH      DIR_PLUS    DIR_MINUS DIR_NONE     
        DIR_BOTH true true true true
        DIR_PLUS false true false true
        DIR_MINUS false false true true
        DIR_NONE false false false true
        Parameters:
        directionality - LongitudinalDirectionality; the directionality to compare with
        Returns:
        whether this directionality "contains" the provided other directionality
      • isForwardOrBoth

        public final boolean isForwardOrBoth()
        Easy access method to test if the directionality is FORWARD or BOTH.
        Returns:
        whether the directionality is FORWARD or BOTH
      • isBackwardOrBoth

        public final boolean isBackwardOrBoth()
        Easy access method to test if the directionality is BACKWARD or BOTH.
        Returns:
        whether the directionality is BACKWARD or BOTH
      • isForward

        public final boolean isForward()
        Easy access method to test if the directionality is FORWARD.
        Returns:
        whether the directionality is FORWARD
      • isBackward

        public final boolean isBackward()
        Easy access method to test if the directionality is BACKWARD.
        Returns:
        whether the directionality is BACKWARD
      • isBoth

        public final boolean isBoth()
        Easy access method to test if the directionality is BACKWARD or BOTH.
        Returns:
        whether the directionality is BACKWARD or BOTH
      • isNone

        public final boolean isNone()
        Easy access method to test if the directionality is NONE.
        Returns:
        whether the directionality is NONE
      • intersect

        public final LongitudinalDirectionality intersect​(LongitudinalDirectionality other)
        Compute the intersection of this LongitudinalDirectionality with another LongitudinalDirectionality.
        Parameters:
        other - LongitudinalDirectionality; the other LongitudinalDirectionality
        Returns:
        LongitudinalDirectionality; the intersection of this and other
      • permits

        public final boolean permits​(GTUDirectionality direction)
        Check if a direction is permitted by this LongitudinalDirectionality.
        Parameters:
        direction - GTUDirectionality; the direction of motion in which a GTU moves, or wants to move
        Returns:
        boolean; true if the direction is permitted by this LongitudinalDirectionality; false if it is not permitted
      • invert

        public LongitudinalDirectionality invert()
        Return the inverse if this LongitudinalDirectionality.
        Returns:
        LongitudinalDirectionality; the directional inverse of this LongitudinalDirectionality