70 myAllowUndoRedo(allowUndoRedo),
71 myOverwrite(overwrite) {
84 if (parentPlanElement->getChildDemandElements().empty()) {
90 parentPlanElement->decRef(
"postParserTasks");
120 if (distributionParent) {
139 vType->
incRef(
"buildVType");
152 if (distribution ==
nullptr) {
154 }
else if (vType ==
nullptr) {
165 distribution->addChildElement(vTypeRef);
166 vType->addChildElement(vTypeRef);
167 vTypeRef->
incRef(
"buildVTypeRef");
191 vTypeDistribution->
incRef(
"buildVTypeDistribution");
200 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
224 if (distributionParent) {
225 routeRef =
new GNERouteRef(distributionParent, route, probability);
227 WRITE_WARNING(
TLF(
"Route '%' with probability % cannot be referenced with distribution '%'",
id,
toString(probability), routeDistributionID));
239 for (
const auto& edge : edges) {
240 edge->addChildElement(route);
246 route->
incRef(
"buildRoute");
260 if (distribution ==
nullptr) {
262 }
else if (route ==
nullptr) {
273 distribution->addChildElement(routeRef);
274 route->addChildElement(routeRef);
275 routeRef->
incRef(
"buildRouteRef");
299 routeDistribution->
incRef(
"buildRouteDistribution");
318 if (type ==
nullptr) {
320 }
else if (route ==
nullptr) {
338 vehicle->
incRef(
"buildVehicleOverRoute");
348 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
364 if (type ==
nullptr) {
385 for (
const auto& edge : edges) {
386 edge->addChildElement(route);
388 vehicle->
incRef(
"buildVehicleEmbeddedRoute");
389 route->
incRef(
"buildVehicleEmbeddedRoute");
410 if (type ==
nullptr) {
412 }
else if (route ==
nullptr) {
430 flow->
incRef(
"buildFlowOverRoute");
440 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
456 if (type ==
nullptr) {
477 for (
const auto& edge : edges) {
478 edge->addChildElement(route);
480 vehicle->
incRef(
"buildFlowEmbeddedRoute");
481 route->
incRef(
"buildFlowEmbeddedRoute");
492 const std::string& fromEdgeID,
const std::string& toEdgeID) {
507 if (!fromEdge || !toEdge) {
512 if (type ==
nullptr) {
531 trip->
incRef(
"buildTrip");
533 fromEdge->addChildElement(trip);
534 toEdge->addChildElement(trip);
545 const std::string& fromJunctionID,
const std::string& toJunctionID) {
556 if (!fromJunction || !toJunction) {
561 if (type ==
nullptr) {
578 flow->
incRef(
"buildFlow");
580 fromJunction->addChildElement(flow);
581 toJunction->addChildElement(flow);
592 const std::string& fromTAZID,
const std::string& toTAZID) {
603 if (!fromTAZ || !toTAZ) {
608 if (type ==
nullptr) {
625 flow->
incRef(
"buildFlow");
627 fromTAZ->addChildElement(flow);
628 toTAZ->addChildElement(flow);
639 const std::string& fromEdgeID,
const std::string& toEdgeID) {
654 if (!fromEdge || !toEdge) {
659 if (type ==
nullptr) {
678 flow->
incRef(
"buildFlow");
680 fromEdge->addChildElement(flow);
681 toEdge->addChildElement(flow);
692 const std::string& fromJunctionID,
const std::string& toJunctionID) {
703 if (!fromJunction || !toJunction) {
708 if (type ==
nullptr) {
725 flow->
incRef(
"buildFlow");
727 fromJunction->addChildElement(flow);
728 toJunction->addChildElement(flow);
739 const std::string& fromTAZID,
const std::string& toTAZID) {
750 if (!fromTAZ || !toTAZ) {
755 if (type ==
nullptr) {
772 flow->
incRef(
"buildFlow");
774 fromTAZ->addChildElement(flow);
775 toTAZ->addChildElement(flow);
795 if (type ==
nullptr) {
808 person->
incRef(
"buildPerson");
829 if (type ==
nullptr) {
842 personFlow->
incRef(
"buildPersonFlow");
854 const double arrivalPos,
const std::vector<std::string>& types,
const std::vector<std::string>& modes,
855 const std::vector<std::string>& lines,
const double walkFactor,
const std::string& group) {
861 if (personParent ==
nullptr) {
864 return writeError(
TL(
"invalid combination for personTrip"));
865 }
else if (planParents.
checkIntegrity(personTripTag, personParent, planParameters)) {
868 arrivalPos, types, modes, lines, walkFactor, group);
879 personTrip->
incRef(
"buildPersonTrip");
890 const double arrivalPos,
const double speed,
const SUMOTime duration) {
893 const auto walkTag = planParameters.
getWalkTag();
896 if (personParent ==
nullptr) {
899 return writeError(
TL(
"invalid combination for personTrip"));
904 }
else if (planParents.
checkIntegrity(walkTag, personParent, planParameters)) {
917 walk->
incRef(
"buildWalk");
928 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
931 const auto rideTag = planParameters.
getRideTag();
934 if (personParent ==
nullptr) {
938 }
else if (planParents.
checkIntegrity(rideTag, personParent, planParameters)) {
951 ride->
incRef(
"buildRide");
971 if (type ==
nullptr) {
984 container->
incRef(
"buildContainer");
1005 if (type ==
nullptr) {
1006 return writeError(
TLF(
"Invalid vehicle type '%' used in % '%'.", containerFlowParameters.
vtypeid,
toString(containerFlowParameters.
tag), containerFlowParameters.
id));
1018 containerFlow->
incRef(
"buildContainerFlow");
1030 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
1036 if (containerParent ==
nullptr) {
1039 return writeError(
TL(
"invalid combination for personTrip"));
1040 }
else if (planParents.
checkIntegrity(transportTag, containerParent, planParameters)) {
1053 transport->
incRef(
"buildTransport");
1064 const double arrivalPosition,
const double departPosition,
const double speed,
const SUMOTime duration) {
1070 if (containerParent ==
nullptr) {
1073 return writeError(
TL(
"invalid combination for personTrip"));
1078 }
else if (planParents.
checkIntegrity(transhipTag, containerParent, planParameters)) {
1081 departPosition, arrivalPosition, speed, duration);
1092 tranship->
incRef(
"buildTranship");
1104 const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
1110 if (personParent ==
nullptr) {
1113 return writeError(
TL(
"invalid combination for person stop"));
1114 }
else if (planParents.
checkIntegrity(personStopTag, personParent, planParameters)) {
1117 endPos, duration, until, actType, friendlyPos, parameterSet);
1128 stopPlan->
incRef(
"buildPersonStop");
1139 const double endPos,
const SUMOTime duration,
1140 const SUMOTime until,
const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
1146 if (containerParent ==
nullptr) {
1149 return writeError(
TL(
"invalid combination for containerStop"));
1150 }
else if (planParents.
checkIntegrity(containerStopTag, containerParent, planParameters)) {
1153 endPos, duration, until, actType, friendlyPos, parameterSet);
1164 stopPlan->
incRef(
"buildContainerStop");
1179 if (objParent ==
nullptr) {
1209 bool waypoint =
false;
1221 if (stopParameters.
busstop.size() > 0) {
1225 if (stoppingPlace ==
nullptr) {
1231 return writeError(
TL(
"Containers don't support stops at busStops or trainStops"));
1238 return writeError(
TL(
"Persons don't support stops at containerStops"));
1245 return writeError(
TL(
"Persons don't support stops at chargingStations"));
1247 return writeError(
TL(
"Containers don't support stops at chargingStations"));
1249 }
else if (stopParameters.
parkingarea.size() > 0) {
1254 return writeError(
TL(
"Persons don't support stops at parkingAreas"));
1256 return writeError(
TL(
"Containers don't support stops at parkingAreas"));
1258 }
else if (stopParameters.
lane.size() > 0) {
1261 }
else if (stopParameters.
edge.size() > 0) {
1265 return writeError(
TL(
"vehicles don't support stops at edges"));
1274 if (stoppingPlace && lane && edge) {
1275 return writeError(
TL(
"A stop must be defined either over a stoppingPlace, a edge or a lane"));
1276 }
else if (!stoppingPlace && !lane && !edge) {
1277 return writeError(
TL(
"A stop requires only a stoppingPlace, edge or lane"));
1278 }
else if (stoppingPlace) {
1290 stop =
new GNEStop(stopTagType, stopParent, stoppingPlace, stopParameters);
1301 stop->
incRef(
"buildStoppingPlaceStop");
1316 stop->
incRef(
"buildLaneStop");
1332 const bool centerAfterCreation) {
1334 if (personParent ==
nullptr) {
1348 std::vector<std::string>();
1351 std::vector<std::string>();
1354 std::vector<std::string>();
1383 int parameterSet = 0;
1401 delete personPlanObject;
1409 const bool centerAfterCreation) {
1411 if (containerParent ==
nullptr) {
1428 std::vector<std::string>();
1456 int parameterSet = 0;
1474 delete containerPlanObject;
1488 planObject->
setTag(tagProperty->getTag());
1492 if (tagProperty->planFromEdge()) {
1495 if (tagProperty->planToEdge()) {
1498 if (tagProperty->planFromJunction()) {
1501 if (tagProperty->planToJunction()) {
1504 if (tagProperty->planFromTAZ()) {
1507 if (tagProperty->planToTAZ()) {
1510 if (tagProperty->planFromBusStop()) {
1513 if (tagProperty->planToBusStop()) {
1516 if (tagProperty->planFromTrainStop()) {
1519 if (tagProperty->planToTrainStop()) {
1522 if (tagProperty->planFromContainerStop()) {
1525 if (tagProperty->planToContainerStop()) {
1529 if (tagProperty->planEdge()) {
1532 if (tagProperty->planBusStop()) {
1535 if (tagProperty->planTrainStop()) {
1538 if (tagProperty->planContainerStop()) {
1542 if (tagProperty->planRoute()) {
1546 if (tagProperty->planConsecutiveEdges()) {
1558 for (
const auto& attrProperty : tagProperty->getAttributeProperties()) {
1560 if (attrProperty->isFloat()) {
1561 if (!originalPlan->
getAttribute(attrProperty->getAttr()).empty()) {
1564 }
else if (attrProperty->isSUMOTime()) {
1565 if (!originalPlan->
getAttribute(attrProperty->getAttr()).empty()) {
1566 planObject->
addTimeAttribute(attrProperty->getAttr(), GNEAttributeCarrier::parse<SUMOTime>(originalPlan->
getAttribute(attrProperty->getAttr())));
1568 }
else if (attrProperty->isBool()) {
1569 planObject->
addBoolAttribute(attrProperty->getAttr(), GNEAttributeCarrier::parse<bool>(originalPlan->
getAttribute(attrProperty->getAttr())));
1570 }
else if (attrProperty->isList()) {
1571 planObject->
addStringListAttribute(attrProperty->getAttr(), GNEAttributeCarrier::parse<std::vector<std::string> >(originalPlan->
getAttribute(attrProperty->getAttr())));
1578 if (tagProperty->isPlanPersonTrip()) {
1586 }
else if (tagProperty->isPlanWalk()) {
1591 }
else if (tagProperty->isPlanRide()) {
1596 }
else if (tagProperty->isPlanStopPerson()) {
1598 int parameterSet = 0;
1612 }
else if (tagProperty->isPlanTransport()) {
1617 }
else if (tagProperty->isPlanTranship()) {
1623 }
else if (tagProperty->isPlanStopContainer()) {
1625 int parameterSet = 0;
1647 for (
const auto& edgeID : via) {
1668 const auto vClass = originalVehicle->
getVClass();
1672 std::vector<GNEEdge*> routeEdges;
1687 std::vector<std::string> edgeIDs;
1688 for (
const auto& edge : routeEdges) {
1689 edgeIDs.push_back(edge->getID());
1692 if (routeEdges.empty()) {
1694 const std::string header =
"Problem transforming to vehicle";
1696 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1698 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1705 if (createEmbeddedRoute) {
1716 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor, 0, 0, 0, {});
1718 vehicleParameters.
routeid = routeID;
1725 if (inspectAfterTransform) {
1747 const auto vClass = originalVehicle->
getVClass();
1751 std::vector<GNEEdge*> routeEdges;
1766 std::vector<std::string> edgeIDs;
1767 for (
const auto& edge : routeEdges) {
1768 edgeIDs.push_back(edge->getID());
1771 if (routeEdges.empty()) {
1773 const std::string header =
"Problem transforming to vehicle";
1775 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1777 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1796 if (createEmbeddedRoute) {
1807 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor, 0, 0, 0, {});
1809 vehicleParameters.
routeid = routeID;
1816 if (inspectAfterTransform) {
1840 std::vector<GNEEdge*> edges;
1855 if (edges.size() < 2) {
1857 const std::string header =
"Problem transforming to vehicle";
1859 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1861 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1874 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1878 if (inspectAfterTransform) {
1902 std::vector<GNEEdge*> edges;
1917 if (edges.empty()) {
1919 const std::string header =
"Problem transforming to vehicle";
1921 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1923 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1948 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1952 if (inspectAfterTransform) {
1967 const std::string header =
"Problem transforming to trip over junctions";
1969 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
1971 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1993 if (inspectAfterTransform) {
2008 const std::string header =
"Problem transforming to flow over junctions";
2010 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
2012 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
2043 if (inspectAfterTransform) {
2058 const std::string header =
"Problem transforming to trip over TAZs";
2060 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
2062 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
2084 if (inspectAfterTransform) {
2099 const std::string header =
"Problem transforming to flow over TAZs";
2101 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
2103 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
2134 if (inspectAfterTransform) {
2156 const auto ID = personParameters.
id;
2158 personParameters.
id =
"%dummyID%";
2162 routeHandler.
buildPerson(
nullptr, personParameters);
2175 if (inspectAfterTransform) {
2195 const auto ID = personParameters.
id;
2197 personParameters.
id =
"%dummyID%";
2204 for (
const auto& personPlan : personPlans) {
2217 if (inspectAfterTransform) {
2237 const auto ID = containerParameters.
id;
2239 containerParameters.
id =
"%dummyID%";
2245 for (
const auto& containerPlan : containerPlans) {
2256 if (inspectAfterTransform) {
2276 const auto ID = containerParameters.
id;
2278 containerParameters.
id =
"%dummyID%";
2284 for (
const auto& containerPlan : containerPlans) {
2298 if (inspectAfterTransform) {
2328 if (edges.empty()) {
2332 std::vector<GNEEdge*> reverseEdges;
2333 for (
const auto& edge : edges) {
2334 const auto oppositeEdges = edge->getOppositeEdges();
2336 if (oppositeEdges.empty()) {
2339 reverseEdges.push_back(oppositeEdges.front());
2343 std::reverse(reverseEdges.begin(), reverseEdges.end());
2377 std::vector<GNEEdge*> oppositeEdges;
2379 oppositeEdges.push_back(edge->getOppositeEdges().front());
2381 std::reverse(oppositeEdges.begin(), oppositeEdges.end());
2389 oppositeEdges.erase(oppositeEdges.begin());
2390 oppositeEdges.pop_back();
2391 if (oppositeEdges.size() > 0) {
2421 if (junction ==
nullptr) {
2432 if (
TAZ ==
nullptr) {
2442 const bool firstEdge) {
2444 if (edgeID.empty()) {
2462 if (edge ==
nullptr) {
2478 if (busStop !=
nullptr) {
2480 }
else if (trainStop !=
nullptr) {
2481 return trainStop->getParentLanes().front()->getParentEdge();
2488 if (busStop !=
nullptr) {
2490 }
else if (trainStop !=
nullptr) {
2491 return trainStop->getParentLanes().front()->getParentEdge();
2497 if (containerStop !=
nullptr) {
2505 if (containerStop !=
nullptr) {
2513 if (parkingArea !=
nullptr) {
2526 std::string edgeID = laneID;
2527 for (
int i = ((
int)laneID.size() - 1); (i >= 0) && (laneID[i + 1] !=
'_'); i--) {
2534std::vector<GNEEdge*>
2536 std::vector<GNEEdge*> edges;
2537 for (
const auto& edgeID : edgeIDs) {
2540 if (edge ==
nullptr) {
2545 edges.push_back(edge);
2555 if (type ==
nullptr) {
2576 if (personParent ==
nullptr) {
2579 return personParent;
2597 if (containerParent ==
nullptr) {
2600 return containerParent;
2633 const std::vector<std::string>& distributionElementIDs,
const std::vector<double>& probabilities,
2634 std::vector<const GNEDemandElement*>& elements) {
2636 std::string distributionTag =
toString(sumoBaseObject->
getTag());
2639 for (
const auto& distributionElementID : distributionElementIDs) {
2641 if (distributionElement) {
2642 elements.push_back(distributionElement);
2644 return writeError(
TLF(
"% with id '%' doesn't exist in % '%'",
toString(distributionElementTag), distributionElementID, distributionTag, distributionID));
2648 for (
const auto& probability : probabilities) {
2649 if (probability < 0) {
2650 return writeError(
TLF(
"invalid probability % in % '%'",
toString(probability), distributionTag, distributionID));
2654 if (elements.size() != probabilities.size()) {
2655 return writeError(
TLF(
"Invalid type distribution probabilities in % '%'. Must have the same number of elements", distributionTag, distributionID));
2664 for (
const auto& tag : tags) {
2667 if (demandElement) {
2668 return demandElement;
2677 if (demandElement) {
#define WRITE_WARNING(msg)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
const std::set< std::string > DEFAULT_VTYPES
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
const long long int VEHPARS_DEPARTSPEED_SET
const int STOP_DURATION_SET
@ GIVEN
The lane is given.
@ GIVEN
The speed is given.
const long long int VEHPARS_DEPARTLANE_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_TRIP_TAZS
a single trip definition that uses TAZs
@ GNE_TAG_VTYPEREF
reference to a vType (used in VType distributions)
@ GNE_TAG_WAYPOINT_PARKINGAREA
@ GNE_TAG_STOP_PARKINGAREA
stop placed over a parking area
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ GNE_TAG_STOP_BUSSTOP
stop placed over a busStop
@ GNE_TAG_WAYPOINT_TRAINSTOP
@ GNE_TAG_WAYPOINT_CONTAINERSTOP
@ GNE_TAG_WAYPOINT_BUSSTOP
@ SUMO_TAG_BUS_STOP
A bus stop.
@ GNE_TAG_WAYPOINT_CHARGINGSTATION
@ GNE_TAG_STOPPERSON_BUSSTOP
@ SUMO_TAG_STOP
stop for vehicles
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop
@ GNE_TAG_STOPCONTAINER_CONTAINERSTOP
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_PARKING_AREA
A parking area.
@ GNE_TAG_FLOW_TAZS
a flow between TAZs
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_ROUTE
description of a route
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
@ GNE_TAG_STOP_LANE
stop placed over a lane
@ GNE_TAG_STOPPERSON_TRAINSTOP
@ GNE_TAG_STOP_TRAINSTOP
stop placed over a trainStop
@ GNE_TAG_STOP_CHARGINGSTATION
stop placed over a charging station
@ GNE_TAG_ROUTEREF
virtual element used to reference routes with distributions
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_FROM_TRAINSTOP
@ GNE_ATTR_DEMAND_FILE
demand demand file
@ SUMO_ATTR_FROM_JUNCTION
@ SUMO_ATTR_CONTAINER_STOP
@ GNE_ATTR_FLOWPARAMETERS
flow parameters (integer for mask end, number, etc...)
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_CONTAINERSPERHOUR
@ GNE_ATTR_FROM_CONTAINERSTOP
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_PERSONSPERHOUR
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool around(const Position &p, double offset=0) const
Returns whether the boundary contains the given coordinate.
bool writeError(const std::string &error)
write error and enable error creating element
bool writeErrorInvalidParent(const SumoXMLTag tag, const std::string &id, const SumoXMLTag parentTag, const std::string &parentID)
write error "invalid parent element" giving ids of current and parent element
bool writeWarningDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write warning duplicated element
void writeWarningOverwritting(const SumoXMLTag tag, const std::string &id)
write warning overwritting element
bool writeErrorEmptyEdges(const SumoXMLTag tag, const std::string &id)
write error "empty edges"
const std::string myFilename
filename
bool checkNegative(const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const int value, const bool canBeZero)
check if the given int value is NOT negative
bool checkValidDemandElementID(const SumoXMLTag tag, const std::string &value)
check if the given demand elmement ID is valid
plan parameters (used for group all from-to parameters related with plans)
SumoXMLTag getPersonStopTag() const
get the person stop tag for the current combination of parameters
std::string fromJunction
from junction
SumoXMLTag getRideTag() const
get the ride tag for the current combination of parameters
std::string fromContainerStop
from containerStop
std::string toTrainStop
to trainStop
std::string fromTrainStop
from trainStop
SumoXMLTag getPersonTripTag() const
get the personTrip tag for the current combination of parameters
SumoXMLTag getTransportTag() const
get the transport tag for the current combination of parameters
std::string fromEdge
from edge
std::string fromBusStop
from busStop
std::string toEdge
to edge
std::vector< std::string > consecutiveEdges
consecutive edges
std::string toJunction
to junction
std::string toBusStop
to busStop
std::string fromTAZ
from TAZ
SumoXMLTag getContainerStopTag() const
get the container stop tag for the current combination of parameters
std::string toRoute
to route
std::string toContainerStop
to containerStop
SumoXMLTag getWalkTag() const
get the walk tag for the current combination of parameters
SumoXMLTag getTranshipTag() const
get the tranship tag for the current combination of parameters
const SUMOVehicleParameter::Stop & getStopParameter() const
get stop parameters
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time attribute
bool hasBoolAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given bool attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
SumoBaseObject * getParentSumoBaseObject() const
get pointer to mySumoBaseObjectParent SumoBaseObject (if is null, then is the root)
bool hasTimeAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given time attribute
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
SumoXMLTag getTag() const
get XML myTag
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
bool hasDoubleAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given double attribute
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::vector< std::string > & getStringListAttribute(const SumoXMLAttr attr) const
get string list attribute
bool hasStringListAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given string list attribute
void clear()
clear SumoBaseObject
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::vector< SumoBaseObject * > & getSumoBaseObjectChildren() const
get SumoBaseObject children
bool isUndoRedoAllowed() const
const std::string getID() const
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * getNet() const
get pointer to net
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject) const
fill sumo Base object
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
virtual double getAttributeDouble(SumoXMLAttr key) const =0
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes
A road/street connecting two junctions (netedit-version)
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
void addChildElement(ChildType *element)
add child without updating parent (ONLY used if we're creating elements without undo-redo)
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEEdge * getParentEdge() const
get parent edge
GNEAttributeCarrier * getTemplateAC(const SumoXMLTag tag) const
get template AC by tag
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
void deleteDemandElement(GNEDemandElement *demandElement, const bool updateFrames)
delete demand element of container
std::string generateDemandElementID(SumoXMLTag tag) const
generate demand element id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element in container.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
A NBNetBuilder extended by visualisation and editing capabilities.
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
GNEPathManager * getDemandPathManager()
get demand path manager
GNENetHelper::ACTemplate * getACTemplates() const
get all attribute carriers templates used in this net
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
bool isRoute() const
check if pathElement is a route
std::vector< GNEEdge * > calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &edges) const
calculate Dijkstra path between a list of edges (for example, from-via-to edges)
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
double getClickedPositionOverLane() const
get clicked position over lane
const CommonXMLStructure::PlanParameters & getPlanParameteres() const
get plan parameters
GNEPlanParents (used for group all plan parents)
bool checkIntegrity(SumoXMLTag planTag, const GNEDemandElement *parent, const CommonXMLStructure::PlanParameters &planParameters) const
check integrity between planParameters and GNE elements
void addDemandElementChild(GNEDemandElement *element)
add the given demand element in the element as child
void incRef(const std::string &debugMsg="")
Increase reference.
GNEEdge * parseStopEdge(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
parse stop edge
const bool myOverwrite
flag to check if overwrite elements
bool buildTripJunctions(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromJunctionID, const std::string &toJunctionID)
build trip over junctions
GNEDemandElement * getRouteDistributionParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get route distribution parent
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
bool buildRide(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const std::vector< std::string > &lines, const std::string &group)
build ride
bool buildVType(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVTypeParameter &vTypeParameter)
build vType
CommonXMLStructure::SumoBaseObject * myPlanObject
pointer for person and container plans
GNEDemandElement * getPersonParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get person parent
const bool myAllowUndoRedo
allow undo/redo
GNEEdge * parseEdgeFromLaneID(const std::string &laneID) const
parse edge from lane ID
bool buildWalk(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const double speed, const SUMOTime duration)
build walk
GNEJunction * parseJunction(const SumoXMLTag tag, const std::string &id, const std::string &junctionID)
parse junction
bool buildRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, SUMOVehicleClass vClass, const std::vector< std::string > &edgeIDs, const RGBColor &color, const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map &routeParameters)
build route
bool buildPersonTrip(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const std::vector< std::string > &types, const std::vector< std::string > &modes, const std::vector< std::string > &lines, const double walkFactor, const std::string &group)
build person trip
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
GNENet * myNet
pointer to GNENet
void duplicatePlan(const GNEDemandElement *originalPlan, GNEDemandElement *newParent)
duplicate given plan in new parent
bool buildContainerPlan(const GNEDemandElement *planTemplate, GNEDemandElement *containerParent, GNEAttributesEditor *containerPlanAttributesEditor, GNEPlanCreator *planCreator, const bool centerAfterCreation)
build container plan
bool buildPersonPlan(const GNEDemandElement *planTemplate, GNEDemandElement *personParent, GNEAttributesEditor *personPlanAttributesEditor, GNEPlanCreator *planCreator, const bool centerAfterCreation)
build person plan
bool buildRouteRef(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &routeID, const double probability)
build route ref
bool buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::vector< std::string > &edgeIDs, const RGBColor &color, const int repeat, const SUMOTime cycleTime, const Parameterised::Map &routeParameters)
build a flow with an embedded route
static void transformToContainerFlow(GNEContainer *originalContainer)
transform routeFlow over an existent route
bool buildPersonFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &personFlowParameters)
build person flow
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
bool buildVTypeRef(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &vTypeID, const double probability)
build vType ref
bool buildFlowJunctions(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromJunctionID, const std::string &toJunctionID)
build flow over junctions
bool buildFlowTAZs(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromTAZID, const std::string &toTAZID)
build flow over junctions
bool buildRouteDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id)
build route distribution
GNEAdditional * parseTAZ(const SumoXMLTag tag, const std::string &id, const std::string &TAZID)
parse TAZ
bool buildContainer(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &containerParameters)
build container
bool buildTripTAZs(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromTAZID, const std::string &toTAZID)
build trip over TAZs
bool buildTransport(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const std::vector< std::string > &lines, const std::string &group)
build transport
static bool canReverse(const GNEDemandElement *element)
reverse functions
bool buildStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const SUMOVehicleParameter::Stop &stopParameters)
build stop
bool postParserTasks()
run post parser tasks
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::string &id, const std::vector< std::string > &edgeIDs)
parse edges
bool checkViaAttribute(const SumoXMLTag tag, const std::string &id, const std::vector< std::string > &via)
check if via attribute is valid
GNEDemandElement * getVTypeDistributionParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get vType distribution parent
bool buildContainerStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double endPos, const SUMOTime duration, const SUMOTime until, const std::string &actType, const bool friendlyPos, const int parameterSet)
build container stop
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
bool buildPersonStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double endPos, const SUMOTime duration, const SUMOTime until, const std::string &actType, const bool friendlyPos, const int parameterSet)
build person stop
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
bool buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const int deterministic)
build vType distribution
GNEDemandElement * retrieveDemandElement(const std::vector< SumoXMLTag > tags, const std::string &id)
get element by ID
GNEDemandElement * getType(const std::string &id) const
get type (Either type o typeDistribution)
virtual ~GNERouteHandler()
Destructor.
bool buildFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeIDs)
build flow
GNERouteHandler()=delete
invalidate default onstructor
bool buildContainerFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &containerFlowParameters)
build container flow
bool buildTrip(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeID)
build trip
bool buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::vector< std::string > &edgeIDs, const RGBColor &color, const int repeat, const SUMOTime cycleTime, const Parameterised::Map &routeParameters)
build a vehicle with an embedded route
bool buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters)
build a vehicle over an existent route
GNEDemandElement * getContainerParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get container parent
static void reverse(GNEDemandElement *element)
reverse given demand element
bool buildPerson(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &personParameters)
build person
static void transformToFlowJunctions(GNEVehicle *originalVehicle)
transform to flow over junctions
static void transformToTripJunctions(GNEVehicle *originalVehicle)
transform to trip over junctions
static void transformToContainer(GNEContainer *originalContainer)
transform container functions
bool buildTranship(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPosition, const double departPosition, const double speed, const SUMOTime duration)
build tranship
static void transformToPersonFlow(GNEPerson *originalPerson)
transform routeFlow over an existent route
GNEEdge * parseEdge(const SumoXMLTag tag, const std::string &id, const std::string &edgeID, const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const bool firstEdge)
parse edge
bool getDistributionElements(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, SumoXMLTag distributionElementTag, const std::vector< std::string > &distributionElementIDs, const std::vector< double > &probabilities, std::vector< const GNEDemandElement * > &elements)
get distribution elements
bool checkElement(const SumoXMLTag tag, GNEDemandElement *demandElement)
check if element exist, and if overwritte
bool buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters)
build a flow over an existent route
static void transformToFlowTAZs(GNEVehicle *originalVehicle)
transform to flow over TAZs
std::set< GNEDemandElement * > myParentPlanElements
demand element parentplans (person and containers, used in postParserTasks)
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
static void transformToTripTAZs(GNEVehicle *originalVehicle)
transform to trip over TAZs
static GNEDemandElement * copyRoute(const GNERoute *originalRoute)
create a copy of the given route
bool isPlanTransport() const
return true if tag correspond to a transport
bool isContainer() const
return true if tag correspond to a container element
bool isFlow() const
return true if tag correspond to a flow element
bool isVehicle() const
return true if tag correspond to a vehicle element
bool vehicleJunctions() const
return true if tag correspond to a vehicle placed over from-to junctions
bool isPlanStopContainer() const
return true if tag correspond to a container stop plan
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool vehicleRouteEmbedded() const
return true if tag correspond to a vehicle placed over an embedded route
bool isPlanPersonTrip() const
return true if tag correspond to a person trip plan
bool vehicleEdges() const
return true if tag correspond to a vehicle placed over from-to edges
bool isPlanRide() const
return true if tag correspond to a ride plan
bool isPlanStopPerson() const
return true if tag correspond to a person stop plan
bool isPerson() const
return true if tag correspond to a person element
bool vehicleTAZs() const
return true if tag correspond to a vehicle placed over from-to TAZs
bool vehicleRoute() const
plan parents
bool isPlanWalk() const
return true if tag correspond to a walk plan
bool isPlanTranship() const
return true if tag correspond to a tranship
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
static bool overwriteVType(GNEDemandElement *vType, const SUMOVTypeParameter newVTypeParameter, GNEUndoList *undoList)
overwrite all values of GNEVType with a SUMOVTypeParameter
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
static GNEDemandElement * copyVehicle(const GNEVehicle *originalVehicle)
create a copy of the given vehicle
bool isACInspected(GNEAttributeCarrier *AC) const
GNENet * getNet() const
get the net object
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
Boundary getVisibleBoundary() const
get visible boundary
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
static const std::vector< SumoXMLTag > types
type namespace
static const std::vector< SumoXMLTag > vehicles
vehicles namespace
static const std::vector< SumoXMLTag > routes
route namespace
static const std::vector< SumoXMLTag > persons
persons namespace
static const std::vector< SumoXMLTag > containers
containers namespace
std::map< std::string, std::string > Map
parameters map
static const RGBColor YELLOW
static const RGBColor INVISIBLE
Structure representing possible vehicle parameter.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
std::string id
The vehicle type's id.
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at.
std::string lane
The lane to stop at.
bool friendlyPos
enable or disable friendly position (used by netedit)
double speed
the speed at which this stop counts as reached (waypoint mode)
std::string parkingarea
(Optional) parking area if one is assigned to the stop
std::string chargingStation
(Optional) charging station if one is assigned to the stop
int parametersSet
Information for the output which parameter were set.
SUMOTime until
The time at which the vehicle may continue its journey.
std::string actType
act Type (only used by Persons) (used by netedit)
double endPos
The stopping position end.
std::string busstop
(Optional) bus stop if one is assigned to the stop
std::string containerstop
(Optional) container stop if one is assigned to the stop
SUMOTime duration
The stopping duration.
Structure representing possible vehicle parameter.
double repetitionProbability
The probability for emitting a vehicle per second.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
double departSpeed
(optional) The initial speed of the vehicle
SumoXMLTag tag
The vehicle tag.
std::string vtypeid
The vehicle's type id.
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
std::vector< std::string > via
List of the via-edges the vehicle must visit.
long long int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
bool wasSet(long long int what) const
Returns whether the given parameter was set.
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
std::string routeid
The vehicle's route id.
std::string id
The vehicle's id.