Class FixedAccelerationModel
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.following.AbstractGTUFollowingModelMobil
-
- org.opentrafficsim.road.gtu.lane.tactical.following.FixedAccelerationModel
-
- All Implemented Interfaces:
Serializable
,CarFollowingModel
,DesiredHeadwayModel
,DesiredSpeedModel
,GTUFollowingModelOld
,Initialisable
public class FixedAccelerationModel extends AbstractGTUFollowingModelMobil implements Serializable
Fixed GTU following model. This GTU following model does not react in any way to other GTUs. Instead it has a predetermined acceleration for a predetermined duration.
Primary use is testing of lane based GTU 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: 1378 $, $LastChangedDate: 2015-09-03 13:38:01 +0200 (Thu, 03 Sep 2015) $, by $Author: averbraeck $,
initial version 6 feb. 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description FixedAccelerationModel(Acceleration acceleration, Duration duration)
Create a new FixedAccelerationModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Acceleration
computeAcceleration(Speed followerSpeed, Speed followerMaximumSpeed, Speed leaderSpeed, Length headway, Speed speedLimit)
Compute the acceleration that would be used to follow a leader.Acceleration
computeAcceleration(Speed followerSpeed, Speed followerMaximumSpeed, Speed leaderSpeed, Length headway, Speed speedLimit, Duration stepSize)
Compute the acceleration that would be used to follow a leader.Length
desiredHeadway(Parameters parameters, Speed speed)
Determines the desired headway in equilibrium conditions, i.e.Speed
desiredSpeed(Parameters parameters, SpeedLimitInfo speedInfo)
Determines the desired speed.Acceleration
followingAcceleration(Parameters parameters, Speed speed, SpeedLimitInfo speedInfo, PerceptionIterable<? extends Headway> leaders)
Determination of car-following acceleration, possibly based on multiple leaders.Acceleration
getAcceleration()
Retrieve the acceleration of this FixedAccelerationModel.Duration
getDuration()
Retrieve the duration of this FixedAccelerationModel.String
getLongName()
Return the complete name of the car-following model.Acceleration
getMaximumSafeDeceleration()
Return the maximum safe deceleration for use in gap acceptance models.String
getName()
Return the name of the car-following model.Duration
getStepSize()
Return the standard step size of this GTU following model.void
setA(Acceleration a)
Set value of acceleration parameter.void
setFspeed(double fSpeed)
Set value of desired speed factor.void
setT(Duration t)
Set value of desired headway.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 Detail
-
FixedAccelerationModel
public FixedAccelerationModel(Acceleration acceleration, Duration duration)
Create a new FixedAccelerationModel.- Parameters:
acceleration
- Acceleration; the acceleration that will be returned by the computeAcceleration methodsduration
- Duration; the duration that the acceleration will be maintained
-
-
Method Detail
-
getDuration
public final Duration getDuration()
Retrieve the duration of this FixedAccelerationModel.- Returns:
- Duration; the duration of this FixedAccelerationModel
-
getAcceleration
public final Acceleration getAcceleration()
Retrieve the acceleration of this FixedAccelerationModel.- Returns:
- Acceleration; the acceleration of this FixedAccelerationModel
-
computeAcceleration
public final Acceleration computeAcceleration(Speed followerSpeed, Speed followerMaximumSpeed, Speed leaderSpeed, Length headway, Speed speedLimit, 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
-
computeAcceleration
public final Acceleration computeAcceleration(Speed followerSpeed, Speed followerMaximumSpeed, Speed leaderSpeed, Length headway, 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
-
getMaximumSafeDeceleration
public final 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!
-
getStepSize
public final 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
-
getName
public final String getName()
Return the name of the car-following model.- Specified by:
getName
in interfaceCarFollowingModel
- Returns:
- name of the car-following model
-
getLongName
public final String 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(Acceleration a)
Set value of acceleration parameter.- Specified by:
setA
in interfaceGTUFollowingModelOld
- Parameters:
a
- Acceleration; value to set
-
setT
public final void setT(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 Speed desiredSpeed(Parameters parameters, SpeedLimitInfo speedInfo) throws 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:
ParameterException
- if parameter exception occurs
-
desiredHeadway
public final Length desiredHeadway(Parameters parameters, Speed speed) throws 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:
ParameterException
- if parameter exception occurs
-
followingAcceleration
public final Acceleration followingAcceleration(Parameters parameters, Speed speed, SpeedLimitInfo speedInfo, PerceptionIterable<? extends Headway> leaders) throws 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:
ParameterException
- if parameter exception occurs
-
-