Skip to content

Commit

Permalink
Fixed #3770
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo committed Jan 18, 2018
1 parent 43db3d9 commit 13f83f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,12 @@ MSAbstractLaneChangeModel::getShadowLane(const MSLane* lane, double posLat) cons
if (debugVehicle()) {
std::cout << SIMTIME << " veh=" << myVehicle.getID() << " posLat=" << posLat << " overlap=" << overlap << "\n";
}
if (overlap > NUMERICAL_EPS ||
// "reserve" target lane even when there is no overlap yet
(isChangingLanes() && myLaneChangeCompletion < 0.5)) {
if (overlap > NUMERICAL_EPS) {
const int shadowDirection = posLat < 0 ? -1 : 1;
return lane->getParallelLane(shadowDirection);
} else if (isChangingLanes() && myLaneChangeCompletion < 0.5) {
// "reserve" target lane even when there is no overlap yet
return lane->getParallelLane(myLaneChangeDirection);
} else {
return 0;
}
Expand Down

0 comments on commit 13f83f5

Please sign in to comment.