59 myAllowUndoRedo(allowUndoRedo),
60 myRemoveEmptyPersons(removeEmptyPersons) {
68 if (parentPlanElement->getChildDemandElements().empty()) {
70 myNet->
getUndoList()->
begin(parentPlanElement,
TLF(
"delete % '%'", parentPlanElement->getTagStr(), parentPlanElement->getID()));
74 parentPlanElement->decRef(
"postParserTasks");
107 if (distributionParent) {
109 vTypeRef =
new GNEVTypeRef(distributionParent, vType);
127 vType->
incRef(
"buildVType");
141 if (distribution ==
nullptr) {
143 }
else if (refElement) {
152 distribution->addChildElement(vTypeRef);
153 refElement->addChildElement(vTypeRef);
154 vTypeRef->
incRef(
"buildVTypeRef");
180 vTypeDistribution->
incRef(
"buildVTypeDistribution");
189 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
205 if (validEdges.size() > 0) {
216 if (distributionParent) {
218 routeRef =
new GNERouteRef(distributionParent, route);
220 WRITE_WARNING(
TLF(
"Route '%' with probability % cannot be referenced with distribution '%'",
id,
toString(probability), routeDistributionID));
232 for (
const auto& edge : edges) {
233 edge->addChildElement(route);
239 route->
incRef(
"buildRoute");
254 if (distribution ==
nullptr) {
256 }
else if (refElement) {
265 distribution->addChildElement(routeRef);
266 refElement->addChildElement(routeRef);
267 routeRef->
incRef(
"buildRouteRef");
293 routeDistribution->
incRef(
"buildRouteDistribution");
312 if (type ==
nullptr) {
314 }
else if (route ==
nullptr) {
332 vehicle->
incRef(
"buildVehicleOverRoute");
342 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
356 if (validEdges.size() > 0) {
361 if (type ==
nullptr) {
382 for (
const auto& edge : edges) {
383 edge->addChildElement(route);
385 vehicle->
incRef(
"buildVehicleEmbeddedRoute");
386 route->
incRef(
"buildVehicleEmbeddedRoute");
407 if (type ==
nullptr) {
409 }
else if (route ==
nullptr) {
427 flow->
incRef(
"buildFlowOverRoute");
437 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
451 if (validEdges.size() > 0) {
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) {
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) {
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) {
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) {
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) {
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) {
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();
1673 std::vector<GNEEdge*> routeEdges;
1686 std::vector<std::string> edgeIDs;
1687 for (
const auto& edge : routeEdges) {
1688 edgeIDs.push_back(edge->getID());
1691 if (!originalRoute && routeEdges.empty()) {
1693 const std::string header =
"Problem transforming to vehicle";
1695 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1704 if (createEmbeddedRoute) {
1708 if (originalRoute) {
1710 edgeIDs.push_back(edge->getID());
1716 }
else if (originalRoute) {
1729 vehicleParameters.
routeid = routeID;
1736 if (inspectAfterTransform) {
1758 const auto vClass = originalVehicle->
getVClass();
1763 std::vector<GNEEdge*> routeEdges;
1776 std::vector<std::string> edgeIDs;
1777 for (
const auto& edge : routeEdges) {
1778 edgeIDs.push_back(edge->getID());
1781 if (!originalRoute && routeEdges.empty()) {
1783 const std::string header =
"Problem transforming to vehicle";
1785 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1806 if (createEmbeddedRoute) {
1810 if (originalRoute) {
1812 edgeIDs.push_back(edge->getID());
1818 }
else if (originalRoute) {
1831 vehicleParameters.
routeid = routeID;
1839 if (inspectAfterTransform) {
1863 std::vector<GNEEdge*> edges;
1878 if (edges.size() < 2) {
1880 const std::string header =
"Problem transforming to vehicle";
1882 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1897 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1901 if (inspectAfterTransform) {
1925 std::vector<GNEEdge*> edges;
1940 if (edges.empty()) {
1942 const std::string header =
"Problem transforming to vehicle";
1944 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1971 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1975 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";
2015 routeHandler.
buildTripJunctions(
nullptr, vehicleParameters, fromJunction, toJunction);
2019 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";
2068 routeHandler.
buildFlowJunctions(
nullptr, vehicleParameters, fromJunction, toJunction);
2072 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";
2112 routeHandler.
buildTripTAZs(
nullptr, vehicleParameters, fromTAZ, toTAZ);
2116 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";
2165 routeHandler.
buildFlowTAZs(
nullptr, vehicleParameters, fromTAZ, toTAZ);
2169 if (inspectAfterTransform) {
2190 const auto ID = personParameters.
id;
2192 personParameters.
id =
"%dummyID%";
2196 routeHandler.
buildPerson(
nullptr, personParameters);
2209 if (inspectAfterTransform) {
2228 const auto ID = personParameters.
id;
2230 personParameters.
id =
"%dummyID%";
2237 for (
const auto& personPlan : personPlans) {
2250 if (inspectAfterTransform) {
2269 const auto ID = containerParameters.
id;
2271 containerParameters.
id =
"%dummyID%";
2277 for (
const auto& containerPlan : containerPlans) {
2288 if (inspectAfterTransform) {
2307 const auto ID = containerParameters.
id;
2309 containerParameters.
id =
"%dummyID%";
2315 for (
const auto& containerPlan : containerPlans) {
2329 if (inspectAfterTransform) {
2359 if (edges.empty()) {
2363 std::vector<GNEEdge*> reverseEdges;
2364 for (
const auto& edge : edges) {
2365 const auto oppositeEdges = edge->getOppositeEdges();
2367 if (oppositeEdges.empty()) {
2370 reverseEdges.push_back(oppositeEdges.front());
2374 std::reverse(reverseEdges.begin(), reverseEdges.end());
2408 std::vector<GNEEdge*> oppositeEdges;
2410 oppositeEdges.push_back(edge->getOppositeEdges().front());
2412 std::reverse(oppositeEdges.begin(), oppositeEdges.end());
2420 oppositeEdges.erase(oppositeEdges.begin());
2421 oppositeEdges.pop_back();
2422 if (oppositeEdges.size() > 0) {
2452 if (junction ==
nullptr) {
2463 if (
TAZ ==
nullptr) {
2473 const bool firstEdge) {
2475 if (edgeID.empty()) {
2493 if (edge ==
nullptr) {
2509 if (busStop !=
nullptr) {
2511 }
else if (trainStop !=
nullptr) {
2512 return trainStop->getParentLanes().front()->getParentEdge();
2519 if (busStop !=
nullptr) {
2521 }
else if (trainStop !=
nullptr) {
2522 return trainStop->getParentLanes().front()->getParentEdge();
2528 if (containerStop !=
nullptr) {
2536 if (containerStop !=
nullptr) {
2544 if (parkingArea !=
nullptr) {
2557 std::string edgeID = laneID;
2558 for (
int i = ((
int)laneID.size() - 1); (i >= 0) && (laneID[i + 1] !=
'_'); i--) {
2565std::vector<GNEEdge*>
2567 std::vector<GNEEdge*> edges;
2568 for (
const auto& edgeID : edgeIDs) {
2571 if (edge ==
nullptr) {
2576 edges.push_back(edge);
2586 if (type ==
nullptr) {
2597 if (type ==
nullptr) {
2618 if (personParent ==
nullptr) {
2621 return personParent;
2639 if (containerParent ==
nullptr) {
2642 return containerParent;
2675 const std::vector<std::string>& distributionElementIDs,
const std::vector<double>& probabilities,
2676 std::vector<const GNEDemandElement*>& elements) {
2678 std::string distributionTag =
toString(sumoBaseObject->
getTag());
2681 for (
const auto& distributionElementID : distributionElementIDs) {
2683 if (distributionElement) {
2684 elements.push_back(distributionElement);
2686 return writeError(
TLF(
"% with id '%' doesn't exist in % '%'",
toString(distributionElementTag), distributionElementID, distributionTag, distributionID));
2690 for (
const auto& probability : probabilities) {
2691 if (probability < 0) {
2692 return writeError(
TLF(
"invalid probability % in % '%'",
toString(probability), distributionTag, distributionID));
2696 if (elements.size() != probabilities.size()) {
2697 return writeError(
TLF(
"Invalid type distribution probabilities in % '%'. Must have the same number of elements", distributionTag, distributionID));
2706 for (
const auto& tag : tags) {
2709 if (demandElement) {
2710 return demandElement;
2719 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
@ 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
FileBucket * myFileBucket
fileBucket
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
void updateOptions()
update options
GNEApplicationWindowHelper::FileBucketHandler * getFileBucketHandler() const
get file bucket handler
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
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
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.
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
GNEApplicationWindow * getGNEApplicationWindow() const
get tag properties database
GNEUndoList * getUndoList() const
get undo list(used for simplify code)
GNEViewNet * getViewNet() const
get view net (used for simplify code)
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
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
const bool myRemoveEmptyPersons
check if remove empty persons
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
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
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 repetitionNumber
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.