52 myAllowUndoRedo(allowUndoRedo),
53 myOverwrite(overwrite) {
80 if (vTypeDistribution) {
86 if (vTypeDistribution) {
89 vType->
incRef(
"buildVType");
97 const int deterministic,
const std::vector<std::string>& vTypes) {
104 bool checkVTypesOK =
true;
106 for (
const auto& vType : vTypes) {
109 checkVTypesOK =
false;
116 checkVTypesOK =
false;
119 checkVTypesOK =
false;
130 for (
const auto& vTypeID : vTypes) {
137 vTypeDistribution->
incRef(
"buildVType");
138 for (
const auto& vTypeID : vTypes) {
150 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
157 }
else if (edges.size() > 0) {
167 for (
const auto& edge : edges) {
168 edge->addChildElement(route);
170 route->
incRef(
"buildRoute");
190 if (vType ==
nullptr) {
191 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
212 for (
const auto& edge : edges) {
213 edge->addChildElement(route);
215 route->
incRef(
"buildRoute");
227 writeError(
"NETEDIT doesn't support route distributions");
238 if (vType ==
nullptr) {
239 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
240 }
else if (route ==
nullptr) {
259 vehicle->
incRef(
"buildVehicleOverRoute");
275 if (vType ==
nullptr) {
276 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
277 }
else if (route ==
nullptr) {
296 flow->
incRef(
"buildFlowOverRoute");
307 const std::string& fromEdgeID,
const std::string& toEdgeID,
const std::vector<std::string>& viaIDs) {
316 if (vType ==
nullptr) {
317 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
324 for (
const auto& viaEdge : via) {
325 vehicleParameters.
via.push_back(viaEdge->getID());
338 trip->
incRef(
"buildTrip");
340 fromEdge->addChildElement(trip);
341 toEdge->addChildElement(trip);
342 for (
const auto& viaEdge : via) {
343 viaEdge->addChildElement(trip);
355 const std::string& fromJunctionID,
const std::string& toJunctionID) {
363 if (vType ==
nullptr) {
364 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
381 flow->
incRef(
"buildFlow");
383 fromJunction->addChildElement(flow);
384 toJunction->addChildElement(flow);
394 const std::string& fromEdgeID,
const std::string& toEdgeID,
const std::vector<std::string>& viaIDs) {
403 if (vType ==
nullptr) {
404 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
411 for (
const auto& viaEdge : via) {
412 vehicleParameters.
via.push_back(viaEdge->getID());
425 flow->
incRef(
"buildFlow");
427 fromEdge->addChildElement(flow);
428 toEdge->addChildElement(flow);
429 for (
const auto& viaEdge : via) {
430 viaEdge->addChildElement(flow);
442 const std::string& fromJunctionID,
const std::string& toJunctionID) {
450 if (vType ==
nullptr) {
451 writeError(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
468 flow->
incRef(
"buildFlow");
470 fromJunction->addChildElement(flow);
471 toJunction->addChildElement(flow);
486 if (type ==
nullptr) {
487 writeError(
"Invalid person type '" + personParameters.
vtypeid +
"' used in " +
toString(personParameters.
tag) +
" '" + personParameters.
id +
"'.");
500 person->
incRef(
"buildPerson");
513 if (type ==
nullptr) {
514 writeError(
"Invalid personFlow type '" + personFlowParameters.
vtypeid +
"' used in " +
toString(personFlowParameters.
tag) +
" '" + personFlowParameters.
id +
"'.");
527 personFlow->
incRef(
"buildPersonFlow");
536 const std::string& fromJunctionID,
const std::string& toJunctionID,
const std::string& toBusStopID,
double arrivalPos,
537 const std::vector<std::string>& types,
const std::vector<std::string>& modes,
const std::vector<std::string>& lines) {
548 if ((fromEdge ==
nullptr) && previousEdge) {
549 fromEdge = previousEdge;
552 if (fromJunction ==
nullptr) {
554 fromJunction = previousEdge->getToJunction();
561 if (fromEdge && toEdge) {
575 personTrip->
incRef(
"buildPersonTripFromTo");
577 }
else if (fromEdge && toBusStop) {
591 personTrip->
incRef(
"buildPersonTripFromBusStop");
593 }
else if (fromJunction && toJunction) {
607 personTrip->
incRef(
"buildPersonTripFromTo");
616 const std::string& fromJunctionID,
const std::string& toJunctionID,
const std::string& toBusStopID,
617 const std::vector<std::string>& edgeIDs,
const std::string& routeID,
double arrivalPos) {
630 edges.erase(std::unique(edges.begin(), edges.end()), edges.end());
632 if ((fromEdge ==
nullptr) && previousEdge) {
633 fromEdge = previousEdge;
636 if (fromJunction ==
nullptr) {
638 fromJunction = previousEdge->getToJunction();
645 if (edges.size() > 0) {
657 for (
const auto& edge : edges) {
658 edge->addChildElement(walk);
660 walk->
incRef(
"buildWalkEdges");
675 walk->
incRef(
"buildWalkRoute");
677 }
else if (fromEdge && toEdge) {
691 walk->
incRef(
"buildWalkFromTo");
693 }
else if (fromEdge && toBusStop) {
707 walk->
incRef(
"buildWalkFromBusStop");
709 }
else if (fromJunction && toJunction) {
723 walk->
incRef(
"buildWalkFromTo");
732 const std::string& toBusStopID,
double arrivalPos,
const std::vector<std::string>& lines) {
741 if ((fromEdge ==
nullptr) && previousEdge) {
742 fromEdge = previousEdge;
745 if (personParent && fromEdge) {
760 ride->
incRef(
"buildRideFromTo");
762 }
else if (toBusStop) {
776 ride->
incRef(
"buildRideFromBusStop");
789 if (type ==
nullptr) {
790 writeError(
"Invalid container type '" + containerParameters.
vtypeid +
"' used in " +
toString(containerParameters.
tag) +
" '" + containerParameters.
id +
"'.");
803 container->
incRef(
"buildContainer");
816 if (type ==
nullptr) {
817 writeError(
"Invalid containerFlow type '" + containerFlowParameters.
vtypeid +
"' used in " +
toString(containerFlowParameters.
tag) +
" '" + containerFlowParameters.
id +
"'.");
830 containerFlow->
incRef(
"buildContainerFlow");
839 const std::string& toContainerStopID,
const std::vector<std::string>& lines,
const double arrivalPos) {
848 if ((fromEdge ==
nullptr) && previousEdge) {
849 fromEdge = previousEdge;
852 if (containerParent && fromEdge) {
867 transport->
incRef(
"buildTransportFromTo");
869 }
else if (toContainerStop) {
883 transport->
incRef(
"buildTransportFromContainerStop");
892 const std::string& toContainerStopID,
const std::vector<std::string>& edgeIDs,
const double speed,
const double departPosition,
const double arrivalPosition) {
902 edges.erase(std::unique(edges.begin(), edges.end()), edges.end());
904 if ((fromEdge ==
nullptr) && previousEdge) {
905 fromEdge = previousEdge;
908 if (containerParent && (fromEdge || (edges.size() > 0))) {
909 if (edges.size() > 0) {
921 for (
const auto& edge : edges) {
922 edge->addChildElement(tranship);
924 tranship->
incRef(
"buildTranshipEdges");
940 tranship->
incRef(
"buildTranshipFromTo");
942 }
else if (toContainerStop) {
956 tranship->
incRef(
"buildTranshipFromContainerStop");
985 bool waypoint =
false;
996 bool validParentDemandElement =
true;
998 if (stopParameters.
busstop.size() > 0) {
1003 writeError(
"Containers don't support stops at busStops");
1004 validParentDemandElement =
false;
1011 writeError(
"Persons don't support stops at containerStops");
1012 validParentDemandElement =
false;
1019 writeError(
"Persons don't support stops at chargingStations");
1020 validParentDemandElement =
false;
1022 writeError(
"Containers don't support stops at chargingStations");
1023 validParentDemandElement =
false;
1025 }
else if (stopParameters.
parkingarea.size() > 0) {
1030 writeError(
"Persons don't support stops at parkingAreas");
1031 validParentDemandElement =
false;
1033 writeError(
"Containers don't support stops at parkingAreas");
1034 validParentDemandElement =
false;
1036 }
else if (stopParameters.
lane.size() > 0) {
1039 }
else if (stopParameters.
edge.size() > 0) {
1043 writeError(
"vehicles don't support stops at edges");
1044 validParentDemandElement =
false;
1053 if (validParentDemandElement) {
1055 if (stoppingPlace && lane && edge) {
1056 writeError(
"A stop must be defined either over a stoppingPlace, a edge or a lane");
1057 }
else if (!stoppingPlace && !lane && !edge) {
1058 writeError(
"A stop requires only a stoppingPlace, edge or lane");
1059 }
else if (stoppingPlace) {
1067 stop =
new GNEStop(stopTagType,
myNet, stopParent, stoppingPlace, stopParameters);
1079 stop->
incRef(
"buildStoppingPlaceStop");
1094 stop->
incRef(
"buildLaneStop");
1114 stop->
incRef(
"buildLaneStop");
1131 personPlanObject->
setTag(tag);
1162 std::vector<std::string> edges;
1163 for (
const auto& path : pathCreator->
getPath()) {
1164 for (
const auto& edge : path.getSubPath()) {
1165 edges.push_back(edge->getID());
1175 if (fromEdge && toEdge) {
1185 if (fromEdge && toBusStop) {
1195 if (fromJunction && toJunction) {
1196 buildPersonTrip(personPlanObject,
"",
"", fromJunction->
getID(), toJunction->
getID(),
"", arrivalPos, types, modes, lines);
1206 if (fromEdge && toEdge) {
1207 buildWalk(personPlanObject, fromEdge->
getID(), toEdge->
getID(),
"",
"",
"", {},
"", arrivalPos);
1216 if (fromEdge && toBusStop) {
1217 buildWalk(personPlanObject, fromEdge->
getID(),
"",
"",
"", toBusStop->
getID(), {},
"", arrivalPos);
1226 if (edges.size() > 0) {
1227 buildWalk(personPlanObject,
"",
"",
"",
"",
"", edges,
"", arrivalPos);
1237 buildWalk(personPlanObject,
"",
"",
"",
"",
"", {}, route->
getID(), arrivalPos);
1246 if (fromJunction && toJunction) {
1247 buildWalk(personPlanObject,
"",
"", fromJunction->
getID(), toJunction->
getID(),
"", {},
"", arrivalPos);
1257 if (fromEdge && toEdge) {
1267 if (fromEdge && toBusStop) {
1268 buildRide(personPlanObject, fromEdge->
getID(),
"", toBusStop->
getID(), arrivalPos, lines);
1279 stopParameters.
edge = fromEdge->
getID();
1282 buildStop(personPlanObject, stopParameters);
1293 buildStop(personPlanObject, stopParameters);
1326 containerPlanObject->
setTag(tag);
1354 std::vector<std::string> edges;
1355 for (
const auto& path : pathCreator->
getPath()) {
1356 for (
const auto& edge : path.getSubPath()) {
1357 edges.push_back(edge->getID());
1365 if (fromEdge && toEdge) {
1375 if (fromEdge && toContainerStop) {
1386 if (fromEdge && toEdge) {
1396 if (fromEdge && toContainerStop) {
1397 buildTranship(containerPlanObject, fromEdge->
getID(),
"", toContainerStop->
getID(), {}, speed, departPos, arrivalPos);
1406 if (edges.size() > 0) {
1407 buildTranship(containerPlanObject,
"",
"",
"", edges, speed, departPos, arrivalPos);
1418 stopParameters.
edge = fromEdge->
getID();
1421 buildStop(containerPlanObject, stopParameters);
1430 if (toContainerStop) {
1432 buildStop(containerPlanObject, stopParameters);
1461 for (
const auto& vehicleTag : vehicleTags) {
1463 writeError(
"There is another " +
toString(vehicleTag) +
" with the same ID='" +
id +
"'.");
1475 writeError(
"There is another " +
toString(personTag) +
" with the same ID='" +
id +
"'.");
1487 writeError(
"There is another " +
toString(containerTag) +
" with the same ID='" +
id +
"'.");
1508 const auto vClass = originalVehicle->
getVClass();
1512 std::vector<GNEEdge*> routeEdges;
1527 std::vector<std::string> edgeIDs;
1528 for (
const auto& edge : routeEdges) {
1529 edgeIDs.push_back(edge->getID());
1532 if (routeEdges.empty()) {
1534 const std::string header =
"Problem transforming to vehicle";
1536 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1540 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1549 if (createEmbeddedRoute) {
1562 delete vehicleBaseOBject;
1569 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, {});
1571 vehicleParameters.
routeid = routeID;
1578 if (inspectAfterTransform) {
1601 const auto vClass = originalVehicle->
getVClass();
1605 std::vector<GNEEdge*> routeEdges;
1620 std::vector<std::string> edgeIDs;
1621 for (
const auto& edge : routeEdges) {
1622 edgeIDs.push_back(edge->getID());
1625 if (routeEdges.empty()) {
1627 const std::string header =
"Problem transforming to vehicle";
1629 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1633 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1654 if (createEmbeddedRoute) {
1667 delete vehicleBaseOBject;
1674 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, {});
1676 vehicleParameters.
routeid = routeID;
1683 if (inspectAfterTransform) {
1708 std::vector<GNEEdge*> edges;
1723 if (edges.size() < 2) {
1725 const std::string header =
"Problem transforming to vehicle";
1727 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1731 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1746 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID(), {});
1750 if (inspectAfterTransform) {
1775 std::vector<GNEEdge*> edges;
1790 if (edges.empty()) {
1792 const std::string header =
"Problem transforming to vehicle";
1794 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1798 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1825 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID(), {});
1829 if (inspectAfterTransform) {
1852 const auto ID = personParameters.
id;
1854 personParameters.
id =
"%dummyID%";
1858 routeHandler.
buildPerson(
nullptr, personParameters);
1860 for (
const auto& personPlan : personPlans) {
1871 if (inspectAfterTransform) {
1893 const auto ID = personParameters.
id;
1895 personParameters.
id =
"%dummyID%";
1901 for (
const auto& personPlan : personPlans) {
1915 if (inspectAfterTransform) {
1937 const auto ID = containerParameters.
id;
1939 containerParameters.
id =
"%dummyID%";
1945 for (
const auto& containerPlan : containerPlans) {
1956 if (inspectAfterTransform) {
1978 const auto ID = containerParameters.
id;
1980 containerParameters.
id =
"%dummyID%";
1986 for (
const auto& containerPlan : containerPlans) {
2000 if (inspectAfterTransform) {
2016 if (junction ==
nullptr) {
2027 if (edge ==
nullptr) {
2034std::vector<GNEEdge*>
2036 std::vector<GNEEdge*> edges;
2037 for (
const auto& edgeID : edgeIDs) {
2040 if (edge ==
nullptr) {
2045 edges.push_back(edge);
2065 if (personParent ==
nullptr) {
2068 return personParent;
2086 if (containerParent ==
nullptr) {
2089 return containerParent;
2175 if (containerStop) {
2213 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 (used in NETEDIT)
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
@ GNE_TAG_PERSONTRIP_JUNCTIONS
@ GNE_TAG_WAYPOINT_PARKINGAREA
waypoint placed over a parking area (used in netedit)
@ GNE_TAG_TRANSPORT_CONTAINERSTOP
@ 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.
@ SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
@ GNE_TAG_WAYPOINT_CONTAINERSTOP
waypoint placed over a containerStop (used in netedit)
@ GNE_TAG_STOPCONTAINER_EDGE
@ GNE_TAG_WAYPOINT_BUSSTOP
waypoint placed over a busStop (used in netedit)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ GNE_TAG_WAYPOINT_CHARGINGSTATION
waypoint placed over a charging station (used in netedit)
@ 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 (used in NETEDIT)
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions (used in NETEDIT)
@ GNE_TAG_STOPCONTAINER_CONTAINERSTOP
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ GNE_TAG_WAYPOINT_LANE
waypoint placed over a lane (used in netedit)
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
@ 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..)
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
void buildFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeID, const std::vector< std::string > &viaIDs)
build flow
GNENet * myNet
pointer to GNENet
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::vector< std::string > &edgeIDs, const std::string &routeID, double arrivalPos)
build walk
bool isPersonIdDuplicated(const std::string &id)
check if there is already a person (Person or PersonFlow) with the given ID
void buildTrip(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters, const std::string &fromEdgeID, const std::string &toEdgeID, const std::vector< std::string > &viaIDs)
build trip
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
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
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 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, double arrivalPos, const std::vector< std::string > &types, const std::vector< std::string > &modes, const std::vector< std::string > &lines)
build person trip
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
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
virtual ~GNERouteHandler()
Destructor.
void buildRide(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::string &toBusStopID, double arrivalPos, const std::vector< std::string > &lines)
build ride
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
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.