Skip to content

Commit

Permalink
fix #14475
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 6, 2024
1 parent 856eca5 commit 65bceb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/microsim/MSLaneChanger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,10 @@ MSLaneChanger::computeSafeOppositeLength(MSVehicle* vehicle, double oppositeLeng
const MSVehicle* oncomingVeh = oncoming.first;
if (oncomingVeh != 0) {
if (!oncomingVeh->getLaneChangeModel().isOpposite() && oncomingVeh->getLaneChangeModel().getShadowLane() != source) {
const double egoSpeedFraction = MIN2(0.5, vMax / (vMax + oncomingSpeed));
double egoSpeedFraction = 0.5;
if (oncomingSpeed > 0) {
egoSpeedFraction = MIN2(egoSpeedFraction, vMax / (vMax + oncomingSpeed));
}
oppositeLength = MIN2(oppositeLength, forwardPos + oncoming.second * egoSpeedFraction);
#ifdef DEBUG_CHANGE_OPPOSITE
if (DEBUG_COND) {
Expand Down

0 comments on commit 65bceb0

Please sign in to comment.