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
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.
Primary use is testing of lane based GTU movement.
 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:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- 
Field SummaryFields inherited from class org.opentrafficsim.road.gtu.lane.tactical.following.AbstractGtuFollowingModelMobilTOODANGEROUSFields inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModelCAR_FOLLOWING_MODEL
- 
Constructor SummaryConstructorsConstructorDescriptionFixedAccelerationModel(org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Duration duration) Create a new FixedAccelerationModel.
- 
Method SummaryModifier and TypeMethodDescriptionfinal org.djunits.value.vdouble.scalar.AccelerationcomputeAcceleration(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.AccelerationcomputeAcceleration(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.LengthdesiredHeadway(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed) Determines the desired headway in equilibrium conditions, i.e.final org.djunits.value.vdouble.scalar.SpeeddesiredSpeed(org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedInfo) Determines the desired speed.final org.djunits.value.vdouble.scalar.AccelerationfollowingAcceleration(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 org.djunits.value.vdouble.scalar.AccelerationRetrieve the acceleration of this FixedAccelerationModel.final org.djunits.value.vdouble.scalar.DurationRetrieve the duration of this FixedAccelerationModel.final StringReturn the complete name of the car-following model.final org.djunits.value.vdouble.scalar.AccelerationReturn the maximum safe deceleration for use in gap acceptance models.final StringgetName()Return the name of the car-following model.final org.djunits.value.vdouble.scalar.DurationReturn the standard step size of this GTU following model.final voidsetA(org.djunits.value.vdouble.scalar.Acceleration a) Set value of acceleration parameter.final voidsetFspeed(double fSpeed) Set value of desired speed factor.final voidsetT(org.djunits.value.vdouble.scalar.Duration t) Set value of desired headway.final StringtoString()Methods inherited from class org.opentrafficsim.road.gtu.lane.tactical.following.AbstractGtuFollowingModelMobilcomputeAccelerationStep, computeAccelerationStep, computeAccelerationStep, computeAccelerationStep, computeAccelerationStepWithNoLeader, computeAccelerationStepWithNoLeader, computeDualAccelerationStep, computeDualAccelerationStep, minimumHeadwayMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModelinit
- 
Constructor Details- 
FixedAccelerationModelpublic FixedAccelerationModel(org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Duration duration) Create a new FixedAccelerationModel.- Parameters:
- acceleration- Acceleration; the acceleration that will be returned by the computeAcceleration methods
- duration- Duration; the duration that the acceleration will be maintained
 
 
- 
- 
Method Details- 
getDurationpublic final org.djunits.value.vdouble.scalar.Duration getDuration()Retrieve the duration of this FixedAccelerationModel.- Returns:
- Duration; the duration of this FixedAccelerationModel
 
- 
getAccelerationpublic final org.djunits.value.vdouble.scalar.Acceleration getAcceleration()Retrieve the acceleration of this FixedAccelerationModel.- Returns:
- Acceleration; the acceleration of this FixedAccelerationModel
 
- 
computeAccelerationpublic 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:
- computeAccelerationin interface- GtuFollowingModelOld
- Parameters:
- followerSpeed- Speed; the speed of the follower at the current time
- followerMaximumSpeed- Speed; the maximum speed that the follower is capable of driving at
- leaderSpeed- Speed; the speed of the follower at the current time
- headway- 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 drop
- speedLimit- Speed; the local speed limit
- stepSize- 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
 
- 
computeAccelerationpublic 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:
- computeAccelerationin interface- GtuFollowingModelOld
- Parameters:
- followerSpeed- Speed; the speed of the follower at the current time
- followerMaximumSpeed- Speed; the maximum speed that the follower is capable of driving at
- leaderSpeed- Speed; the speed of the follower at the current time
- headway- 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 drop
- speedLimit- Speed; the local speed limit
- Returns:
- Acceleration; the acceleration (or, if negative, deceleration) resulting from application of the GTU following model
 
- 
getMaximumSafeDecelerationpublic 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:
- getMaximumSafeDecelerationin interface- GtuFollowingModelOld
- Returns:
- Acceleration; must be a positive value!
 
- 
getStepSizepublic final org.djunits.value.vdouble.scalar.Duration getStepSize()Return the standard step size of this GTU following model.- Specified by:
- getStepSizein interface- GtuFollowingModelOld
- Returns:
- Duration; the standard step size of the GTU following model
 
- 
getNameReturn the name of the car-following model.- Specified by:
- getNamein interface- CarFollowingModel
- Returns:
- name of the car-following model
 
- 
getLongNameReturn the complete name of the car-following model.- Specified by:
- getLongNamein interface- CarFollowingModel
- Returns:
- complete name of the car-following model
 
- 
toString
- 
setApublic final void setA(org.djunits.value.vdouble.scalar.Acceleration a) Set value of acceleration parameter.- Specified by:
- setAin interface- GtuFollowingModelOld
- Parameters:
- a- Acceleration; value to set
 
- 
setTpublic final void setT(org.djunits.value.vdouble.scalar.Duration t) Set value of desired headway.- Specified by:
- setTin interface- GtuFollowingModelOld
- Parameters:
- t- Duration; desired headway
 
- 
setFspeedpublic final void setFspeed(double fSpeed) Set value of desired speed factor.- Specified by:
- setFspeedin interface- GtuFollowingModelOld
- Parameters:
- fSpeed- double; desired speed factor
 
- 
desiredSpeedpublic 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:
- desiredSpeedin interface- DesiredSpeedModel
- Parameters:
- parameters- Parameters; parameters
- speedInfo- SpeedLimitInfo; info regarding the desired speed for car-following
- Returns:
- desired speed
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if parameter exception occurs
 
- 
desiredHeadwaypublic 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:
- desiredHeadwayin interface- DesiredHeadwayModel
- Parameters:
- parameters- Parameters; parameters
- speed- Speed; speed to determine the desired headway at
- Returns:
- desired headway
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if parameter exception occurs
 
- 
followingAccelerationpublic 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:
- followingAccelerationin interface- CarFollowingModel
- Parameters:
- parameters- Parameters; parameters
- speed- Speed; current speed
- speedInfo- SpeedLimitInfo; info regarding the desired speed for car-following
- leaders- 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
 
 
-