55 myAllowUndoRedo(allowUndoRedo),
56 myOverwrite(overwrite) {
85 if (vTypeDistribution) {
91 if (vTypeDistribution) {
94 vType->
incRef(
"buildVType");
102 const std::vector<std::string>& vTypeIDs,
const std::vector<double>& probabilities) {
104 std::vector<const GNEDemandElement*> vTypes;
116 for (
int i = 0; i < (int)vTypes.size(); i++) {
123 for (
int i = 0; i < (int)vTypes.size(); i++) {
126 vTypeDistribution->
incRef(
"buildVTypeDistribution");
134 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
141 }
else if (edges.size() > 0) {
153 if (routeDistribution) {
159 for (
const auto& edge : edges) {
160 edge->addChildElement(route);
162 if (routeDistribution) {
165 route->
incRef(
"buildRoute");
185 if (type ==
nullptr) {
207 for (
const auto& edge : edges) {
208 edge->addChildElement(route);
210 vehicle->
incRef(
"buildEmbeddedRoute");
211 route->
incRef(
"buildEmbeddedRoute");
220 const std::vector<std::string>& routeIDs,
const std::vector<double>& probabilities) {
222 std::vector<const GNEDemandElement*> routes;
234 for (
int i = 0; i < (int)routes.size(); i++) {
241 for (
int i = 0; i < (int)routes.size(); i++) {
244 routeDistribution->
incRef(
"buildRouteDistribution");
257 if (type ==
nullptr) {
259 }
else if (route ==
nullptr) {
278 vehicle->
incRef(
"buildVehicleOverRoute");
292 if (type ==
nullptr) {
294 }
else if (route ==
nullptr) {
313 flow->
incRef(
"buildFlowOverRoute");
322 const std::string& fromEdgeID,
const std::string& toEdgeID) {
334 if (type ==
nullptr) {
352 trip->
incRef(
"buildTrip");
354 fromEdge->addChildElement(trip);
355 toEdge->addChildElement(trip);
364 const std::string& fromJunctionID,
const std::string& toJunctionID) {
372 if (type ==
nullptr) {
390 flow->
incRef(
"buildFlow");
392 fromJunction->addChildElement(flow);
393 toJunction->addChildElement(flow);
402 const std::string& fromTAZID,
const std::string& toTAZID) {
410 if (type ==
nullptr) {
428 flow->
incRef(
"buildFlow");
430 fromTAZ->addChildElement(flow);
431 toTAZ->addChildElement(flow);
440 const std::string& fromEdgeID,
const std::string& toEdgeID) {
452 if (type ==
nullptr) {
470 flow->
incRef(
"buildFlow");
472 fromEdge->addChildElement(flow);
473 toEdge->addChildElement(flow);
482 const std::string& fromJunctionID,
const std::string& toJunctionID) {
490 if (type ==
nullptr) {
508 flow->
incRef(
"buildFlow");
510 fromJunction->addChildElement(flow);
511 toJunction->addChildElement(flow);
520 const std::string& fromTAZID,
const std::string& toTAZID) {
528 if (type ==
nullptr) {
546 flow->
incRef(
"buildFlow");
548 fromTAZ->addChildElement(flow);
549 toTAZ->addChildElement(flow);
562 if (type ==
nullptr) {
576 person->
incRef(
"buildPerson");
589 if (type ==
nullptr) {
603 personFlow->
incRef(
"buildPersonFlow");
612 const double arrivalPos,
const std::vector<std::string>& types,
const std::vector<std::string>& modes,
613 const std::vector<std::string>& lines,
const double walkFactor,
const std::string& group) {
619 if (personParent ==
nullptr) {
623 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
626 arrivalPos, types, modes, lines, walkFactor, group);
638 personTrip->
incRef(
"buildPersonTrip");
646 const double arrivalPos,
const double speed,
const SUMOTime duration) {
652 if (personParent ==
nullptr) {
656 }
else if (speed < 0) {
658 }
else if (duration < 0) {
660 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
674 walk->
incRef(
"buildWalk");
682 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
688 if (personParent ==
nullptr) {
692 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
706 ride->
incRef(
"buildRide");
718 if (type ==
nullptr) {
732 container->
incRef(
"buildContainer");
745 if (type ==
nullptr) {
759 containerFlow->
incRef(
"buildContainerFlow");
768 const double arrivalPos,
const std::vector<std::string>& lines,
const std::string& group) {
774 if (containerParent ==
nullptr) {
778 }
else if (planParents.
checkIntegrity(tagIcon.first, containerParent, planParameters)) {
792 transport->
incRef(
"buildTransport");
800 const double arrivalPosition,
const double departPosition,
const double speed,
const SUMOTime duration) {
806 if (containerParent ==
nullptr) {
810 }
else if (speed < 0) {
812 }
else if (duration < 0) {
814 }
else if (planParents.
checkIntegrity(tagIcon.first, containerParent, planParameters)) {
817 arrivalPosition, departPosition, speed, duration);
829 tranship->
incRef(
"buildTranship");
838 const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
844 if (personParent ==
nullptr) {
848 }
else if (planParents.
checkIntegrity(tagIcon.first, personParent, planParameters)) {
851 endPos, duration, until, actType, friendlyPos, parameterSet);
863 stopPlan->
incRef(
"buildPersonStop");
871 const double endPos,
const SUMOTime duration,
872 const SUMOTime until,
const std::string& actType,
const bool friendlyPos,
const int parameterSet) {
878 if (containerParent ==
nullptr) {
882 }
else if (planParents.
checkIntegrity(tagIcon.first, containerParent, planParameters)) {
885 endPos, duration, until, actType, friendlyPos, parameterSet);
897 stopPlan->
incRef(
"buildContainerStop");
909 if (objParent ==
nullptr) {
939 bool waypoint =
false;
950 bool validParentDemandElement =
true;
952 if (stopParameters.
busstop.size() > 0) {
956 if (stoppingPlace ==
nullptr) {
962 writeError(
TL(
"Containers don't support stops at busStops or trainStops"));
963 validParentDemandElement =
false;
970 writeError(
TL(
"Persons don't support stops at containerStops"));
971 validParentDemandElement =
false;
978 writeError(
TL(
"Persons don't support stops at chargingStations"));
979 validParentDemandElement =
false;
981 writeError(
TL(
"Containers don't support stops at chargingStations"));
982 validParentDemandElement =
false;
984 }
else if (stopParameters.
parkingarea.size() > 0) {
989 writeError(
TL(
"Persons don't support stops at parkingAreas"));
990 validParentDemandElement =
false;
992 writeError(
TL(
"Containers don't support stops at parkingAreas"));
993 validParentDemandElement =
false;
995 }
else if (stopParameters.
lane.size() > 0) {
998 }
else if (stopParameters.
edge.size() > 0) {
1002 writeError(
TL(
"vehicles don't support stops at edges"));
1003 validParentDemandElement =
false;
1012 if (validParentDemandElement) {
1014 if (stoppingPlace && lane && edge) {
1015 writeError(
TL(
"A stop must be defined either over a stoppingPlace, a edge or a lane"));
1016 }
else if (!stoppingPlace && !lane && !edge) {
1017 writeError(
TL(
"A stop requires only a stoppingPlace, edge or lane"));
1018 }
else if (stoppingPlace) {
1030 stop =
new GNEStop(stopTagType,
myNet, stopParent, stoppingPlace, stopParameters);
1042 stop->
incRef(
"buildStoppingPlaceStop");
1057 stop->
incRef(
"buildLaneStop");
1069 const bool centerAfterCreation) {
1071 if (personParent ==
nullptr) {
1085 std::vector<std::string>();
1088 std::vector<std::string>();
1091 std::vector<std::string>();
1120 int parameterSet = 0;
1138 delete personPlanObject;
1146 const bool centerAfterCreation) {
1148 if (containerParent ==
nullptr) {
1165 std::vector<std::string>();
1193 int parameterSet = 0;
1211 delete containerPlanObject;
1225 planObject->
setTag(tagProperty.getTag());
1229 if (tagProperty.planFromEdge()) {
1232 if (tagProperty.planToEdge()) {
1235 if (tagProperty.planFromJunction()) {
1238 if (tagProperty.planToJunction()) {
1241 if (tagProperty.planFromTAZ()) {
1244 if (tagProperty.planToTAZ()) {
1247 if (tagProperty.planFromBusStop()) {
1250 if (tagProperty.planToBusStop()) {
1253 if (tagProperty.planFromTrainStop()) {
1256 if (tagProperty.planToTrainStop()) {
1259 if (tagProperty.planFromContainerStop()) {
1262 if (tagProperty.planToContainerStop()) {
1266 if (tagProperty.planEdge()) {
1269 if (tagProperty.planBusStop()) {
1272 if (tagProperty.planTrainStop()) {
1275 if (tagProperty.planContainerStop()) {
1279 if (tagProperty.planRoute()) {
1283 if (tagProperty.planConsecutiveEdges()) {
1295 for (
const auto& attrProperty : tagProperty) {
1297 if (attrProperty.isFloat()) {
1298 if (!originalPlan->
getAttribute(attrProperty.getAttr()).empty()) {
1301 }
else if (attrProperty.isSUMOTime()) {
1302 if (!originalPlan->
getAttribute(attrProperty.getAttr()).empty()) {
1303 planObject->
addTimeAttribute(attrProperty.getAttr(), GNEAttributeCarrier::parse<SUMOTime>(originalPlan->
getAttribute(attrProperty.getAttr())));
1305 }
else if (attrProperty.isBool()) {
1306 planObject->
addBoolAttribute(attrProperty.getAttr(), GNEAttributeCarrier::parse<bool>(originalPlan->
getAttribute(attrProperty.getAttr())));
1307 }
else if (attrProperty.isList()) {
1308 planObject->
addStringListAttribute(attrProperty.getAttr(), GNEAttributeCarrier::parse<std::vector<std::string> >(originalPlan->
getAttribute(attrProperty.getAttr())));
1315 if (tagProperty.isPlanPersonTrip()) {
1323 }
else if (tagProperty.isPlanWalk()) {
1328 }
else if (tagProperty.isPlanRide()) {
1333 }
else if (tagProperty.isPlanStopPerson()) {
1335 int parameterSet = 0;
1349 }
else if (tagProperty.isPlanTransport()) {
1354 }
else if (tagProperty.isPlanTranship()) {
1360 }
else if (tagProperty.isPlanStopContainer()) {
1362 int parameterSet = 0;
1385 const std::vector<SumoXMLTag> vehicleTags = {
1393 for (
const auto& vehicleTag : vehicleTags) {
1405 for (
const auto& edgeID : via) {
1418 for (
const auto& personTag : personTags) {
1431 for (
const auto& containerTag : containerTags) {
1452 const auto vClass = originalVehicle->
getVClass();
1456 std::vector<GNEEdge*> routeEdges;
1471 std::vector<std::string> edgeIDs;
1472 for (
const auto& edge : routeEdges) {
1473 edgeIDs.push_back(edge->getID());
1476 if (routeEdges.empty()) {
1478 const std::string header =
"Problem transforming to vehicle";
1480 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1484 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1493 if (createEmbeddedRoute) {
1506 delete vehicleBaseOBject;
1513 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, 1.0, {});
1515 vehicleParameters.
routeid = routeID;
1522 if (inspectAfterTransform) {
1543 const auto vClass = originalVehicle->
getVClass();
1547 std::vector<GNEEdge*> routeEdges;
1562 std::vector<std::string> edgeIDs;
1563 for (
const auto& edge : routeEdges) {
1564 edgeIDs.push_back(edge->getID());
1567 if (routeEdges.empty()) {
1569 const std::string header =
"Problem transforming to vehicle";
1571 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1575 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1596 if (createEmbeddedRoute) {
1609 delete vehicleBaseOBject;
1616 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, 1.0, {});
1618 vehicleParameters.
routeid = routeID;
1625 if (inspectAfterTransform) {
1648 std::vector<GNEEdge*> edges;
1663 if (edges.size() < 2) {
1665 const std::string header =
"Problem transforming to vehicle";
1667 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1671 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1686 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1690 if (inspectAfterTransform) {
1713 std::vector<GNEEdge*> edges;
1728 if (edges.empty()) {
1730 const std::string header =
"Problem transforming to vehicle";
1732 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1736 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1763 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1767 if (inspectAfterTransform) {
1782 const std::string header =
"Problem transforming to trip over junctions";
1784 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
1788 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1811 if (inspectAfterTransform) {
1826 const std::string header =
"Problem transforming to flow over junctions";
1828 const std::string message =
"Vehicle cannot be transformed. Invalid number of junctions";
1832 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1864 if (inspectAfterTransform) {
1879 const std::string header =
"Problem transforming to trip over TAZs";
1881 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
1885 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1908 if (inspectAfterTransform) {
1923 const std::string header =
"Problem transforming to flow over TAZs";
1925 const std::string message =
"Vehicle cannot be transformed. Invalid number of TAZs";
1929 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1961 if (inspectAfterTransform) {
1982 const auto ID = personParameters.
id;
1984 personParameters.
id =
"%dummyID%";
1988 routeHandler.
buildPerson(
nullptr, personParameters);
2001 if (inspectAfterTransform) {
2020 const auto ID = personParameters.
id;
2022 personParameters.
id =
"%dummyID%";
2029 for (
const auto& personPlan : personPlans) {
2042 if (inspectAfterTransform) {
2061 const auto ID = containerParameters.
id;
2063 containerParameters.
id =
"%dummyID%";
2069 for (
const auto& containerPlan : containerPlans) {
2080 if (inspectAfterTransform) {
2099 const auto ID = containerParameters.
id;
2101 containerParameters.
id =
"%dummyID%";
2107 for (
const auto& containerPlan : containerPlans) {
2121 if (inspectAfterTransform) {
2151 if (edges.empty()) {
2155 std::vector<GNEEdge*> reverseEdges;
2156 for (
const auto& edge : edges) {
2157 const auto oppositeEdges = edge->getOppositeEdges();
2159 if (oppositeEdges.empty()) {
2162 reverseEdges.push_back(oppositeEdges.front());
2166 std::reverse(reverseEdges.begin(), reverseEdges.end());
2200 std::vector<GNEEdge*> oppositeEdges;
2202 oppositeEdges.push_back(edge->getOppositeEdges().front());
2204 std::reverse(oppositeEdges.begin(), oppositeEdges.end());
2212 oppositeEdges.erase(oppositeEdges.begin());
2213 oppositeEdges.pop_back();
2214 if (oppositeEdges.size() > 0) {
2244 if (junction ==
nullptr) {
2255 if (
TAZ ==
nullptr) {
2265 const bool firstEdge) {
2267 if (edgeID.empty()) {
2285 if (edge ==
nullptr) {
2301 if (busStop !=
nullptr) {
2303 }
else if (trainStop !=
nullptr) {
2304 return trainStop->getParentLanes().front()->getParentEdge();
2311 if (busStop !=
nullptr) {
2313 }
else if (trainStop !=
nullptr) {
2314 return trainStop->getParentLanes().front()->getParentEdge();
2320 if (containerStop !=
nullptr) {
2328 if (containerStop !=
nullptr) {
2336 if (parkingArea !=
nullptr) {
2349 std::string edgeID = laneID;
2350 for (
int i = ((
int)laneID.size() - 1); (i >= 0) && (laneID[i + 1] !=
'_'); i--) {
2357std::vector<GNEEdge*>
2359 std::vector<GNEEdge*> edges;
2360 for (
const auto& edgeID : edgeIDs) {
2363 if (edge ==
nullptr) {
2368 edges.push_back(edge);
2378 if (type ==
nullptr) {
2399 if (personParent ==
nullptr) {
2402 return personParent;
2420 if (containerParent ==
nullptr) {
2423 return containerParent;
2430 const std::vector<std::string>& distributionElementIDs,
const std::vector<double>& probabilities,
2431 std::vector<const GNEDemandElement*>& elements) {
2433 std::string distributionTag =
toString(sumoBaseObject->
getTag());
2436 for (
const auto& distributionElementID : distributionElementIDs) {
2438 if (distributionElement) {
2439 elements.push_back(distributionElement);
2441 writeError(
TLF(
"% with id '%' doesn't exist in % '%'",
toString(distributionElementTag), distributionElementID, distributionTag, distributionID));
2447 for (
const auto& probability : probabilities) {
2448 if (probability < 0) {
2449 writeError(
TLF(
"invalid probability % in % '%'",
toString(probability), distributionTag, distributionID));
2454 if (elements.size() != probabilities.size()) {
2455 writeError(
TLF(
"Invalid type distribution probabilities in % '%'. Must have the same number of elements", distributionTag, distributionID));
2468 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
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ 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.
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 inspectSingleElement(GNEAttributeCarrier *AC)
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
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
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)
bool isRoute() const
check if pathElement is a route
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..)
void buildTrip(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeID)
build trip
void 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
bool isContainerIdDuplicated(const std::string &id)
check if there is already a container (Container or ContainerFlow) with the given ID
GNEEdge * parseStopEdge(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
parse stop edge
const bool myOverwrite
check if overwrite
bool isVehicleIdDuplicated(const std::string &id)
check if there is already a vehicle (Vehicle, Trip, Flow or Flow) with the given ID
void buildContainerFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &containerFlowParameters)
build container flow
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
bool checkDuplicatedDemandElement(const SumoXMLTag tag, const std::string &id)
check if given ID correspond to a duplicated demand element
bool buildPersonPlan(const GNEDemandElement *planTemplate, GNEDemandElement *personParent, GNEAttributesCreator *personPlanAttributes, GNEPlanCreator *planCreator, const bool centerAfterCreation)
build person plan
CommonXMLStructure::SumoBaseObject * myPlanObject
pointer for person and container plans
GNEDemandElement * getPersonParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get person parent
GNEJunction * parseJunction(const SumoXMLTag tag, const std::string &junctionID)
parse junction
void writeErrorInvalidNegativeValue(const SumoXMLTag tag, const SumoXMLAttr attribute)
write error "invalid negative element"
const bool myAllowUndoRedo
allow undo/redo
void overwriteDemandElement()
remove overwritten demand element
GNEEdge * parseEdgeFromLaneID(const std::string &laneID) const
parse edge from lane ID
void buildPerson(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &personParameters)
build person
void 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
void buildFlowTAZs(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromTAZID, const std::string &toTAZID)
build flow over junctions
bool isPersonIdDuplicated(const std::string &id)
check if there is already a person (Person or PersonFlow) with the given ID
static void transformToContainerFlow(GNEContainer *originalContainer)
transform routeFlow over an existent route
void buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters)
build a vehicle over an existent route
void buildWalk(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const double speed, const SUMOTime duration)
build walk
GNEEdge * parseEdge(const SumoXMLTag tag, const std::string &edgeID, const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const bool firstEdge)
parse edge
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
void buildTripTAZs(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromTAZID, const std::string &toTAZID)
build trip over TAZs
void buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters)
build a flow over an existent route
void buildTripJunctions(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromJunctionID, const std::string &toJunctionID)
build trip over junctions
void 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
void 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
void buildFlowJunctions(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromJunctionID, const std::string &toJunctionID)
build flow over junctions
static bool canReverse(const GNEDemandElement *element)
reverse functions
bool isViaAttributeValid(const std::vector< std::string > &via)
check if via attribute is valid
void buildVType(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVTypeParameter &vTypeParameter)
build vType
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
void buildRouteDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::vector< std::string > &routeIDs, const std::vector< double > &probabilities)
build route distribution
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
void buildRide(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const std::vector< std::string > &lines, const std::string &group)
build ride
void buildFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeIDs)
build flow
bool buildContainerPlan(const GNEDemandElement *planTemplate, GNEDemandElement *containerParent, GNEAttributesCreator *containerPlanAttributes, GNEPlanCreator *planCreator, const bool centerAfterCreation)
build container plan
GNEAdditional * parseTAZ(const SumoXMLTag tag, const std::string &TAZID)
parse TAZ
GNEDemandElement * getType(const std::string &id) const
get type (Either type o typeDistribution)
virtual ~GNERouteHandler()
Destructor.
void buildTranship(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPosition, const double departPosition, const double speed, const SUMOTime duration)
build tranship
void 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
void buildPersonFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &personFlowParameters)
build person flow
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::vector< std::string > &edgeIDs)
parse edges
void buildTransport(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const double arrivalPos, const std::vector< std::string > &lines, const std::string &group)
build transport
void buildStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const CommonXMLStructure::PlanParameters &planParameters, const SUMOVehicleParameter::Stop &stopParameters)
build stop
GNEDemandElement * getContainerParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get container parent
static void reverse(GNEDemandElement *element)
reverse given demand element
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
void buildContainer(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &containerParameters)
build container
static void transformToPersonFlow(GNEPerson *originalPerson)
transform routeFlow over an existent 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
void 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
GNEDemandElement * myDemandToOverwrite
demand to overwrite (using undo-redo
static void transformToFlowTAZs(GNEVehicle *originalVehicle)
transform to flow over TAZs
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 void 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
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
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
void writeError(const std::string &error)
write error and enable error creating element
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.