Class AnticipationInfo
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.util.AnticipationInfo
-
- All Implemented Interfaces:
Serializable
public final class AnticipationInfo extends Object implements Serializable
Utility class that stores duration and end-speed for a given anticipated movement.Copyright (c) 2013-2020 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 Jun 7, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AnticipationInfo(Duration duration, Speed endSpeed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AnticipationInfo
anticipateMovement(Length distance, Speed initialSpeed, Acceleration acceleration)
Returns info of the anticipation assuming constant acceleration.static AnticipationInfo
anticipateMovementFreeAcceleration(Length distance, Speed initialSpeed, Parameters parameters, CarFollowingModel carFollowingModel, SpeedLimitInfo speedLimitInfo, Duration timeStep)
Returns info of the anticipation using free acceleration from car-following model.static AnticipationInfo
anticipateMovementSpeedLimited(Length distance, Speed initialSpeed, Acceleration acceleration, Speed maxSpeed)
Returns info of the anticipation assuming constant acceleration, without exceeding maximum speed.Duration
getDuration()
Speed
getEndSpeed()
String
toString()
-
-
-
Method Detail
-
getDuration
public Duration getDuration()
- Returns:
- duration.
-
getEndSpeed
public Speed getEndSpeed()
- Returns:
- endSpeed.
-
anticipateMovement
public static AnticipationInfo anticipateMovement(Length distance, Speed initialSpeed, Acceleration acceleration)
Returns info of the anticipation assuming constant acceleration.- Parameters:
distance
- Length; distance to coverinitialSpeed
- Speed; initial speedacceleration
- Acceleration; (assumed) acceleration- Returns:
- duration to cover given distance with given initial speed and acceleration
-
anticipateMovementSpeedLimited
public static AnticipationInfo anticipateMovementSpeedLimited(Length distance, Speed initialSpeed, Acceleration acceleration, Speed maxSpeed)
Returns info of the anticipation assuming constant acceleration, without exceeding maximum speed.- Parameters:
distance
- Length; distance to coverinitialSpeed
- Speed; initial speedacceleration
- Acceleration; (assumed) accelerationmaxSpeed
- Speed; maximum speed- Returns:
- duration to cover given distance with given initial speed and acceleration, without exceeding maximum speed
-
anticipateMovementFreeAcceleration
public static AnticipationInfo anticipateMovementFreeAcceleration(Length distance, Speed initialSpeed, Parameters parameters, CarFollowingModel carFollowingModel, SpeedLimitInfo speedLimitInfo, Duration timeStep) throws ParameterException
Returns info of the anticipation using free acceleration from car-following model.- Parameters:
distance
- Length; distance to coverinitialSpeed
- Speed; initial speedparameters
- Parameters; parameters of the anticipated GTUcarFollowingModel
- CarFollowingModel; car-following model of the anticipated GTUspeedLimitInfo
- SpeedLimitInfo; speed limit info of the anticipated GTUtimeStep
- Duration; time step to use- Returns:
- info regarding anticipation of movement
- Throws:
ParameterException
- if parameter is not defined
-
-