59 myAllowUndoRedo(allowUndoRedo) {
72 if (parentPlanElement->getChildDemandElements().empty()) {
78 parentPlanElement->decRef(
"postParserTasks");
108 if (distributionParent) {
110 vTypeRef =
new GNEVTypeRef(distributionParent, vType);
128 vType->
incRef(
"buildVType");
142 if (distribution ==
nullptr) {
144 }
else if (refElement) {
153 distribution->addChildElement(vTypeRef);
154 refElement->addChildElement(vTypeRef);
155 vTypeRef->
incRef(
"buildVTypeRef");
181 vTypeDistribution->
incRef(
"buildVTypeDistribution");
190 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
206 if (validEdges.size() > 0) {
217 if (distributionParent) {
219 routeRef =
new GNERouteRef(distributionParent, route);
221 WRITE_WARNING(
TLF(
"Route '%' with probability % cannot be referenced with distribution '%'",
id,
toString(probability), routeDistributionID));
233 for (
const auto& edge : edges) {
234 edge->addChildElement(route);
240 route->
incRef(
"buildRoute");
255 if (distribution ==
nullptr) {
257 }
else if (refElement) {
266 distribution->addChildElement(routeRef);
267 refElement->addChildElement(routeRef);
268 routeRef->
incRef(
"buildRouteRef");
294 routeDistribution->
incRef(
"buildRouteDistribution");
313 if (type ==
nullptr) {
315 }
else if (route ==
nullptr) {
333 vehicle->
incRef(
"buildVehicleOverRoute");
343 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
357 if (validEdges.size() > 0) {
362 if (type ==
nullptr) {
383 for (
const auto& edge : edges) {
384 edge->addChildElement(route);
386 vehicle->
incRef(
"buildVehicleEmbeddedRoute");
387 route->
incRef(
"buildVehicleEmbeddedRoute");
408 if (type ==
nullptr) {
410 }
else if (route ==
nullptr) {
428 flow->
incRef(
"buildFlowOverRoute");
438 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
452 if (validEdges.size() > 0) {
457 if (type ==
nullptr) {
478 for (
const auto& edge : edges) {
479 edge->addChildElement(route);
481 vehicle->
incRef(
"buildFlowEmbeddedRoute");
482 route->
incRef(
"buildFlowEmbeddedRoute");
493 const std::string& fromEdgeID,
const std::string& toEdgeID) {
508 if (!fromEdge || !toEdge) {
513 if (type ==
nullptr) {
532 trip->
incRef(
"buildTrip");
534 fromEdge->addChildElement(trip);
535 toEdge->addChildElement(trip);
546 const std::string& fromJunctionID,
const std::string& toJunctionID) {
557 if (!fromJunction || !toJunction) {
562 if (type ==
nullptr) {
579 flow->
incRef(
"buildFlow");
581 fromJunction->addChildElement(flow);
582 toJunction->addChildElement(flow);
593 const std::string& fromTAZID,
const std::string& toTAZID) {
604 if (!fromTAZ || !toTAZ) {
609 if (type ==
nullptr) {
626 flow->
incRef(
"buildFlow");
628 fromTAZ->addChildElement(flow);
629 toTAZ->addChildElement(flow);
640 const std::string& fromEdgeID,
const std::string& toEdgeID) {
655 if (!fromEdge || !toEdge) {
660 if (type ==
nullptr) {
679 flow->
incRef(
"buildFlow");
681 fromEdge->addChildElement(flow);
682 toEdge->addChildElement(flow);
693 const std::string& fromJunctionID,
const std::string& toJunctionID) {
704 if (!fromJunction || !toJunction) {
709 if (type ==
nullptr) {
726 flow->
incRef(
"buildFlow");
728 fromJunction->addChildElement(flow);
729 toJunction->addChildElement(flow);
740 const std::string& fromTAZID,
const std::string& toTAZID) {
751 if (!fromTAZ || !toTAZ) {
756 if (type ==
nullptr) {
773 flow->
incRef(
"buildFlow");
775 fromTAZ->addChildElement(flow);
776 toTAZ->addChildElement(flow);
796 if (type ==
nullptr) {
809 person->
incRef(
"buildPerson");
830 if (type ==
nullptr) {
843 personFlow->
incRef(
"buildPersonFlow");
855 const double arrivalPos,
const std::vector<std::string>& types,
const std::vector<std::string>& modes,
856 const std::vector<std::string>& lines,
const double walkFactor,
const std::string& group) {
862 if (personParent ==
nullptr) {
865 return writeError(
TL(
"invalid combination for personTrip"));
866 }
else if (planParents.
checkIntegrity(personTripTag, personParent, planParameters)) {
869 arrivalPos, types, modes, lines, walkFactor, group);
880 personTrip->
incRef(
"buildPersonTrip");
891 const double arrivalPos,
const double speed,
const SUMOTime duration) {
894 const auto walkTag = planParameters.
getWalkTag();
897 if (personParent ==
nullptr) {
900 return writeError(
TL(
"invalid combination for personTrip"));
905 }
else if (planParents.
checkIntegrity(walkTag, personParent, planParameters)) {
918 walk->
incRef(
"buildWalk");
929 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
932 const auto rideTag = planParameters.
getRideTag();
935 if (personParent ==
nullptr) {
939 }
else if (planParents.
checkIntegrity(rideTag, personParent, planParameters)) {
952 ride->
incRef(
"buildRide");
972 if (type ==
nullptr) {
985 container->
incRef(
"buildContainer");
1006 if (type ==
nullptr) {
1007 return writeError(
TLF(
"Invalid vehicle type '%' used in % '%'.", containerFlowParameters.
vtypeid,
toString(containerFlowParameters.
tag), containerFlowParameters.
id));
1019 containerFlow->
incRef(
"buildContainerFlow");
1031 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
1037 if (containerParent ==
nullptr) {
1040 return writeError(
TL(
"invalid combination for personTrip"));
1041 }
else if (planParents.
checkIntegrity(transportTag, containerParent, planParameters)) {
1054 transport->
incRef(
"buildTransport");
1065 const double arrivalPosition,
const double departPosition,
const double speed,
const SUMOTime duration) {
1071 if (containerParent ==
nullptr) {
1074 return writeError(
TL(
"invalid combination for personTrip"));
1079 }
else if (planParents.
checkIntegrity(transhipTag, containerParent, planParameters)) {
1082 departPosition, arrivalPosition, speed, duration);
1093 tranship->
incRef(
"buildTranship");
1105 const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
1111 if (personParent ==
nullptr) {
1114 return writeError(
TL(
"invalid combination for person stop"));
1115 }
else if (planParents.
checkIntegrity(personStopTag, personParent, planParameters)) {
1118 endPos, duration, until, actType, friendlyPos, parameterSet);
1129 stopPlan->
incRef(
"buildPersonStop");
1140 const double endPos,
const SUMOTime duration,
1141 const SUMOTime until,
const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
1147 if (containerParent ==
nullptr) {
1150 return writeError(
TL(
"invalid combination for containerStop"));
1151 }
else if (planParents.
checkIntegrity(containerStopTag, containerParent, planParameters)) {
1154 endPos, duration, until, actType, friendlyPos, parameterSet);
1165 stopPlan->
incRef(
"buildContainerStop");
1180 if (objParent ==
nullptr) {
1210 bool waypoint =
false;
1222 if (stopParameters.
busstop.size() > 0) {
1226 if (stoppingPlace ==
nullptr) {
1232 return writeError(
TL(
"Containers don't support stops at busStops or trainStops"));
1239 return writeError(
TL(
"Persons don't support stops at containerStops"));
1246 return writeError(
TL(
"Persons don't support stops at chargingStations"));
1248 return writeError(
TL(
"Containers don't support stops at chargingStations"));
1250 }
else if (stopParameters.
parkingarea.size() > 0) {
1255 return writeError(
TL(
"Persons don't support stops at parkingAreas"));
1257 return writeError(
TL(
"Containers don't support stops at parkingAreas"));
1259 }
else if (stopParameters.
lane.size() > 0) {
1262 }
else if (stopParameters.
edge.size() > 0) {
1266 return writeError(
TL(
"vehicles don't support stops at edges"));
1275 if (stoppingPlace && lane && edge) {
1276 return writeError(
TL(
"A stop must be defined either over a stoppingPlace, a edge or a lane"));
1277 }
else if (!stoppingPlace && !lane && !edge) {
1278 return writeError(
TL(
"A stop requires only a stoppingPlace, edge or lane"));
1279 }
else if (stoppingPlace) {
1291 stop =
new GNEStop(stopTagType, stopParent, stoppingPlace, stopParameters);
1302 stop->
incRef(
"buildStoppingPlaceStop");
1317 stop->
incRef(
"buildLaneStop");
1333 const bool centerAfterCreation) {
1335 if (personParent ==
nullptr) {
1349 std::vector<std::string>();
1352 std::vector<std::string>();
1355 std::vector<std::string>();
1384 int parameterSet = 0;
1402 delete personPlanObject;
1410 const bool centerAfterCreation) {
1412 if (containerParent ==
nullptr) {
1429 std::vector<std::string>();
1457 int parameterSet = 0;
1475 delete containerPlanObject;
1489 planObject->
setTag(tagProperty->getTag());
1493 if (tagProperty->planFromEdge()) {
1496 if (tagProperty->planToEdge()) {
1499 if (tagProperty->planFromJunction()) {
1502 if (tagProperty->planToJunction()) {
1505 if (tagProperty->planFromTAZ()) {
1508 if (tagProperty->planToTAZ()) {
1511 if (tagProperty->planFromBusStop()) {
1514 if (tagProperty->planToBusStop()) {
1517 if (tagProperty->planFromTrainStop()) {
1520 if (tagProperty->planToTrainStop()) {
1523 if (tagProperty->planFromContainerStop()) {
1526 if (tagProperty->planToContainerStop()) {
1530 if (tagProperty->planEdge()) {
1533 if (tagProperty->planBusStop()) {
1536 if (tagProperty->planTrainStop()) {
1539 if (tagProperty->planContainerStop()) {
1543 if (tagProperty->planRoute()) {
1547 if (tagProperty->planConsecutiveEdges()) {
1559 for (
const auto& attrProperty : tagProperty->getAttributeProperties()) {
1561 if (attrProperty->isFloat()) {
1562 if (!originalPlan->
getAttribute(attrProperty->getAttr()).empty()) {
1565 }
else if (attrProperty->isSUMOTime()) {
1566 if (!originalPlan->
getAttribute(attrProperty->getAttr()).empty()) {
1567 planObject->
addTimeAttribute(attrProperty->getAttr(), GNEAttributeCarrier::parse<SUMOTime>(originalPlan->
getAttribute(attrProperty->getAttr())));
1569 }
else if (attrProperty->isBool()) {
1570 planObject->
addBoolAttribute(attrProperty->getAttr(), GNEAttributeCarrier::parse<bool>(originalPlan->
getAttribute(attrProperty->getAttr())));
1571 }
else if (attrProperty->isList()) {
1572 planObject->
addStringListAttribute(attrProperty->getAttr(), GNEAttributeCarrier::parse<std::vector<std::string> >(originalPlan->
getAttribute(attrProperty->getAttr())));
1579 if (tagProperty->isPlanPersonTrip()) {
1587 }
else if (tagProperty->isPlanWalk()) {
1592 }
else if (tagProperty->isPlanRide()) {
1597 }
else if (tagProperty->isPlanStopPerson()) {
1599 int parameterSet = 0;
1613 }
else if (tagProperty->isPlanTransport()) {
1618 }
else if (tagProperty->isPlanTranship()) {
1624 }
else if (tagProperty->isPlanStopContainer()) {
1626 int parameterSet = 0;
1648 for (
const auto& edgeID : via) {
1669 const auto vClass = originalVehicle->
getVClass();
1674 std::vector<GNEEdge*> routeEdges;
1687 std::vector<std::string> edgeIDs;
1688 for (
const auto& edge : routeEdges) {
1689 edgeIDs.push_back(edge->getID());
1692 if (!originalRoute && routeEdges.empty()) {
1694 const std::string header =
"Problem transforming to vehicle";
1696 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1705 if (createEmbeddedRoute) {
1709 if (originalRoute) {
1711 edgeIDs.push_back(edge->getID());
1717 }
else if (originalRoute) {
1730 vehicleParameters.
routeid = routeID;
1737 if (inspectAfterTransform) {
1759 const auto vClass = originalVehicle->
getVClass();
1764 std::vector<GNEEdge*> routeEdges;
1777 std::vector<std::string> edgeIDs;
1778 for (
const auto& edge : routeEdges) {
1779 edgeIDs.push_back(edge->getID());
1782 if (!originalRoute && routeEdges.empty()) {
1784 const std::string header =
"Problem transforming to vehicle";
1786 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1807 if (createEmbeddedRoute) {
1811 if (originalRoute) {
1813 edgeIDs.push_back(edge->getID());
1819 }
else if (originalRoute) {
1832 vehicleParameters.
routeid = routeID;
1840 if (inspectAfterTransform) {
1864 std::vector<GNEEdge*> edges;
1879 if (edges.size() < 2) {
1881 const std::string header =
"Problem transforming to vehicle";
1883 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1898 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1902 if (inspectAfterTransform) {
1926 std::vector<GNEEdge*> edges;
1941 if (edges.empty()) {
1943 const std::string header =
"Problem transforming to vehicle";
1945 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1972 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1976 if (inspectAfterTransform) {
1991 const std::string header =
"Problem transforming to trip over junctions";
1993 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
2016 routeHandler.
buildTripJunctions(
nullptr, vehicleParameters, fromJunction, toJunction);
2020 if (inspectAfterTransform) {
2035 const std::string header =
"Problem transforming to flow over junctions";
2037 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
2069 routeHandler.
buildFlowJunctions(
nullptr, vehicleParameters, fromJunction, toJunction);
2073 if (inspectAfterTransform) {
2088 const std::string header =
"Problem transforming to trip over TAZs";
2090 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
2113 routeHandler.
buildTripTAZs(
nullptr, vehicleParameters, fromTAZ, toTAZ);
2117 if (inspectAfterTransform) {
2132 const std::string header =
"Problem transforming to flow over TAZs";
2134 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
2166 routeHandler.
buildFlowTAZs(
nullptr, vehicleParameters, fromTAZ, toTAZ);
2170 if (inspectAfterTransform) {
2192 const auto ID = personParameters.
id;
2194 personParameters.
id =
"%dummyID%";
2198 routeHandler.
buildPerson(
nullptr, personParameters);
2211 if (inspectAfterTransform) {
2231 const auto ID = personParameters.
id;
2233 personParameters.
id =
"%dummyID%";
2240 for (
const auto& personPlan : personPlans) {
2253 if (inspectAfterTransform) {
2273 const auto ID = containerParameters.
id;
2275 containerParameters.
id =
"%dummyID%";
2281 for (
const auto& containerPlan : containerPlans) {
2292 if (inspectAfterTransform) {
2312 const auto ID = containerParameters.
id;
2314 containerParameters.
id =
"%dummyID%";
2320 for (
const auto& containerPlan : containerPlans) {
2334 if (inspectAfterTransform) {
2364 if (edges.empty()) {
2368 std::vector<GNEEdge*> reverseEdges;
2369 for (
const auto& edge : edges) {
2370 const auto oppositeEdges = edge->getOppositeEdges();
2372 if (oppositeEdges.empty()) {
2375 reverseEdges.push_back(oppositeEdges.front());
2379 std::reverse(reverseEdges.begin(), reverseEdges.end());
2413 std::vector<GNEEdge*> oppositeEdges;
2415 oppositeEdges.push_back(edge->getOppositeEdges().front());
2417 std::reverse(oppositeEdges.begin(), oppositeEdges.end());
2425 oppositeEdges.erase(oppositeEdges.begin());
2426 oppositeEdges.pop_back();
2427 if (oppositeEdges.size() > 0) {
2457 if (junction ==
nullptr) {
2468 if (
TAZ ==
nullptr) {
2478 const bool firstEdge) {
2480 if (edgeID.empty()) {
2498 if (edge ==
nullptr) {
2514 if (busStop !=
nullptr) {
2516 }
else if (trainStop !=
nullptr) {
2517 return trainStop->getParentLanes().front()->getParentEdge();
2524 if (busStop !=
nullptr) {
2526 }
else if (trainStop !=
nullptr) {
2527 return trainStop->getParentLanes().front()->getParentEdge();
2533 if (containerStop !=
nullptr) {
2541 if (containerStop !=
nullptr) {
2549 if (parkingArea !=
nullptr) {
2562 std::string edgeID = laneID;
2563 for (
int i = ((
int)laneID.size() - 1); (i >= 0) && (laneID[i + 1] !=
'_'); i--) {
2570std::vector<GNEEdge*>
2572 std::vector<GNEEdge*> edges;
2573 for (
const auto& edgeID : edgeIDs) {
2576 if (edge ==
nullptr) {
2581 edges.push_back(edge);
2591 if (type ==
nullptr) {
2602 if (type ==
nullptr) {
2623 if (personParent ==
nullptr) {
2626 return personParent;
2644 if (containerParent ==
nullptr) {
2647 return containerParent;
2680 const std::vector<std::string>& distributionElementIDs,
const std::vector<double>& probabilities,
2681 std::vector<const GNEDemandElement*>& elements) {
2683 std::string distributionTag =
toString(sumoBaseObject->
getTag());
2686 for (
const auto& distributionElementID : distributionElementIDs) {
2688 if (distributionElement) {
2689 elements.push_back(distributionElement);
2691 return writeError(
TLF(
"% with id '%' doesn't exist in % '%'",
toString(distributionElementTag), distributionElementID, distributionTag, distributionID));
2695 for (
const auto& probability : probabilities) {
2696 if (probability < 0) {
2697 return writeError(
TLF(
"invalid probability % in % '%'",
toString(probability), distributionTag, distributionID));
2701 if (elements.size() != probabilities.size()) {
2702 return writeError(
TLF(
"Invalid type distribution probabilities in % '%'. Must have the same number of elements", distributionTag, distributionID));
2711 for (
const auto& tag : tags) {
2714 if (demandElement) {
2715 return demandElement;
2724 if (demandElement) {
#define WRITE_WARNING(msg)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
const double DEFAULT_VEH_PROB
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 writeWarningDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write warning duplicated element
bool writeErrorInvalidParent(const SumoXMLTag tag, const std::string &id, const std::vector< SumoXMLTag > parentTags, const std::string &parentID)
write error "invalid parent element" giving ids of current and parent element
bool myOverwriteElements
overwrite elements
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
bool myRemainElements
remain elements
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
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::string getID() const override
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
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
virtual std::string getAttribute(SumoXMLAttr key) const =0
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject) const
fill sumo Base object
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
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.
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
GNEDemandElement * retrieveDemandElements(const std::vector< SumoXMLTag > types, const std::string &id, bool hardFail=true) const
Returns the named demand element.
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 override
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
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
GNEDemandElement * getRoute(const std::string &id) const
get route (Either route o routeDistribution)
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 overwrite
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
static std::string isRouteValid(const std::vector< GNEEdge * > &edges)
check if a route is valid
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 override
inherited from GNEAttributeCarrier
SUMOVehicleClass getVClass() const override
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.