Interface Synchronization
- All Superinterfaces:
LmrsParameters,NamedConstants
Different forms of synchronization.
Copyright (c) 2013-2026 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, Wouter Schakel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SynchronizationSynchronization where a suitable leader is actively targeted, in relation to infrastructure.static final SynchronizationSynchronization by following the adjacent leader or aligning with the middle of the gap, whichever allows the largest acceleration.static final SynchronizationSynchronization where current leaders are taken.static final SynchronizationSynchronization where current leaders are taken. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanBeAhead(TacticalContextEgo context, PerceivedGtu adjacentVehicle, org.djunits.value.vdouble.scalar.Length xCur, int nCur, org.djunits.value.vdouble.scalar.Speed tagSpeed, double dCoop, org.djunits.value.vdouble.scalar.Acceleration b, org.djunits.value.vdouble.scalar.Duration tMin, org.djunits.value.vdouble.scalar.Duration tMax, org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Duration t0, org.djunits.value.vdouble.scalar.Duration lc, double desire) Returns whether a driver estimates it can be ahead of an adjacent vehicle for merging.static org.djunits.value.vdouble.scalar.AccelerationgentleUrgency(org.djunits.value.vdouble.scalar.Acceleration a, double desire, Parameters params) Return limited deceleration.static PerceivedGtugetFollower(PerceivedGtu gtu, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, PerceivedGtu follower, org.djunits.value.vdouble.scalar.Length ownLength) Returns the upstream gtu of the given gtu.static org.djunits.value.vdouble.scalar.LengthgetMergeDistance(LanePerception perception, LateralDirectionality lat) Returns the distance to the next merge, stopping within this distance is futile for a lane change.static PerceivedGtugetTargetLeader(PerceivedGtu gtu, SortedSet<PerceivedGtu> leaders) Returns the leader of one gtu from a set.static org.djunits.value.vdouble.scalar.LengthrequiredBufferSpace(org.djunits.value.vdouble.scalar.Speed speed, int nCur, org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Duration t0, org.djunits.value.vdouble.scalar.Duration lc, double dCoop) Returns the required buffer space to perform a lane change and further lane changes.static org.djunits.value.vdouble.scalar.AccelerationstopForEnd(TacticalContextEgo context, org.djunits.value.vdouble.scalar.Length xCur, org.djunits.value.vdouble.scalar.Length xMerge) Calculates acceleration to stop for a split or dead-end, accounting for infrastructure.org.djunits.value.vdouble.scalar.Accelerationsynchronize(TacticalContextEgo context, double desire, LateralDirectionality lat, LmrsData lmrsData, LateralDirectionality initiatedLaneChange) Determine acceleration for synchronization.static org.djunits.value.vdouble.scalar.AccelerationtagAlongAcceleration(TacticalContextEgo context, PerceivedGtu leader, org.djunits.value.vdouble.scalar.Speed tagSpeed, double desire) Calculates acceleration by following an adjacent vehicle, with tagging along if desire is not very high and speed is low.Methods inherited from interface org.opentrafficsim.base.NamedConstants
name
-
Field Details
-
PASSIVE
Synchronization where current leaders are taken. -
ALIGN_GAP
Synchronization by following the adjacent leader or aligning with the middle of the gap, whichever allows the largest acceleration. Note that aligning with the middle of the gap then means the gap is too small, as following would cause lower acceleration. Aligning with the middle of the gap will however provide a better starting point for the rest of the process. Mainly, the adjacent follower can decelerate less, allowing more smooth merging. -
PASSIVE_MOVING
Synchronization where current leaders are taken. Synchronization is disabled for d_sync<d<d_coop at low speeds. -
ACTIVE
Synchronization where a suitable leader is actively targeted, in relation to infrastructure.
-
-
Method Details
-
getMergeDistance
static org.djunits.value.vdouble.scalar.Length getMergeDistance(LanePerception perception, LateralDirectionality lat) throws OperationalPlanException Returns the distance to the next merge, stopping within this distance is futile for a lane change.- Parameters:
perception- perceptionlat- lateral direction- Returns:
- distance to the next merge
- Throws:
OperationalPlanException- if there is no infrastructure perception
-
synchronize
org.djunits.value.vdouble.scalar.Acceleration synchronize(TacticalContextEgo context, double desire, LateralDirectionality lat, LmrsData lmrsData, LateralDirectionality initiatedLaneChange) throws ParameterException, OperationalPlanException Determine acceleration for synchronization.- Parameters:
context- tactical information such as parameters and car-following modeldesire- level of lane change desirelat- lateral direction for synchronizationlmrsData- LMRS datainitiatedLaneChange- lateral direction of initiated lane change- Returns:
- acceleration for synchronization
- Throws:
ParameterException- if a parameter is not definedOperationalPlanException- perception exception
-
gentleUrgency
static org.djunits.value.vdouble.scalar.Acceleration gentleUrgency(org.djunits.value.vdouble.scalar.Acceleration a, double desire, Parameters params) throws ParameterException Return limited deceleration. Deceleration is limited tobford < dCoop. BeyonddCoopthe limit is a linear interpolation betweenbandbCrit.- Parameters:
a- acceleration to limitdesire- lane change desireparams- parameters- Returns:
- limited deceleration
- Throws:
ParameterException- when parameter is no available or value out of range
-
getFollower
static PerceivedGtu getFollower(PerceivedGtu gtu, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, PerceivedGtu follower, org.djunits.value.vdouble.scalar.Length ownLength) Returns the upstream gtu of the given gtu.- Parameters:
gtu- gtuleaders- leaders of own vehiclefollower- following vehicle of own vehicleownLength- own vehicle length- Returns:
- upstream gtu of the given gtu
-
tagAlongAcceleration
static org.djunits.value.vdouble.scalar.Acceleration tagAlongAcceleration(TacticalContextEgo context, PerceivedGtu leader, org.djunits.value.vdouble.scalar.Speed tagSpeed, double desire) throws ParameterException Calculates acceleration by following an adjacent vehicle, with tagging along if desire is not very high and speed is low.- Parameters:
context- tactical information such as parameters and car-following modelleader- leadertagSpeed- maximum tag along speeddesire- lane change desire- Returns:
- acceleration by following an adjacent vehicle including tagging along
- Throws:
ParameterException- if a parameter is not present
-
canBeAhead
static boolean canBeAhead(TacticalContextEgo context, PerceivedGtu adjacentVehicle, org.djunits.value.vdouble.scalar.Length xCur, int nCur, org.djunits.value.vdouble.scalar.Speed tagSpeed, double dCoop, org.djunits.value.vdouble.scalar.Acceleration b, org.djunits.value.vdouble.scalar.Duration tMin, org.djunits.value.vdouble.scalar.Duration tMax, org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Duration t0, org.djunits.value.vdouble.scalar.Duration lc, double desire) throws ParameterException Returns whether a driver estimates it can be ahead of an adjacent vehicle for merging.- Parameters:
context- tactical information such as parameters and car-following modeladjacentVehicle- adjacent vehiclexCur- remaining distancenCur- number of lane changes to performtagSpeed- maximum tag along speeddCoop- cooperation thresholdb- critical decelerationtMin- minimum headwaytMax- normal headwayx0- anticipation distancet0- anticipation timelc- lane change durationdesire- lane change desire- Returns:
- whether a driver estimates it can be ahead of an adjacent vehicle for merging
- Throws:
ParameterException- if parameter is not defined
-
requiredBufferSpace
static org.djunits.value.vdouble.scalar.Length requiredBufferSpace(org.djunits.value.vdouble.scalar.Speed speed, int nCur, org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Duration t0, org.djunits.value.vdouble.scalar.Duration lc, double dCoop) Returns the required buffer space to perform a lane change and further lane changes.- Parameters:
speed- representative speednCur- number of required lane changesx0- anticipation distancet0- anticipation timelc- lane change durationdCoop- cooperation threshold- Returns:
- required buffer space to perform a lane change and further lane changes
-
stopForEnd
static org.djunits.value.vdouble.scalar.Acceleration stopForEnd(TacticalContextEgo context, org.djunits.value.vdouble.scalar.Length xCur, org.djunits.value.vdouble.scalar.Length xMerge) throws ParameterException Calculates acceleration to stop for a split or dead-end, accounting for infrastructure.- Parameters:
context- tactical information such as parameters and car-following modelxCur- remaining distance to endxMerge- distance until merge point- Returns:
- acceleration to stop for a split or dead-end, accounting for infrastructure
- Throws:
ParameterException- if parameter is not defined
-
getTargetLeader
Returns the leader of one gtu from a set.- Parameters:
gtu- gtuleaders- leaders- Returns:
- leader of one gtu from a set
-