Class HeadwayGtuType.PerceivedHeadwayGtuType

    • Constructor Detail

      • PerceivedHeadwayGtuType

        public PerceivedHeadwayGtuType​(Estimation estimation,
                                       Anticipation anticipation)
        Constructor.
        Parameters:
        estimation - Estimation; estimation
        anticipation - Anticipation; anticipation
    • Method Detail

      • createHeadwayGtu

        public HeadwayGTU createHeadwayGtu​(LaneBasedGTU perceivingGtu,
                                           LaneBasedGTU perceivedGtu,
                                           Length distance,
                                           boolean downstream)
                                    throws GTUException,
                                           org.opentrafficsim.base.parameters.ParameterException
        Creates a headway object from a GTU, downstream or upstream. The default implementation figures out from possible negative distance whether a parallel GTU should be created.
        Specified by:
        createHeadwayGtu in interface HeadwayGtuType
        Parameters:
        perceivingGtu - LaneBasedGTU; perceiving GTU
        perceivedGtu - LaneBasedGTU; perceived GTU
        distance - Length; distance
        downstream - boolean; downstream (or upstream) neighbor
        Returns:
        headway object from a gtu
        Throws:
        GTUException - when headway object cannot be created
        org.opentrafficsim.base.parameters.ParameterException - on invalid parameter value or missing parameter
      • createDownstreamGtu

        public HeadwayGTU createDownstreamGtu​(LaneBasedGTU perceivingGtu,
                                              LaneBasedGTU perceivedGtu,
                                              Length distance)
                                       throws GTUException,
                                              org.opentrafficsim.base.parameters.ParameterException
        Creates a headway object from a GTU, downstream.
        Specified by:
        createDownstreamGtu in interface HeadwayGtuType
        Parameters:
        perceivingGtu - LaneBasedGTU; perceiving GTU
        perceivedGtu - LaneBasedGTU; perceived GTU
        distance - Length; distance
        Returns:
        headway object from a gtu
        Throws:
        GTUException - when headway object cannot be created
        org.opentrafficsim.base.parameters.ParameterException - on invalid parameter value or missing parameter
      • createUpstreamGtu

        public HeadwayGTU createUpstreamGtu​(LaneBasedGTU perceivingGtu,
                                            LaneBasedGTU perceivedGtu,
                                            Length distance)
                                     throws GTUException,
                                            org.opentrafficsim.base.parameters.ParameterException
        Creates a headway object from a GTU, downstream.
        Specified by:
        createUpstreamGtu in interface HeadwayGtuType
        Parameters:
        perceivingGtu - LaneBasedGTU; perceiving GTU
        perceivedGtu - LaneBasedGTU; perceived GTU
        distance - Length; distance
        Returns:
        headway object from a gtu
        Throws:
        GTUException - when headway object cannot be created
        org.opentrafficsim.base.parameters.ParameterException - on invalid parameter value or missing parameter
      • createParallelGtu

        public HeadwayGTU createParallelGtu​(LaneBasedGTU perceivingGtu,
                                            LaneBasedGTU perceivedGtu,
                                            Length overlapFront,
                                            Length overlap,
                                            Length overlapRear)
                                     throws GTUException
        Creates a headway object from a GTU, parallel.
        Specified by:
        createParallelGtu in interface HeadwayGtuType
        Parameters:
        perceivingGtu - LaneBasedGTU; perceiving GTU
        perceivedGtu - LaneBasedGTU; perceived GTU
        overlapFront - Length; front overlap
        overlap - Length; overlap
        overlapRear - Length; rear overlap
        Returns:
        headway object from a gtu
        Throws:
        GTUException - when headway object cannot be created