Skip to content

Commit

Permalink
error handling in jupedsim
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Mar 25, 2024
1 parent dc4640a commit 0052c11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ MSPModel_JuPedSim::add(MSTransportable* person, MSStageMoving* stage, SUMOTime n
assert(person->getCurrentStageType() == MSStageType::WALKING);
Position departurePosition = Position::INVALID;
const MSLane* const departureLane = getSidewalk<MSEdge, MSLane>(stage->getRoute().front());
if (departureLane == nullptr) {
const char* error = TL("Person '%' could not find sidewalk on edge '%', time=%.");
if (OptionsCont::getOptions().getBool("ignore-route-errors")) {
WRITE_WARNINGF(error, person->getID(), person->getEdge()->getID(), time2string(SIMSTEP));
return nullptr;
} else {
throw ProcessError(TLF(error, person->getID(), person->getEdge()->getID(), time2string(SIMSTEP)));
}
}
// First real stage, stage 0 is waiting.
if (person->getCurrentStageIndex() == 2 && person->getParameter().departPosProcedure == DepartPosDefinition::RANDOM_LOCATION) {
const MSEdge* const tripOrigin = person->getNextStage(-1)->getEdge();
Expand Down

0 comments on commit 0052c11

Please sign in to comment.