Class LaneType

    • Constructor Detail

      • LaneType

        public LaneType​(String id,
                        GtuCompatibility<LaneType> compatibility,
                        RoadNetwork network)
                 throws NullPointerException
        Create a new Lane type with a compatibility set.
        Parameters:
        id - String; the id of the lane type.
        compatibility - GtuCompatibility<LaneType>; the collection of compatible GTUTypes for this LaneType. Compatibility is solely determined by a specific lane type, and independent of compatibility in super or sub types.
        network - RoadNetwork; The network to which the LaneType belongs
        Throws:
        NullPointerException - if either the id is null, or the compatibilitySet is null
      • LaneType

        public LaneType​(String id,
                        LaneType parent,
                        GtuCompatibility<LaneType> compatibility,
                        RoadNetwork network)
                 throws NullPointerException
        Create a new Lane type with a compatibility set.
        Parameters:
        id - String; the id of the lane type.
        parent - LaneType; parent type
        compatibility - GtuCompatibility<LaneType>; the collection of compatible GTUTypes for this LaneType. Compatibility is solely determined by a specific lane type, and independent of compatibility in super or sub types.
        network - RoadNetwork; The network to which the LaneType belongs
        Throws:
        NullPointerException - if either the id is null, or the compatibilitySet is null
    • Method Detail

      • isOfType

        public boolean isOfType​(LaneType.DEFAULTS type)
        Whether this, or any of the parent types, equals the given type.
        Parameters:
        type - DEFAULTS; type
        Returns:
        whether this, or any of the parent types, equals the given type
      • inv

        public final LaneType inv()
        Construct a new Lane type based on another Lane type with longitudinally inverted compatibility.
        Returns:
        LaneType; the new lane type
      • getCompatibility

        public GtuCompatibility<LaneType> getCompatibility()
        Returns:
        the gtu compatibility for this LaneType
      • getNetwork

        public RoadNetwork getNetwork()
        Returns:
        the network to which the LinkType belongs
      • isCompatible

        public final Boolean isCompatible​(GtuType gtuType,
                                          GtuDirectionality direction)
        Compatibility is solely determined by a specific lane type, and independent of compatibility in super or sub types.
        Specified by:
        isCompatible in interface Compatibility<GtuType,​LaneType>
        Parameters:
        gtuType - GtuType; GTU type to look for compatibility.
        direction - GtuDirectionality; the direction that the GTU is moving (with respect to the direction of the design line of the Link)
        Returns:
        boolean; true if this LaneType permits GTU type in the given direction
      • getDirectionality

        public final LongitudinalDirectionality getDirectionality​(GtuType gtuType)
        Get the permitted driving directions for a given GTU type on this Lane.
        Parameters:
        gtuType - GtuType; the GTU type
        Returns:
        LongitudinalDirectionality; the permitted directions of the GTU type on this Lane
      • addGtuCompatability

        public final void addGtuCompatability​(GtuType gtuType,
                                              LongitudinalDirectionality direction)
        Add GTU type to compatibility.
        Parameters:
        gtuType - GtuType; the GTU type to add
        direction - LongitudinalDirectionality; permitted direction of movement