52 myAllowUndoRedo(allowUndoRedo),
53 myOverwrite(overwrite) {
80 vType->
incRef(
"buildVType");
88 const int deterministic,
const std::vector<std::string>& vTypes) {
95 bool checkVTypesOK =
true;
97 for (
const auto& vType : vTypes) {
100 checkVTypesOK =
false;
107 checkVTypesOK =
false;
110 checkVTypesOK =
false;
121 for (
const auto &typeID : vTypes) {
127 vTypeDistribution->
incRef(
"buildVType");
139 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
146 }
else if (edges.size() > 0) {
156 for (
const auto& edge : edges) {
157 edge->addChildElement(route);
159 route->
incRef(
"buildRoute");
180 if (type ==
nullptr) {
183 if (type ==
nullptr) {
205 for (
const auto& edge : edges) {
206 edge->addChildElement(route);
208 vehicle->
incRef(
"buildEmbeddedRoute");
209 route->
incRef(
"buildEmbeddedRoute");
221 writeError(
TL(
"netedit doesn't support route distributions"));
233 if (type ==
nullptr) {
236 if (type ==
nullptr) {
238 }
else if (route ==
nullptr) {
257 vehicle->
incRef(
"buildVehicleOverRoute");
274 if (type ==
nullptr) {
277 if (type ==
nullptr) {
279 }
else if (route ==
nullptr) {
298 flow->
incRef(
"buildFlowOverRoute");
309 const std::string& fromEdgeID,
const std::string& toEdgeID) {
322 if (type ==
nullptr) {
325 if (type ==
nullptr) {
343 trip->
incRef(
"buildTrip");
345 fromEdge->addChildElement(trip);
346 toEdge->addChildElement(trip);
357 const std::string& fromJunctionID,
const std::string& toJunctionID) {
366 if (type ==
nullptr) {
369 if (type ==
nullptr) {
387 flow->
incRef(
"buildFlow");
389 fromJunction->addChildElement(flow);
390 toJunction->addChildElement(flow);
401 const std::string& fromTAZID,
const std::string& toTAZID) {
410 if (type ==
nullptr) {
413 if (type ==
nullptr) {
431 flow->
incRef(
"buildFlow");
433 fromTAZ->addChildElement(flow);
434 toTAZ->addChildElement(flow);
445 const std::string& fromEdgeID,
const std::string& toEdgeID) {
458 if (type ==
nullptr) {
461 if (type ==
nullptr) {
479 flow->
incRef(
"buildFlow");
481 fromEdge->addChildElement(flow);
482 toEdge->addChildElement(flow);
493 const std::string& fromJunctionID,
const std::string& toJunctionID) {
502 if (type ==
nullptr) {
505 if (type ==
nullptr) {
523 flow->
incRef(
"buildFlow");
525 fromJunction->addChildElement(flow);
526 toJunction->addChildElement(flow);
537 const std::string& fromTAZID,
const std::string& toTAZID) {
546 if (type ==
nullptr) {
549 if (type ==
nullptr) {
567 flow->
incRef(
"buildFlow");
569 fromTAZ->addChildElement(flow);
570 toTAZ->addChildElement(flow);
586 if (type ==
nullptr) {
589 if (type ==
nullptr) {
603 person->
incRef(
"buildPerson");
617 if (type ==
nullptr) {
620 if (type ==
nullptr) {
634 personFlow->
incRef(
"buildPersonFlow");
643 const std::string& fromJunctionID,
const std::string& toJunctionID,
const std::string& toBusStopID,
const std::string& toTrainStopID,
644 double arrivalPos,
const std::vector<std::string>& types,
const std::vector<std::string>& modes,
const std::vector<std::string>& lines) {
656 if ((toBusStop ==
nullptr) && (toTrainStop ==
nullptr)) {
661 if ((fromEdge ==
nullptr) && previousEdge) {
662 fromEdge = previousEdge;
665 if (fromJunction ==
nullptr) {
667 fromJunction = previousEdge->getToJunction();
674 if (fromEdge && toEdge) {
688 personTrip->
incRef(
"buildPersonTripFromTo");
690 }
else if (fromEdge && toBusStop) {
704 personTrip->
incRef(
"buildPersonTripFromBusStop");
706 }
else if (fromEdge && toTrainStop) {
720 personTrip->
incRef(
"buildPersonTripFromTrainStop");
722 }
else if (fromJunction && toJunction) {
736 personTrip->
incRef(
"buildPersonTripFromTo");
745 const std::string& fromJunctionID,
const std::string& toJunctionID,
const std::string& toBusStopID,
const std::string& toTrainStopID,
746 const std::vector<std::string>& edgeIDs,
const std::string& routeID,
double arrivalPos) {
758 if ((toBusStop ==
nullptr) && (toTrainStop ==
nullptr)) {
765 edges.erase(std::unique(edges.begin(), edges.end()), edges.end());
767 if ((fromEdge ==
nullptr) && previousEdge) {
768 fromEdge = previousEdge;
771 if (fromJunction ==
nullptr) {
773 fromJunction = previousEdge->getToJunction();
780 if (edges.size() > 0) {
792 for (
const auto& edge : edges) {
793 edge->addChildElement(walk);
795 walk->
incRef(
"buildWalkEdges");
810 walk->
incRef(
"buildWalkRoute");
812 }
else if (fromEdge && toEdge) {
826 walk->
incRef(
"buildWalkFromTo");
828 }
else if (fromEdge && toBusStop) {
842 walk->
incRef(
"buildWalkFromBusStop");
844 }
else if (fromEdge && toTrainStop) {
858 walk->
incRef(
"buildWalkFromTrainStop");
860 }
else if (fromJunction && toJunction) {
874 walk->
incRef(
"buildWalkFromTo");
883 const std::string& toBusStopID,
const std::string& toTrainStopID,
double arrivalPos,
const std::vector<std::string>& lines) {
893 if ((toBusStop ==
nullptr) && (toTrainStop ==
nullptr)) {
898 if ((fromEdge ==
nullptr) && previousEdge) {
899 fromEdge = previousEdge;
902 if (personParent && fromEdge) {
917 ride->
incRef(
"buildRideFromTo");
919 }
else if (toBusStop) {
933 ride->
incRef(
"buildRideFromBusStop");
935 }
else if (toTrainStop) {
949 ride->
incRef(
"buildRideFromTrainStop");
963 if (type ==
nullptr) {
966 if (type ==
nullptr) {
980 container->
incRef(
"buildContainer");
994 if (type ==
nullptr) {
997 if (type ==
nullptr) {
1011 containerFlow->
incRef(
"buildContainerFlow");
1020 const std::string& toContainerStopID,
const std::vector<std::string>& lines,
const double arrivalPos) {
1029 if ((fromEdge ==
nullptr) && previousEdge) {
1030 fromEdge = previousEdge;
1033 if (containerParent && fromEdge) {
1048 transport->
incRef(
"buildTransportFromTo");
1050 }
else if (toContainerStop) {
1064 transport->
incRef(
"buildTransportFromContainerStop");
1073 const std::string& toContainerStopID,
const std::vector<std::string>& edgeIDs,
const double speed,
const double departPosition,
const double arrivalPosition) {
1083 edges.erase(std::unique(edges.begin(), edges.end()), edges.end());
1085 if ((fromEdge ==
nullptr) && previousEdge) {
1086 fromEdge = previousEdge;
1089 if (containerParent && (fromEdge || (edges.size() > 0))) {
1090 if (edges.size() > 0) {
1102 for (
const auto& edge : edges) {
1103 edge->addChildElement(tranship);
1105 tranship->
incRef(
"buildTranshipEdges");
1107 }
else if (toEdge) {
1121 tranship->
incRef(
"buildTranshipFromTo");
1123 }
else if (toContainerStop) {
1137 tranship->
incRef(
"buildTranshipFromContainerStop");
1166 bool waypoint =
false;
1177 bool validParentDemandElement =
true;
1179 if (stopParameters.
busstop.size() > 0) {
1183 if (stoppingPlace ==
nullptr) {
1189 writeError(
TL(
"Containers don't support stops at busStops or trainStops"));
1190 validParentDemandElement =
false;
1197 writeError(
TL(
"Persons don't support stops at containerStops"));
1198 validParentDemandElement =
false;
1205 writeError(
TL(
"Persons don't support stops at chargingStations"));
1206 validParentDemandElement =
false;
1208 writeError(
TL(
"Containers don't support stops at chargingStations"));
1209 validParentDemandElement =
false;
1211 }
else if (stopParameters.
parkingarea.size() > 0) {
1216 writeError(
TL(
"Persons don't support stops at parkingAreas"));
1217 validParentDemandElement =
false;
1219 writeError(
TL(
"Containers don't support stops at parkingAreas"));
1220 validParentDemandElement =
false;
1222 }
else if (stopParameters.
lane.size() > 0) {
1225 }
else if (stopParameters.
edge.size() > 0) {
1229 writeError(
TL(
"vehicles don't support stops at edges"));
1230 validParentDemandElement =
false;
1239 if (validParentDemandElement) {
1241 if (stoppingPlace && lane && edge) {
1242 writeError(
TL(
"A stop must be defined either over a stoppingPlace, a edge or a lane"));
1243 }
else if (!stoppingPlace && !lane && !edge) {
1244 writeError(
TL(
"A stop requires only a stoppingPlace, edge or lane"));
1245 }
else if (stoppingPlace) {
1257 stop =
new GNEStop(stopTagType,
myNet, stopParent, stoppingPlace, stopParameters);
1269 stop->
incRef(
"buildStoppingPlaceStop");
1284 stop->
incRef(
"buildLaneStop");
1304 stop->
incRef(
"buildLaneStop");
1321 personPlanObject->
setTag(tag);
1353 std::vector<std::string> edges;
1354 for (
const auto& path : pathCreator->
getPath()) {
1355 for (
const auto& edge : path.getSubPath()) {
1356 edges.push_back(edge->getID());
1366 if (fromEdge && toEdge) {
1367 buildPersonTrip(personPlanObject, fromEdge->
getID(), toEdge->
getID(),
"",
"",
"",
"", arrivalPos, types, modes, lines);
1376 if (fromEdge && toBusStop) {
1377 buildPersonTrip(personPlanObject, fromEdge->
getID(),
"",
"",
"", toBusStop->
getID(),
"", arrivalPos, types, modes, lines);
1386 if (fromEdge && toTrainStop) {
1387 buildPersonTrip(personPlanObject, fromEdge->
getID(),
"",
"",
"",
"", toTrainStop->
getID(), arrivalPos, types, modes, lines);
1396 if (fromJunction && toJunction) {
1397 buildPersonTrip(personPlanObject,
"",
"", fromJunction->
getID(), toJunction->
getID(),
"",
"", arrivalPos, types, modes, lines);
1407 if (fromEdge && toEdge) {
1408 buildWalk(personPlanObject, fromEdge->
getID(), toEdge->
getID(),
"",
"",
"",
"", {},
"", arrivalPos);
1417 if (fromEdge && toBusStop) {
1418 buildWalk(personPlanObject, fromEdge->
getID(),
"",
"",
"", toBusStop->
getID(),
"", {},
"", arrivalPos);
1427 if (fromEdge && toTrainStop) {
1428 buildWalk(personPlanObject, fromEdge->
getID(),
"",
"",
"",
"", toTrainStop->
getID(), {},
"", arrivalPos);
1437 if (edges.size() > 0) {
1438 buildWalk(personPlanObject,
"",
"",
"",
"",
"",
"", edges,
"", arrivalPos);
1448 buildWalk(personPlanObject,
"",
"",
"",
"",
"",
"", {}, route->
getID(), arrivalPos);
1457 if (fromJunction && toJunction) {
1458 buildWalk(personPlanObject,
"",
"", fromJunction->
getID(), toJunction->
getID(),
"",
"", {},
"", arrivalPos);
1468 if (fromEdge && toEdge) {
1469 buildRide(personPlanObject, fromEdge->
getID(), toEdge->
getID(),
"",
"", arrivalPos, lines);
1478 if (fromEdge && toBusStop) {
1479 buildRide(personPlanObject, fromEdge->
getID(),
"", toBusStop->
getID(),
"", arrivalPos, lines);
1488 if (fromEdge && toTrainStop) {
1489 buildRide(personPlanObject, fromEdge->
getID(),
"",
"", toTrainStop->
getID(), arrivalPos, lines);
1500 stopParameters.
edge = fromEdge->
getID();
1503 buildStop(personPlanObject, stopParameters);
1514 buildStop(personPlanObject, stopParameters);
1525 buildStop(personPlanObject, stopParameters);
1558 containerPlanObject->
setTag(tag);
1586 std::vector<std::string> edges;
1587 for (
const auto& path : pathCreator->
getPath()) {
1588 for (
const auto& edge : path.getSubPath()) {
1589 edges.push_back(edge->getID());
1597 if (fromEdge && toEdge) {
1607 if (fromEdge && toContainerStop) {
1618 if (fromEdge && toEdge) {
1628 if (fromEdge && toContainerStop) {
1629 buildTranship(containerPlanObject, fromEdge->
getID(),
"", toContainerStop->
getID(), {}, speed, departPos, arrivalPos);
1638 if (edges.size() > 0) {
1639 buildTranship(containerPlanObject,
"",
"",
"", edges, speed, departPos, arrivalPos);
1650 stopParameters.
edge = fromEdge->
getID();
1653 buildStop(containerPlanObject, stopParameters);
1662 if (toContainerStop) {
1664 buildStop(containerPlanObject, stopParameters);
1694 for (
const auto& vehicleTag : vehicleTags) {
1706 for (
const auto& edgeID : via) {
1753 const auto vClass = originalVehicle->
getVClass();
1757 std::vector<GNEEdge*> routeEdges;
1772 std::vector<std::string> edgeIDs;
1773 for (
const auto& edge : routeEdges) {
1774 edgeIDs.push_back(edge->getID());
1777 if (routeEdges.empty()) {
1779 const std::string header =
"Problem transforming to vehicle";
1781 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1785 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1794 if (createEmbeddedRoute) {
1807 delete vehicleBaseOBject;
1814 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, {});
1816 vehicleParameters.
routeid = routeID;
1823 if (inspectAfterTransform) {
1846 const auto vClass = originalVehicle->
getVClass();
1850 std::vector<GNEEdge*> routeEdges;
1865 std::vector<std::string> edgeIDs;
1866 for (
const auto& edge : routeEdges) {
1867 edgeIDs.push_back(edge->getID());
1870 if (routeEdges.empty()) {
1872 const std::string header =
"Problem transforming to vehicle";
1874 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1878 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1899 if (createEmbeddedRoute) {
1912 delete vehicleBaseOBject;
1919 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, {});
1921 vehicleParameters.
routeid = routeID;
1928 if (inspectAfterTransform) {
1953 std::vector<GNEEdge*> edges;
1968 if (edges.size() < 2) {
1970 const std::string header =
"Problem transforming to vehicle";
1972 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1976 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1991 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
1995 if (inspectAfterTransform) {
2020 std::vector<GNEEdge*> edges;
2035 if (edges.empty()) {
2037 const std::string header =
"Problem transforming to vehicle";
2039 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
2043 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
2070 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID());
2074 if (inspectAfterTransform) {
2097 const auto ID = personParameters.
id;
2099 personParameters.
id =
"%dummyID%";
2103 routeHandler.
buildPerson(
nullptr, personParameters);
2105 for (
const auto& personPlan : personPlans) {
2116 if (inspectAfterTransform) {
2138 const auto ID = personParameters.
id;
2140 personParameters.
id =
"%dummyID%";
2146 for (
const auto& personPlan : personPlans) {
2160 if (inspectAfterTransform) {
2182 const auto ID = containerParameters.
id;
2184 containerParameters.
id =
"%dummyID%";
2190 for (
const auto& containerPlan : containerPlans) {
2201 if (inspectAfterTransform) {
2223 const auto ID = containerParameters.
id;
2225 containerParameters.
id =
"%dummyID%";
2231 for (
const auto& containerPlan : containerPlans) {
2245 if (inspectAfterTransform) {
2261 if (junction ==
nullptr) {
2272 if (
TAZ ==
nullptr) {
2283 if (edge ==
nullptr) {
2290std::vector<GNEEdge*>
2292 std::vector<GNEEdge*> edges;
2293 for (
const auto& edgeID : edgeIDs) {
2296 if (edge ==
nullptr) {
2301 edges.push_back(edge);
2321 if (personParent ==
nullptr) {
2324 return personParent;
2342 if (containerParent ==
nullptr) {
2345 return containerParent;
2434 if (containerStop) {
2472 if (demandElement) {
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const std::set< std::string > DEFAULT_VTYPES
const int STOP_DURATION_SET
@ GIVEN
The lane is given.
@ GIVEN
The speed is given.
const int VEHPARS_DEPARTLANE_SET
const int VEHPARS_DEPARTSPEED_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_PERSONTRIP_JUNCTIONS
@ GNE_TAG_WAYPOINT_PARKINGAREA
waypoint placed over a parking area
@ GNE_TAG_TRANSPORT_CONTAINERSTOP
@ 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
@ GNE_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ GNE_TAG_STOP_BUSSTOP
stop placed over a busStop
@ GNE_TAG_WAYPOINT_TRAINSTOP
waypoint placed over a busStop
@ GNE_TAG_WAYPOINT_CONTAINERSTOP
waypoint placed over a containerStop
@ GNE_TAG_STOPCONTAINER_EDGE
@ GNE_TAG_WAYPOINT_BUSSTOP
waypoint placed over a busStop
@ SUMO_TAG_BUS_STOP
A bus stop.
@ GNE_TAG_WAYPOINT_CHARGINGSTATION
waypoint placed over a charging station
@ 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
@ 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_PERSONTRIP_TRAINSTOP
@ 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_WAYPOINT_LANE
waypoint placed over a lane
@ 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_PERSONTRIP_EDGE
@ GNE_TAG_STOPPERSON_EDGE
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ GNE_TAG_TRANSHIP_CONTAINERSTOP
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_CONTAINER_STOP
@ GNE_ATTR_FLOWPARAMETERS
flow parameters (integer for mask end, number, etc...)
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_VTYPE_DISTRIBUTION
vehicle type distribution
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_CONTAINERSPERHOUR
@ 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 AbstractPoly the given coordinate.
const SUMOVehicleParameter::Stop & getStopParameter() const
get stop parameters
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time 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
SumoXMLTag getTag() const
bool hasDoubleAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given double attribute
void setVehicleParameter(const SUMOVehicleParameter *vehicleParameter)
set vehicle parameters
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
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.
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
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
An Element which don't belong to GNENet but has influence in the simulation.
virtual double getAttributeDouble(SumoXMLAttr key) const =0
virtual void computePathElement()=0
compute pathElement
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
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< 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 element int GNENet 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
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEPathManager * getPathManager()
get path manager
GNEViewNet * getViewNet() const
get view net
GNEAdditional * getToStoppingPlace(SumoXMLTag expectedTag) const
get to stoppingPlace
const std::vector< GNEJunction * > & getSelectedJunctions() const
get current selected junctions
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
GNEDemandElement * getRoute() const
get route
const std::vector< Path > & getPath() const
get path route
std::vector< GNEEdge * > calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
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
bool isContainerIdDuplicated(const std::string &id)
check if there is already a container (Container or ContainerFlow) with the given ID
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
void buildRouteDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id)
build route distribution
bool checkDuplicatedDemandElement(const SumoXMLTag tag, const std::string &id)
check if given ID correspond to a duplicated demand element
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
const bool myAllowUndoRedo
allow undo/redo
GNEEdge * getPreviousPlanEdge(const bool person, const CommonXMLStructure::SumoBaseObject *obj) const
get previos person/container plan edge
void overwriteDemandElement()
remove overwrited demand element
void buildPerson(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &personParameters)
build person
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
GNENet * myNet
pointer to GNENet
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 buildTransport(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::string &toBusStopID, const std::vector< std::string > &lines, const double arrivalPos)
build transport
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
GNEEdge * parseEdge(const SumoXMLTag tag, const std::string &edgeID)
parse edge
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
GNEJunction * getPreviousPlanJunction(const bool person, const CommonXMLStructure::SumoBaseObject *obj) const
get previos person/container plan junction
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 Parameterised::Map &routeParameters)
build route
void buildFlowJunctions(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromJunctionID, const std::string &toJunctionID)
build flow over junctions
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
bool buildPersonPlan(SumoXMLTag tag, GNEDemandElement *personParent, GNEAttributesCreator *personPlanAttributes, GNEPathCreator *pathCreator, const bool centerAfterCreation)
build person plan
void buildTranship(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::string &toBusStopID, const std::vector< std::string > &edgeIDs, const double speed, const double departPosition, const double arrivalPosition)
build tranship
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
bool buildContainerPlan(SumoXMLTag tag, GNEDemandElement *containerParent, GNEAttributesCreator *containerPlanAttributes, GNEPathCreator *pathCreator, const bool centerAfterCreation)
build container plan
void buildWalk(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::string &fromJunctionID, const std::string &toJunctionID, const std::string &toBusStopID, const std::string &toTrainStopID, const std::vector< std::string > &edgeIDs, const std::string &routeID, double arrivalPos)
build walk
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
void buildFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeIDs)
build flow
GNEAdditional * parseTAZ(const SumoXMLTag tag, const std::string &TAZID)
parse TAZ
virtual ~GNERouteHandler()
Destructor.
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 buildPersonTrip(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::string &fromJunctionID, const std::string &toJunctionID, const std::string &toBusStopID, const std::string &toTrainStopID, double arrivalPos, const std::vector< std::string > &types, const std::vector< std::string > &modes, const std::vector< std::string > &lines)
build person trip
void buildRide(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::string &toBusStopID, const std::string &toTrainStopID, double arrivalPos, const std::vector< std::string > &lines)
build ride
GNEDemandElement * getContainerParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get container parent
void buildStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter::Stop &stopParameters)
build stop
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
GNEDemandElement * myDemandToOverwrite
demand to overwrite (using undor-redo
void buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const int deterministic, const std::vector< std::string > &vTypes)
build vType distribution
GNERouteHandler(const std::string &file, GNENet *net, const bool allowUndoRedo, const bool overwrite)
Constructor.
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
bool isContainer() const
return true if tag correspond to a container element
bool hasEmbeddedRoute() const
return true if tag correspond to an element that owns an embedded route
bool isVehicle() const
return true if tag correspond to a vehicle element
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isPerson() const
return true if tag correspond to a person element
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
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
void setStatusBarText(const std::string &text)
set statusBar text
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
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
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
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 (used only in netedit)
std::string lane
The lane to stop at.
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 parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
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.
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)
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.
bool wasSet(int what) const
Returns whether the given parameter was set.