Class Conflict

    • Method Detail

      • getUpstreamGtus

        public PerceptionCollectable<HeadwayGTU,​LaneBasedGTU> getUpstreamGtus​(LaneBasedGTU perceivingGtu,
                                                                                    HeadwayGtuType headwayGtuType,
                                                                                    Length visibility)
        Provides the upstream GTUs.
        Parameters:
        perceivingGtu - LaneBasedGTU; perceiving GTU
        headwayGtuType - HeadwayGtuType; headway GTU type to use
        visibility - Length; distance over which GTU's are provided
        Returns:
        PerceptionIterable<HeadwayGtU>; iterable over the upstream GTUs
      • getDownstreamGtus

        public PerceptionCollectable<HeadwayGTU,​LaneBasedGTU> getDownstreamGtus​(LaneBasedGTU perceivingGtu,
                                                                                      HeadwayGtuType headwayGtuType,
                                                                                      Length visibility)
        Provides the downstream GTUs.
        Parameters:
        perceivingGtu - LaneBasedGTU; perceiving GTU
        headwayGtuType - HeadwayGtuType; headway GTU type to use
        visibility - Length; distance over which GTU's are provided
        Returns:
        PerceptionIterable<HeadwayGtU>; iterable over the downstream GTUs
      • getConflictType

        public ConflictType getConflictType()
        Returns:
        conflictType.
      • getConflictRule

        public ConflictRule getConflictRule()
        Returns:
        conflictRule.
      • conflictPriority

        public ConflictPriority conflictPriority()
        Returns:
        conflictPriority.
      • getLength

        public Length getLength()
        Returns:
        length.
      • getOtherConflict

        public Conflict getOtherConflict()
        Returns:
        otherConflict.
      • getGtuType

        public GTUType getGtuType()
        Returns:
        gtuType.
      • isPermitted

        public boolean isPermitted()
        If permitted, traffic upstream of traffic lights may not be ignored, as these can have green light.
        Returns:
        permitted.
      • getTrafficLightDistance

        public Length getTrafficLightDistance​(Length maxDistance)
        Returns the distance to an upstream traffic light.
        Parameters:
        maxDistance - Length; maximum distance of traffic light
        Returns:
        Length; distance to upstream traffic light, infinite if beyond maximum distance
      • generateConflictPair

        public static void generateConflictPair​(ConflictType conflictType,
                                                ConflictRule conflictRule,
                                                boolean permitted,
                                                Lane lane1,
                                                Length longitudinalPosition1,
                                                Length length1,
                                                GTUDirectionality direction1,
                                                OTSLine3D geometry1,
                                                GTUType gtuType1,
                                                Lane lane2,
                                                Length longitudinalPosition2,
                                                Length length2,
                                                GTUDirectionality direction2,
                                                OTSLine3D geometry2,
                                                GTUType gtuType2,
                                                DEVSSimulatorInterface.TimeDoubleUnit simulator)
                                         throws NetworkException
        Creates a pair of conflicts.
        Parameters:
        conflictType - ConflictType; conflict type, i.e. crossing, merge or split
        conflictRule - ConflictRule; conflict rule
        permitted - boolean; whether the conflict is permitted in traffic light control
        lane1 - Lane; lane of conflict 1
        longitudinalPosition1 - Length; longitudinal position of conflict 1
        length1 - Length; Length of conflict 1
        direction1 - GTUDirectionality; GTU direction of conflict 1
        geometry1 - OTSLine3D; geometry of conflict 1
        gtuType1 - GTUType; gtu type of conflict 1
        lane2 - Lane; lane of conflict 2
        longitudinalPosition2 - Length; longitudinal position of conflict 2
        length2 - Length; Length of conflict 2
        direction2 - GTUDirectionality; GTU direction of conflict 2
        geometry2 - OTSLine3D; geometry of conflict 2
        gtuType2 - GTUType; gtu type of conflict 2
        simulator - DEVSSimulatorInterface.TimeDoubleUnit; the simulator for animation and timed events
        Throws:
        NetworkException - if the combination of conflict type and both conflict rules is not correct