Skip to content
Permalink
Browse files

can now cause lateral collision. refs #4864

  • Loading branch information...
namdre committed Nov 30, 2018
1 parent 2ac5735 commit 6ebf07489a07303cd11f39279fab27e5577d7e06
Showing with 14 additions and 2 deletions.
  1. +5 −0 src/microsim/MSVehicle.cpp
  2. +4 −0 src/microsim/MSVehicle.h
  3. +5 −2 src/microsim/lcmodels/MSLCM_SL2015.cpp
@@ -564,6 +564,11 @@ MSVehicle::Influencer::influenceChangeDecision(const SUMOTime currentTime, const
// flags for the current reason
LaneChangeMode mode = LC_NEVER;
if ((state & LCA_TRACI) != 0 && myLatDist != 0) {
// security checks
if ((myTraciLaneChangePriority == LCP_ALWAYS)
|| (myTraciLaneChangePriority == LCP_NOOVERLAP && (state & LCA_OVERLAPPING) == 0)) {
state &= ~(LCA_BLOCKED | LCA_OVERLAPPING);
}
// continue sublane change manoeuvre
return state;
} else if ((state & LCA_STRATEGIC) != 0) {
@@ -1554,6 +1554,10 @@ class MSVehicle : public MSBaseVehicle {
myLatDist = 0.;
}

bool ignoreOverlap() const {
return myTraciLaneChangePriority == LCP_ALWAYS;
}

SUMOAbstractRouter<MSEdge, SUMOVehicle>& getRouterTT() const;

private:
@@ -2044,16 +2044,19 @@ MSLCM_SL2015::checkBlocking(const MSLane& neighLane, double& latDist, double& ma
}
#endif
// if we can move at least a little bit in the desired direction, do so (rather than block)
const bool forcedTraCIChange = (myVehicle.hasInfluencer()
&& myVehicle.getInfluencer().getLatDist() != 0
&& myVehicle.getInfluencer().ignoreOverlap());
if (latDist < 0) {
if (mySafeLatDistRight <= NUMERICAL_EPS) {
return LCA_BLOCKED_RIGHT | LCA_OVERLAPPING;
} else {
} else if (!forcedTraCIChange) {
latDist = MAX2(latDist, -mySafeLatDistRight);
}
} else {
if (mySafeLatDistLeft <= NUMERICAL_EPS) {
return LCA_BLOCKED_LEFT | LCA_OVERLAPPING;
} else {
} else if (!forcedTraCIChange) {
latDist = MIN2(latDist, mySafeLatDistLeft);
}
}

0 comments on commit 6ebf074

Please sign in to comment.
You can’t perform that action at this time.