Class IdmOld
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.following.AbstractGtuFollowingModelMobil
org.opentrafficsim.road.gtu.lane.tactical.following.IdmOld
- All Implemented Interfaces:
Serializable
,CarFollowingModel
,DesiredHeadwayModel
,DesiredSpeedModel
,GtuFollowingModelOld
,Initialisable
The Intelligent Driver Model by Treiber, Hennecke and Helbing.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Peter Knoppers
- See Also:
-
Field Summary
Fields inherited from class org.opentrafficsim.road.gtu.lane.tactical.following.AbstractGtuFollowingModelMobil
TOODANGEROUS
Fields inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel
CAR_FOLLOWING_MODEL
-
Constructor Summary
ConstructorDescriptionIdmOld()
Construct a new IDM car following model with reasonable values (reasonable for passenger cars).IdmOld
(org.djunits.value.vdouble.scalar.Acceleration a, org.djunits.value.vdouble.scalar.Acceleration b, org.djunits.value.vdouble.scalar.Length s0, org.djunits.value.vdouble.scalar.Duration tSafe, double delta) Construct a new IDM car following model. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.djunits.value.vdouble.scalar.Acceleration
computeAcceleration
(org.djunits.value.vdouble.scalar.Speed followerSpeed, org.djunits.value.vdouble.scalar.Speed followerMaximumSpeed, org.djunits.value.vdouble.scalar.Speed leaderSpeed, org.djunits.value.vdouble.scalar.Length headway, org.djunits.value.vdouble.scalar.Speed speedLimit) Compute the acceleration that would be used to follow a leader.final org.djunits.value.vdouble.scalar.Acceleration
computeAcceleration
(org.djunits.value.vdouble.scalar.Speed followerSpeed, org.djunits.value.vdouble.scalar.Speed followerMaximumSpeed, org.djunits.value.vdouble.scalar.Speed leaderSpeed, org.djunits.value.vdouble.scalar.Length headway, org.djunits.value.vdouble.scalar.Speed speedLimit, org.djunits.value.vdouble.scalar.Duration stepSize) Compute the acceleration that would be used to follow a leader.final org.djunits.value.vdouble.scalar.Length
desiredHeadway
(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed) Determines the desired headway in equilibrium conditions, i.e. no speed difference with the leader.final org.djunits.value.vdouble.scalar.Speed
desiredSpeed
(org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedInfo) Determines the desired speed.final org.djunits.value.vdouble.scalar.Acceleration
followingAcceleration
(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitInfo speedInfo, PerceptionIterable<? extends Headway> leaders) Determination of car-following acceleration, possibly based on multiple leaders.final String
Return the complete name of the car-following model.final org.djunits.value.vdouble.scalar.Acceleration
Return the maximum safe deceleration for use in gap acceptance models.final String
getName()
Return the name of the car-following model.final org.djunits.value.vdouble.scalar.Duration
Return the standard step size of this GTU following model.final void
setA
(org.djunits.value.vdouble.scalar.Acceleration a) Set value of acceleration parameter.final void
setFspeed
(double fSpeed) Set value of desired speed factor.final void
setT
(org.djunits.value.vdouble.scalar.Duration t) Set value of desired headway.final String
toString()
Methods inherited from class org.opentrafficsim.road.gtu.lane.tactical.following.AbstractGtuFollowingModelMobil
computeAccelerationStep, computeAccelerationStep, computeAccelerationStep, computeAccelerationStep, computeAccelerationStepWithNoLeader, computeAccelerationStepWithNoLeader, computeDualAccelerationStep, computeDualAccelerationStep, minimumHeadway
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel
init
-
Constructor Details
-
IdmOld
public IdmOld()Construct a new IDM car following model with reasonable values (reasonable for passenger cars). -
IdmOld
public IdmOld(org.djunits.value.vdouble.scalar.Acceleration a, org.djunits.value.vdouble.scalar.Acceleration b, org.djunits.value.vdouble.scalar.Length s0, org.djunits.value.vdouble.scalar.Duration tSafe, double delta) Construct a new IDM car following model.- Parameters:
a
- Acceleration; the maximum acceleration of a stationary vehicle (normal value is 1.56 m/s/s)b
- Acceleration; the maximum deemed-safe deceleration (this is a positive value). Normal value is 2.09 m/s/s.s0
- Length; the minimum stationary headway (normal value is 3 m)tSafe
- Duration; the minimum time-headway (normal value is 1.2 s)delta
- double; the speed limit adherence (1.0; mean free speed equals the speed limit; 1.1: mean free speed equals 110% of the speed limit; etc.)
-
-
Method Details
-
computeAcceleration
public final org.djunits.value.vdouble.scalar.Acceleration computeAcceleration(org.djunits.value.vdouble.scalar.Speed followerSpeed, org.djunits.value.vdouble.scalar.Speed followerMaximumSpeed, org.djunits.value.vdouble.scalar.Speed leaderSpeed, org.djunits.value.vdouble.scalar.Length headway, org.djunits.value.vdouble.scalar.Speed speedLimit) Compute the acceleration that would be used to follow a leader.- Specified by:
computeAcceleration
in interfaceGtuFollowingModelOld
- Parameters:
followerSpeed
- Speed; the speed of the follower at the current timefollowerMaximumSpeed
- Speed; the maximum speed that the follower is capable of driving atleaderSpeed
- Speed; the speed of the follower at the current timeheadway
- Length; the net headway (distance between the front of the follower to the rear of the leader) at the current time, or the maximum distance we can cover at the current time, e.g. as the result of a lane dropspeedLimit
- Speed; the local speed limit- Returns:
- Acceleration; the acceleration (or, if negative, deceleration) resulting from application of the GTU following model
-
computeAcceleration
public final org.djunits.value.vdouble.scalar.Acceleration computeAcceleration(org.djunits.value.vdouble.scalar.Speed followerSpeed, org.djunits.value.vdouble.scalar.Speed followerMaximumSpeed, org.djunits.value.vdouble.scalar.Speed leaderSpeed, org.djunits.value.vdouble.scalar.Length headway, org.djunits.value.vdouble.scalar.Speed speedLimit, org.djunits.value.vdouble.scalar.Duration stepSize) Compute the acceleration that would be used to follow a leader.- Specified by:
computeAcceleration
in interfaceGtuFollowingModelOld
- Parameters:
followerSpeed
- Speed; the speed of the follower at the current timefollowerMaximumSpeed
- Speed; the maximum speed that the follower is capable of driving atleaderSpeed
- Speed; the speed of the follower at the current timeheadway
- Length; the net headway (distance between the front of the follower to the rear of the leader) at the current time, or the maximum distance we can cover at the current time, e.g. as the result of a lane dropspeedLimit
- Speed; the local speed limitstepSize
- Duration; given step size, which can be longer or shorter than the provided step size in the algorithms.- Returns:
- Acceleration; the acceleration (or, if negative, deceleration) resulting from application of the GTU following model
-
getStepSize
public final org.djunits.value.vdouble.scalar.Duration getStepSize()Return the standard step size of this GTU following model.- Specified by:
getStepSize
in interfaceGtuFollowingModelOld
- Returns:
- Duration; the standard step size of the GTU following model
-
getMaximumSafeDeceleration
public final org.djunits.value.vdouble.scalar.Acceleration getMaximumSafeDeceleration()Return the maximum safe deceleration for use in gap acceptance models. This is the deceleration that may be enforced upon a new follower due to entering a road or changing into an adjacent lane. The result shall be a positive value. In most car following models this value is named b.- Specified by:
getMaximumSafeDeceleration
in interfaceGtuFollowingModelOld
- Returns:
- Acceleration; must be a positive value!
-
getName
Return the name of the car-following model.- Specified by:
getName
in interfaceCarFollowingModel
- Returns:
- name of the car-following model
-
getLongName
Return the complete name of the car-following model.- Specified by:
getLongName
in interfaceCarFollowingModel
- Returns:
- complete name of the car-following model
-
setA
public final void setA(org.djunits.value.vdouble.scalar.Acceleration a) Set value of acceleration parameter.- Specified by:
setA
in interfaceGtuFollowingModelOld
- Parameters:
a
- Acceleration; value to set
-
setT
public final void setT(org.djunits.value.vdouble.scalar.Duration t) Set value of desired headway.- Specified by:
setT
in interfaceGtuFollowingModelOld
- Parameters:
t
- Duration; desired headway
-
setFspeed
public final void setFspeed(double fSpeed) Set value of desired speed factor.- Specified by:
setFspeed
in interfaceGtuFollowingModelOld
- Parameters:
fSpeed
- double; desired speed factor
-
desiredSpeed
public final org.djunits.value.vdouble.scalar.Speed desiredSpeed(org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedInfo) throws org.opentrafficsim.base.parameters.ParameterException Determines the desired speed.- Specified by:
desiredSpeed
in interfaceDesiredSpeedModel
- Parameters:
parameters
- Parameters; parametersspeedInfo
- SpeedLimitInfo; info regarding the desired speed for car-following- Returns:
- desired speed
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- if parameter exception occurs
-
desiredHeadway
public final org.djunits.value.vdouble.scalar.Length desiredHeadway(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed) throws org.opentrafficsim.base.parameters.ParameterException Determines the desired headway in equilibrium conditions, i.e. no speed difference with the leader.- Specified by:
desiredHeadway
in interfaceDesiredHeadwayModel
- Parameters:
parameters
- Parameters; parametersspeed
- Speed; speed to determine the desired headway at- Returns:
- desired headway
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- if parameter exception occurs
-
followingAcceleration
public final org.djunits.value.vdouble.scalar.Acceleration followingAcceleration(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitInfo speedInfo, PerceptionIterable<? extends Headway> leaders) throws org.opentrafficsim.base.parameters.ParameterException Determination of car-following acceleration, possibly based on multiple leaders. The implementation should be able to deal with:
- The current speed being higher than the desired speed.
- The headway being negative.
- Specified by:
followingAcceleration
in interfaceCarFollowingModel
- Parameters:
parameters
- Parameters; parametersspeed
- Speed; current speedspeedInfo
- SpeedLimitInfo; info regarding the desired speed for car-followingleaders
- PerceptionIterable<? extends Headway>; set of leader headways and speeds, ordered by headway (closest first)- Returns:
- car-following acceleration
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- if parameter exception occurs
-
toString
-