Skip to content

Commit

Permalink
fix #4882
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Dec 7, 2018
1 parent f8decd8 commit 6d91d7c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ MSBaseVehicle::reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<M
for (std::vector<std::string>::const_iterator it = myParameter->via.begin(); it != myParameter->via.end(); ++it) {
MSEdge* viaEdge = MSEdge::dictionary(*it);
assert(viaEdge != 0);
if (viaEdge->allowedLanes(getVClass()) == nullptr) {
if (!viaEdge->isTazConnector() && viaEdge->allowedLanes(getVClass()) == nullptr) {
throw ProcessError("Vehicle '" + getID() + "' is not allowed on any lane of via edge '" + viaEdge->getID() + "'.");
}
stops.push_back(viaEdge);
Expand All @@ -192,6 +192,12 @@ MSBaseVehicle::reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<M
if (into.size() > 0) {
into.pop_back();
edges.insert(edges.end(), into.begin(), into.end());
if ((*s)->isTazConnector()) {
source = into.back();
edges.pop_back();
} else {
source = *s;
}
} else {
std::string error = "Vehicle '" + getID() + "' has no valid route from edge '" + source->getID() + "' to stop edge '" + (*s)->getID() + "'.";
if (MSGlobals::gCheckRoutes) {
Expand All @@ -200,8 +206,8 @@ MSBaseVehicle::reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<M
WRITE_WARNING(error);
edges.push_back(source);
}
source = *s;
}
source = *s;
}
}
router.compute(source, sink, this, t, edges);
Expand Down

0 comments on commit 6d91d7c

Please sign in to comment.