77 myAllowUndoRedo(allowUndoRedo),
78 myOverwrite(overwrite) {
91 if (parentPlanElement->getChildDemandElements().empty()) {
97 parentPlanElement->decRef(
"postParserTasks");
127 if (vTypeDistribution) {
133 if (vTypeDistribution) {
136 vType->
incRef(
"buildVType");
145 const std::vector<std::string>& vTypeIDs,
const std::vector<double>& probabilities) {
147 std::vector<const GNEDemandElement*> vTypes;
162 for (
int i = 0; i < (int)vTypes.size(); i++) {
169 for (
int i = 0; i < (int)vTypes.size(); i++) {
172 vTypeDistribution->
incRef(
"buildVTypeDistribution");
181 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
204 if (routeDistribution) {
210 for (
const auto& edge : edges) {
211 edge->addChildElement(route);
213 if (routeDistribution) {
216 route->
incRef(
"buildRoute");
246 if (type ==
nullptr) {
267 for (
const auto& edge : edges) {
268 edge->addChildElement(route);
270 vehicle->
incRef(
"buildEmbeddedRoute");
271 route->
incRef(
"buildEmbeddedRoute");
282 const std::vector<std::string>& routeIDs,
const std::vector<double>& probabilities) {
284 std::vector<const GNEDemandElement*> routes;
299 for (
int i = 0; i < (int)routes.size(); i++) {
306 for (
int i = 0; i < (int)routes.size(); i++) {
309 routeDistribution->
incRef(
"buildRouteDistribution");
327 if (type ==
nullptr) {
329 }
else if (route ==
nullptr) {
347 vehicle->
incRef(
"buildVehicleOverRoute");
366 if (type ==
nullptr) {
368 }
else if (route ==
nullptr) {
386 flow->
incRef(
"buildFlowOverRoute");
396 const std::string& fromEdgeID,
const std::string& toEdgeID) {
413 if (!fromEdge || !toEdge) {
418 if (type ==
nullptr) {
435 trip->
incRef(
"buildTrip");
437 fromEdge->addChildElement(trip);
438 toEdge->addChildElement(trip);
449 const std::string& fromJunctionID,
const std::string& toJunctionID) {
460 if (!fromJunction || !toJunction) {
465 if (type ==
nullptr) {
482 flow->
incRef(
"buildFlow");
484 fromJunction->addChildElement(flow);
485 toJunction->addChildElement(flow);
496 const std::string& fromTAZID,
const std::string& toTAZID) {
506 if (!fromTAZ || !toTAZ) {
511 if (type ==
nullptr) {
528 flow->
incRef(
"buildFlow");
530 fromTAZ->addChildElement(flow);
531 toTAZ->addChildElement(flow);
542 const std::string& fromEdgeID,
const std::string& toEdgeID) {
559 if (!fromEdge || !toEdge) {
564 if (type ==
nullptr) {
581 flow->
incRef(
"buildFlow");
583 fromEdge->addChildElement(flow);
584 toEdge->addChildElement(flow);
595 const std::string& fromJunctionID,
const std::string& toJunctionID) {
605 if (!fromJunction || !toJunction) {
610 if (type ==
nullptr) {
627 flow->
incRef(
"buildFlow");
629 fromJunction->addChildElement(flow);
630 toJunction->addChildElement(flow);
641 const std::string& fromTAZID,
const std::string& toTAZID) {
651 if (!fromTAZ || !toTAZ) {
656 if (type ==
nullptr) {
673 flow->
incRef(
"buildFlow");
675 fromTAZ->addChildElement(flow);
676 toTAZ->addChildElement(flow);
695 if (type ==
nullptr) {
708 person->
incRef(
"buildPerson");
728 if (type ==
nullptr) {
741 personFlow->
incRef(
"buildPersonFlow");
753 const double arrivalPos,
const std::vector<std::string>& types,
const std::vector<std::string>& modes,
754 const std::vector<std::string>& lines,
const double walkFactor,
const std::string& group) {
760 if (personParent ==
nullptr) {
763 return writeError(
TL(
"invalid combination for personTrip"));
764 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
767 arrivalPos, types, modes, lines, walkFactor, group);
778 personTrip->
incRef(
"buildPersonTrip");
789 const double arrivalPos,
const double speed,
const SUMOTime duration) {
795 if (personParent ==
nullptr) {
798 return writeError(
TL(
"invalid combination for personTrip"));
803 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
816 walk->
incRef(
"buildWalk");
827 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
833 if (personParent ==
nullptr) {
837 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
850 ride->
incRef(
"buildRide");
869 if (type ==
nullptr) {
882 container->
incRef(
"buildContainer");
902 if (type ==
nullptr) {
903 return writeError(
TLF(
"Invalid vehicle type '%' used in % '%'.", containerFlowParameters.
vtypeid,
toString(containerFlowParameters.
tag), containerFlowParameters.
id));
915 containerFlow->
incRef(
"buildContainerFlow");
927 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
933 if (containerParent ==
nullptr) {
936 return writeError(
TL(
"invalid combination for personTrip"));
937 }
else if (planParents.
checkIntegrity(tagIcon.first, containerParent, planParameters)) {
950 transport->
incRef(
"buildTransport");
961 const double arrivalPosition,
const double departPosition,
const double speed,
const SUMOTime duration) {
967 if (containerParent ==
nullptr) {
970 return writeError(
TL(
"invalid combination for personTrip"));
975 }
else if (planParents.
checkIntegrity(tagIcon.first, containerParent, planParameters)) {
978 arrivalPosition, departPosition, speed, duration);
989 tranship->
incRef(
"buildTranship");
1001 const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
1007 if (personParent ==
nullptr) {
1010 return writeError(
TL(
"invalid combination for person stop"));
1011 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
1014 endPos, duration, until, actType, friendlyPos, parameterSet);
1025 stopPlan->
incRef(
"buildPersonStop");
1036 const double endPos,
const SUMOTime duration,
1037 const SUMOTime until,
const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
1043 if (containerParent ==
nullptr) {
1046 return writeError(
TL(
"invalid combination for containerStop"));
1047 }
else if (planParents.
checkIntegrity(tagIcon.first, containerParent, planParameters)) {
1050 endPos, duration, until, actType, friendlyPos, parameterSet);
1061 stopPlan->
incRef(
"buildContainerStop");
1076 if (objParent ==
nullptr) {
1106 bool waypoint =
false;
1118 if (stopParameters.
busstop.size() > 0) {
1122 if (stoppingPlace ==
nullptr) {
1128 return writeError(
TL(
"Containers don't support stops at busStops or trainStops"));
1135 return writeError(
TL(
"Persons don't support stops at containerStops"));
1142 return writeError(
TL(
"Persons don't support stops at chargingStations"));
1144 return writeError(
TL(
"Containers don't support stops at chargingStations"));
1146 }
else if (stopParameters.
parkingarea.size() > 0) {
1151 return writeError(
TL(
"Persons don't support stops at parkingAreas"));
1153 return writeError(
TL(
"Containers don't support stops at parkingAreas"));
1155 }
else if (stopParameters.
lane.size() > 0) {
1158 }
else if (stopParameters.
edge.size() > 0) {
1162 return writeError(
TL(
"vehicles don't support stops at edges"));
1171 if (stoppingPlace && lane && edge) {
1172 return writeError(
TL(
"A stop must be defined either over a stoppingPlace, a edge or a lane"));
1173 }
else if (!stoppingPlace && !lane && !edge) {
1174 return writeError(
TL(
"A stop requires only a stoppingPlace, edge or lane"));
1175 }
else if (stoppingPlace) {
1187 stop =
new GNEStop(stopTagType,
myNet, stopParent, stoppingPlace, stopParameters);
1198 stop->
incRef(
"buildStoppingPlaceStop");
1213 stop->
incRef(
"buildLaneStop");
1229 const bool centerAfterCreation) {
1231 if (personParent ==
nullptr) {
1245 std::vector<std::string>();
1248 std::vector<std::string>();
1251 std::vector<std::string>();
1280 int parameterSet = 0;
1298 delete personPlanObject;
1306 const bool centerAfterCreation) {
1308 if (containerParent ==
nullptr) {
1325 std::vector<std::string>();
1353 int parameterSet = 0;
1371 delete containerPlanObject;
1385 planObject->
setTag(tagProperty.getTag());
1389 if (tagProperty.planFromEdge()) {
1392 if (tagProperty.planToEdge()) {
1395 if (tagProperty.planFromJunction()) {
1398 if (tagProperty.planToJunction()) {
1401 if (tagProperty.planFromTAZ()) {
1404 if (tagProperty.planToTAZ()) {
1407 if (tagProperty.planFromBusStop()) {
1410 if (tagProperty.planToBusStop()) {
1413 if (tagProperty.planFromTrainStop()) {
1416 if (tagProperty.planToTrainStop()) {
1419 if (tagProperty.planFromContainerStop()) {
1422 if (tagProperty.planToContainerStop()) {
1426 if (tagProperty.planEdge()) {
1429 if (tagProperty.planBusStop()) {
1432 if (tagProperty.planTrainStop()) {
1435 if (tagProperty.planContainerStop()) {
1439 if (tagProperty.planRoute()) {
1443 if (tagProperty.planConsecutiveEdges()) {
1455 for (
const auto& attrProperty : tagProperty) {
1457 if (attrProperty.isFloat()) {
1458 if (!originalPlan->
getAttribute(attrProperty.getAttr()).empty()) {
1461 }
else if (attrProperty.isSUMOTime()) {
1462 if (!originalPlan->
getAttribute(attrProperty.getAttr()).empty()) {
1463 planObject->
addTimeAttribute(attrProperty.getAttr(), GNEAttributeCarrier::parse<SUMOTime>(originalPlan->
getAttribute(attrProperty.getAttr())));
1465 }
else if (attrProperty.isBool()) {
1466 planObject->
addBoolAttribute(attrProperty.getAttr(), GNEAttributeCarrier::parse<bool>(originalPlan->
getAttribute(attrProperty.getAttr())));
1467 }
else if (attrProperty.isList()) {
1468 planObject->
addStringListAttribute(attrProperty.getAttr(), GNEAttributeCarrier::parse<std::vector<std::string> >(originalPlan->
getAttribute(attrProperty.getAttr())));
1475 if (tagProperty.isPlanPersonTrip()) {
1483 }
else if (tagProperty.isPlanWalk()) {
1488 }
else if (tagProperty.isPlanRide()) {
1493 }
else if (tagProperty.isPlanStopPerson()) {
1495 int parameterSet = 0;
1509 }
else if (tagProperty.isPlanTransport()) {
1514 }
else if (tagProperty.isPlanTranship()) {
1520 }
else if (tagProperty.isPlanStopContainer()) {
1522 int parameterSet = 0;
1544 for (
const auto& edgeID : via) {
1564 const auto vClass = originalVehicle->
getVClass();
1568 std::vector<GNEEdge*> routeEdges;
1583 std::vector<std::string> edgeIDs;
1584 for (
const auto& edge : routeEdges) {
1585 edgeIDs.push_back(edge->getID());
1588 if (routeEdges.empty()) {
1590 const std::string header =
"Problem transforming to vehicle";
1592 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1596 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1605 if (createEmbeddedRoute) {
1618 delete vehicleBaseOBject;
1625 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, 1.0, {});
1627 vehicleParameters.
routeid = routeID;
1634 if (inspectAfterTransform) {
1655 const auto vClass = originalVehicle->
getVClass();
1659 std::vector<GNEEdge*> routeEdges;
1674 std::vector<std::string> edgeIDs;
1675 for (
const auto& edge : routeEdges) {
1676 edgeIDs.push_back(edge->getID());
1679 if (routeEdges.empty()) {
1681 const std::string header =
"Problem transforming to vehicle";
1683 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1687 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1708 if (createEmbeddedRoute) {
1721 delete vehicleBaseOBject;
1728 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, 1.0, {});
1730 vehicleParameters.
routeid = routeID;
1737 if (inspectAfterTransform) {
1760 std::vector<GNEEdge*> edges;
1775 if (edges.size() < 2) {
1777 const std::string header =
"Problem transforming to vehicle";
1779 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1783 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1798 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1802 if (inspectAfterTransform) {
1825 std::vector<GNEEdge*> edges;
1840 if (edges.empty()) {
1842 const std::string header =
"Problem transforming to vehicle";
1844 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1848 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1875 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1879 if (inspectAfterTransform) {
1894 const std::string header =
"Problem transforming to trip over junctions";
1896 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
1900 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1923 if (inspectAfterTransform) {
1938 const std::string header =
"Problem transforming to flow over junctions";
1940 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
1944 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1976 if (inspectAfterTransform) {
1991 const std::string header =
"Problem transforming to trip over TAZs";
1993 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
1997 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
2020 if (inspectAfterTransform) {
2035 const std::string header =
"Problem transforming to flow over TAZs";
2037 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
2041 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
2073 if (inspectAfterTransform) {
2094 const auto ID = personParameters.
id;
2096 personParameters.
id =
"%dummyID%";
2100 routeHandler.
buildPerson(
nullptr, personParameters);
2113 if (inspectAfterTransform) {
2132 const auto ID = personParameters.
id;
2134 personParameters.
id =
"%dummyID%";
2141 for (
const auto& personPlan : personPlans) {
2154 if (inspectAfterTransform) {
2173 const auto ID = containerParameters.
id;
2175 containerParameters.
id =
"%dummyID%";
2181 for (
const auto& containerPlan : containerPlans) {
2192 if (inspectAfterTransform) {
2211 const auto ID = containerParameters.
id;
2213 containerParameters.
id =
"%dummyID%";
2219 for (
const auto& containerPlan : containerPlans) {
2233 if (inspectAfterTransform) {
2263 if (edges.empty()) {
2267 std::vector<GNEEdge*> reverseEdges;
2268 for (
const auto& edge : edges) {
2269 const auto oppositeEdges = edge->getOppositeEdges();
2271 if (oppositeEdges.empty()) {
2274 reverseEdges.push_back(oppositeEdges.front());
2278 std::reverse(reverseEdges.begin(), reverseEdges.end());
2312 std::vector<GNEEdge*> oppositeEdges;
2314 oppositeEdges.push_back(edge->getOppositeEdges().front());
2316 std::reverse(oppositeEdges.begin(), oppositeEdges.end());
2324 oppositeEdges.erase(oppositeEdges.begin());
2325 oppositeEdges.pop_back();
2326 if (oppositeEdges.size() > 0) {
2356 if (junction ==
nullptr) {
2367 if (
TAZ ==
nullptr) {
2377 const bool firstEdge) {
2379 if (edgeID.empty()) {
2397 if (edge ==
nullptr) {
2413 if (busStop !=
nullptr) {
2415 }
else if (trainStop !=
nullptr) {
2416 return trainStop->getParentLanes().front()->getParentEdge();
2423 if (busStop !=
nullptr) {
2425 }
else if (trainStop !=
nullptr) {
2426 return trainStop->getParentLanes().front()->getParentEdge();
2432 if (containerStop !=
nullptr) {
2440 if (containerStop !=
nullptr) {
2448 if (parkingArea !=
nullptr) {
2461 std::string edgeID = laneID;
2462 for (
int i = ((
int)laneID.size() - 1); (i >= 0) && (laneID[i + 1] !=
'_'); i--) {
2469std::vector<GNEEdge*>
2471 std::vector<GNEEdge*> edges;
2472 for (
const auto& edgeID : edgeIDs) {
2475 if (edge ==
nullptr) {
2480 edges.push_back(edge);
2490 if (type ==
nullptr) {
2511 if (personParent ==
nullptr) {
2514 return personParent;
2532 if (containerParent ==
nullptr) {
2535 return containerParent;
2542 const std::vector<std::string>& distributionElementIDs,
const std::vector<double>& probabilities,
2543 std::vector<const GNEDemandElement*>& elements) {
2545 std::string distributionTag =
toString(sumoBaseObject->
getTag());
2548 for (
const auto& distributionElementID : distributionElementIDs) {
2550 if (distributionElement) {
2551 elements.push_back(distributionElement);
2553 return writeError(
TLF(
"% with id '%' doesn't exist in % '%'",
toString(distributionElementTag), distributionElementID, distributionTag, distributionID));
2557 for (
const auto& probability : probabilities) {
2558 if (probability < 0) {
2559 return writeError(
TLF(
"invalid probability % in % '%'",
toString(probability), distributionTag, distributionID));
2563 if (elements.size() != probabilities.size()) {
2564 return writeError(
TLF(
"Invalid type distribution probabilities in % '%'. Must have the same number of elements", distributionTag, distributionID));
2573 for (
const auto& tagChecked : tags) {
2577 if (demandElement) {
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_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
begin/end of the 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
@ 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 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 writeErrorDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write error "duplicated additional"
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)
std::string fromJunction
from junction
std::string fromContainerStop
from containerStop
std::string toTrainStop
to trainStop
std::string fromTrainStop
from trainStop
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
std::string toRoute
to route
std::string toContainerStop
to containerStop
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 setVehicleParameter(const SUMOVehicleParameter *vehicleParameter)
set vehicle parameters
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 SUMOVehicleParameter & getVehicleParameter() const
get vehicle parameters
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
An Element which don't belong to GNENet but has influence in the simulation.
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
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
void addDistributionKey(const GNEDemandElement *key, const double value, GNEUndoList *undoList)
add distribution key
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
static std::pair< SumoXMLTag, GUIIcon > getPersonTripTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the personTrip tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getContainerStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the container stop tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getRideTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the ride tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getPersonStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the person stop tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getWalkTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the walk tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getTranshipTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the tranship tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getTransportTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the transport tag and icon for the combination
A road/street connecting two junctions (netedit-version)
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
void addChildElement(T *element)
add child element
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
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
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::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
double getClickedPositionOverLane() const
get clicked position over lane
const CommonXMLStructure::PlanParameters & getPlanParameteres() const
get plan parameters
GNEPlanParents (used for group all plan parents)
void addChildElements(GNEDemandElement *element)
add the given element in the element as child
bool checkIntegrity(SumoXMLTag planTag, const GNEDemandElement *parent, const CommonXMLStructure::PlanParameters &planParameters) const
check integrity between planParameters and GNE elements
void incRef(const std::string &debugMsg="")
Increase reference.
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
GNEEdge * parseStopEdge(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
parse stop edge
const bool myOverwrite
check if overwrite
bool buildTripJunctions(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromJunctionID, const std::string &toJunctionID)
build trip over junctions
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
bool buildPersonPlan(const GNEDemandElement *planTemplate, GNEDemandElement *personParent, GNEAttributesCreator *personPlanAttributes, GNEPlanCreator *planCreator, const bool centerAfterCreation)
build person plan
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
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 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
static const std::vector< SumoXMLTag > myContainerTags
container tags
GNEAdditional * parseTAZ(const SumoXMLTag tag, const std::string &id, const std::string &TAZID)
parse TAZ
static const std::vector< SumoXMLTag > myVehicleTags
vehicle tags
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
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 buildContainerPlan(const GNEDemandElement *planTemplate, GNEDemandElement *containerParent, GNEAttributesCreator *containerPlanAttributes, GNEPlanCreator *planCreator, const bool centerAfterCreation)
build container plan
static const std::vector< SumoXMLTag > myPersonTags
person tags
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
bool checkDuplicatedDemandElement(const SumoXMLTag tag, const std::vector< SumoXMLTag > tags, const std::string &id)
check if given ID correspond to a duplicated demand element
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 buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters)
build a vehicle over an existent route
bool buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const int deterministic, const std::vector< std::string > &vTypeIDs, const std::vector< double > &probabilities)
build vType distribution
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 buildRouteDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::vector< std::string > &routeIDs, const std::vector< double > &probabilities)
build route distribution
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 buildEmbeddedRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::vector< std::string > &edgeIDs, const RGBColor &color, const int repeat, const SUMOTime cycleTime, const Parameterised::Map &routeParameters)
build embedded route
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 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)
GNERouteHandler(const std::string &file, GNENet *net, const bool allowUndoRedo, const bool overwrite)
Constructor.
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
GNEAttributeCarrier * getTemplateAC(SumoXMLTag ACTag) const
get templateAC
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
GNETagSelector * getVehicleTagSelector() const
get vehicle tag selector (needed for transform vehicles)
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
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
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
std::map< std::string, std::string > Map
parameters map
static const RGBColor YELLOW
static const RGBColor INVISIBLE
Structure representing possible vehicle parameter.
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.