Skip to content

Commit

Permalink
fix #4566
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Sep 11, 2018
1 parent 594657c commit c9e8a15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/microsim/MSLaneChanger.cpp
Expand Up @@ -1288,6 +1288,7 @@ MSLaneChanger::changeOpposite(std::pair<MSVehicle*, double> leader) {
}
std::pair<MSVehicle* const, double> neighFollow = opposite->getOppositeFollower(vehicle);
int state = checkChange(direction, opposite, leader, neighLead, neighFollow, preb);
//vehicle->getLaneChangeModel().setOwnState(state);

bool changingAllowed = (state & LCA_BLOCKED) == 0;
// change if the vehicle wants to and is allowed to change
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/lcmodels/MSLCM_LC2013.cpp
Expand Up @@ -1479,7 +1479,7 @@ MSLCM_LC2013::_wantsChange(

if (amBlockingFollowerPlusNB()
&& (!speedGainInconvenient)
//&& ((myOwnState & myLca) != 0) // VARIANT_6 : counterNoHelp
&& ((myOwnState & myLca) != 0) // VARIANT_6 : counterNoHelp
&& (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) {

// VARIANT_2 (nbWhenChangingToHelp)
Expand Down
6 changes: 4 additions & 2 deletions src/microsim/lcmodels/MSLCM_SL2015.cpp
Expand Up @@ -1289,14 +1289,16 @@ MSLCM_SL2015::_wantsChangeSublane(
? -mySpeedGainProbabilityRight / myChangeProbThresholdRight
: -mySpeedGainProbabilityLeft / myChangeProbThresholdLeft);
if (laneOffset != 0
&& (amBlockingFollowerPlusNB() ||
&& ((amBlockingFollowerPlusNB()
// VARIANT_6 : counterNoHelp
&& ((myOwnState & myLca) != 0))
||
// continue previous cooperative change
((myPreviousState & LCA_COOPERATIVE) != 0
&& !myCanChangeFully
// change is in the right direction
&& (laneOffset * myManeuverDist > 0)))
&& (inconvenience < myCooperativeParam)
//&& ((myOwnState & myLca) != 0) // VARIANT_6 : counterNoHelp
&& (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) {

// VARIANT_2 (nbWhenChangingToHelp)
Expand Down

0 comments on commit c9e8a15

Please sign in to comment.