int Person::getStage(const std::string& personID, int nextStageIndex) { MSTransportable* p = getPerson(personID); if (nextStageIndex >= p->getNumRemainingStages()) { throw TraCIException("The stage index must be lower than the number of remaining stages."); } if (nextStageIndex < (p->getNumRemainingStages() - p->getNumStages())) { throw TraCIException("The negative stage index must refer to a valid previous stage."); } return p->getStageType(nextStageIndex); }
std::vector<std::string> Person::getEdges(const std::string& personID, int nextStageIndex) { MSTransportable* p = getPerson(personID); if (nextStageIndex >= p->getNumRemainingStages()) { throw TraCIException("The stage index must be lower than the number of remaining stages."); } if (nextStageIndex < (p->getNumRemainingStages() - p->getNumStages())) { throw TraCIException("The negative stage index must refer to a valid previous stage."); } std::vector<std::string> edgeIDs; for (auto& e : p->getEdges(nextStageIndex)) { if (e != nullptr) { edgeIDs.push_back(e->getID()); } } return edgeIDs; }