Skip to content

Commit

Permalink
Fixed problem loading flows/trips over TAZs due duplicated IDs. Refs #…
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Jun 27, 2023
1 parent 00626bd commit ca2df1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/netedit/elements/demand/GNERouteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,8 @@ GNERouteHandler::buildContainerPlan(SumoXMLTag tag, GNEDemandElement* containerP
bool
GNERouteHandler::isVehicleIdDuplicated(const std::string& id) {
// declare vehicle tags vector
std::vector<SumoXMLTag> vehicleTags = {SUMO_TAG_VEHICLE, GNE_TAG_VEHICLE_WITHROUTE, SUMO_TAG_TRIP, GNE_TAG_FLOW_ROUTE, GNE_TAG_FLOW_WITHROUTE, SUMO_TAG_FLOW};
const std::vector<SumoXMLTag> vehicleTags = {SUMO_TAG_VEHICLE, GNE_TAG_VEHICLE_WITHROUTE, SUMO_TAG_TRIP, GNE_TAG_TRIP_TAZS,
GNE_TAG_FLOW_ROUTE, GNE_TAG_FLOW_WITHROUTE, SUMO_TAG_FLOW, SUMO_TAG_FLOW, SUMO_TAG_FLOW, GNE_TAG_FLOW_JUNCTIONS};
for (const auto& vehicleTag : vehicleTags) {
if (!checkDuplicatedDemandElement(vehicleTag, id)) {
writeError(TLF("There is another % with the same ID='%'.", toString(vehicleTag), id));
Expand Down Expand Up @@ -2269,7 +2270,7 @@ GNERouteHandler::parseTAZ(const SumoXMLTag tag, const std::string& TAZID) {
GNEAdditional* TAZ = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_TAZ, TAZID, false);
// empty TAZs aren't allowed. If TAZ is empty, write error, clear TAZs and stop
if (TAZ == nullptr) {
writeError(TLF("Could not build % in netedit", toString(tag)) + std::string("; ") + TLF("% doesn't exist.", toString(SUMO_TAG_JUNCTION)));
writeError(TLF("Could not build % in netedit", toString(tag)) + std::string("; ") + TLF("% doesn't exist.", toString(SUMO_TAG_TAZ)));
}
return TAZ;
}
Expand Down

0 comments on commit ca2df1c

Please sign in to comment.