Skip to content

Commit

Permalink
checking stop positions against departPos, refs #1056
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@15206 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
behrisch committed Nov 22, 2013
1 parent 732b0e9 commit b97445d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sumo/src/microsim/MSVehicle.cpp
Expand Up @@ -677,6 +677,21 @@ MSVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffs
if (myCurrEdge == stop.edge && myState.myPos > stop.endPos - getCarFollowModel().brakeGap(myState.mySpeed)) {
return false;
}
if (!hasDeparted() && myCurrEdge == stop.edge) {
SUMOReal pos = -1;
if (myParameter->departPosProcedure == DEPART_POS_GIVEN) {
pos = myParameter->departPos;
if (pos < 0.) {
pos += (*myCurrEdge)->getLength();
}
}
if (myParameter->departPosProcedure == DEPART_POS_BASE || myParameter->departPosProcedure == DEPART_POS_DEFAULT) {
pos = MIN2(static_cast<SUMOReal>(getVehicleType().getLength() + POSITION_EPS), (*myCurrEdge)->getLength());
}
if (pos > stop.endPos) {
return false;
}
}
myStops.insert(iter, stop);
return true;
}
Expand Down

0 comments on commit b97445d

Please sign in to comment.