Interface Anticipation


  • public interface Anticipation
    Form of anticipation.

    Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version 24 feb. 2017
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Field Detail

      • NONE

        static final Anticipation NONE
        Assume no anticipation.
      • CONSTANT_SPEED

        static final Anticipation CONSTANT_SPEED
        Assume constant speed.
      • CONSTANT_ACCELERATION

        static final Anticipation CONSTANT_ACCELERATION
        Assume constant acceleration.
    • Method Detail

      • anticipate

        NeighborTriplet anticipate​(NeighborTriplet neighborTriplet,
                                   Duration duration,
                                   Length traveledDistance,
                                   boolean downstream)
        Anticipate movement.
        Parameters:
        neighborTriplet - NeighborTriplet; headway, speed and acceleration
        duration - Duration; duration
        traveledDistance - Length; distance the subject vehicle traveled during the anticipation time
        downstream - boolean; whether the perceived GTU is downstream
        Returns:
        anticipated info
      • egoAnticipation

        Length egoAnticipation​(Speed speed,
                               Acceleration acceleration,
                               Duration duration)
        Anticipate own movement.
        Parameters:
        speed - Speed; current speed
        acceleration - Acceleration; current acceleration
        duration - Duration; anticipation time
        Returns:
        anticipated distance traveled