Skip to content

Commit

Permalink
fixing duarouter problems with parameterized plan items #14198
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jan 11, 2024
1 parent ac9a8a7 commit 39a468e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/router/ROPerson.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <string>
#include <iostream>
#include <utils/common/Parameterised.h>
#include <utils/common/StdDefs.h>
#include <utils/common/SUMOTime.h>
#include <utils/vehicle/SUMOVehicleParameter.h>
Expand Down Expand Up @@ -79,7 +80,7 @@ class ROPerson : public RORoutable {
* @brief Every person has a plan comprising of multiple planItems
*
*/
class PlanItem {
class PlanItem : public Parameterised {
public:
/// @brief Destructor
virtual ~PlanItem() {}
Expand Down
2 changes: 2 additions & 0 deletions src/router/RORouteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@ RORouteHandler::addPersonTrip(const SUMOSAXAttributes& attrs) {
const std::string originStopID = myActivePlan->empty() ? "" : myActivePlan->back()->getStopDest();
ROPerson::addTrip(*myActivePlan, myVehicleParameter->id, from, to, modeSet, types,
departPos, originStopID, arrivalPos, busStopID, walkFactor, group);
myParamStack.push_back(myActivePlan->back());
}
}

Expand Down Expand Up @@ -1333,6 +1334,7 @@ RORouteHandler::addWalk(const SUMOSAXAttributes& attrs) {
retrieveStoppingPlace(attrs, errorSuffix, stoppingPlaceID);
if (ok) {
ROPerson::addWalk(*myActivePlan, myActiveRoute, duration, speed, departPos, arrivalPos, stoppingPlaceID);
myParamStack.push_back(myActivePlan->back());
}
} else {
addPersonTrip(attrs);
Expand Down
4 changes: 3 additions & 1 deletion src/utils/vehicle/SUMORouteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ SUMORouteHandler::myEndElement(int element) {
break;
case SUMO_TAG_PERSONTRIP:
case SUMO_TAG_WALK:
myParamStack.pop_back();
if (myParamStack.size() == 2) {
myParamStack.pop_back();
}
break;
case SUMO_TAG_INTERVAL:
myBeginDefault = string2time(OptionsCont::getOptions().getString("begin"));
Expand Down

0 comments on commit 39a468e

Please sign in to comment.