51 myUndoDemandElements(undoDemandElements) {
77 if (vTypeDistribution) {
83 if (vTypeDistribution) {
86 vType->
incRef(
"buildVType");
94 const std::vector<std::string>& vTypes) {
101 bool checkVTypesOK =
true;
103 for (
const auto& vType : vTypes) {
106 checkVTypesOK =
false;
113 checkVTypesOK =
false;
116 checkVTypesOK =
false;
126 for (
const auto& vTypeID : vTypes) {
133 vTypeDistribution->
incRef(
"buildVType");
134 for (
const auto& vTypeID : vTypes) {
146 const std::vector<std::string>& edgeIDs,
const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
147 const std::map<std::string, std::string>& routeParameters) {
162 for (
const auto& edge : edges) {
163 edge->addChildElement(route);
165 route->
incRef(
"buildRoute");
173 const RGBColor& color,
const int repeat,
const SUMOTime cycleTime,
const std::map<std::string, std::string>& routeParameters) {
185 if (vType ==
nullptr) {
186 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
206 for (
const auto& edge : edges) {
207 edge->addChildElement(route);
209 route->
incRef(
"buildRoute");
221 WRITE_ERROR(
"NETEDIT doesn't support route distributions");
232 if (vType ==
nullptr) {
233 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
234 }
else if (route ==
nullptr) {
252 vehicle->
incRef(
"buildVehicleOverRoute");
268 if (vType ==
nullptr) {
269 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
270 }
else if (route ==
nullptr) {
288 flow->
incRef(
"buildFlowOverRoute");
299 const std::string& fromEdgeID,
const std::string& toEdgeID,
const std::vector<std::string>& viaIDs) {
308 if (vType ==
nullptr) {
309 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
316 for (
const auto& viaEdge : via) {
317 vehicleParameters.
via.push_back(viaEdge->getID());
329 trip->
incRef(
"buildTrip");
331 fromEdge->addChildElement(trip);
332 toEdge->addChildElement(trip);
333 for (
const auto& viaEdge : via) {
334 viaEdge->addChildElement(trip);
346 const std::string& fromJunctionID,
const std::string& toJunctionID) {
354 if (vType ==
nullptr) {
355 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
367 flow->
incRef(
"buildFlow");
369 fromJunction->addChildElement(flow);
370 toJunction->addChildElement(flow);
380 const std::string& fromEdgeID,
const std::string& toEdgeID,
const std::vector<std::string>& viaIDs) {
389 if (vType ==
nullptr) {
390 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
397 for (
const auto& viaEdge : via) {
398 vehicleParameters.
via.push_back(viaEdge->getID());
410 flow->
incRef(
"buildFlow");
412 fromEdge->addChildElement(flow);
413 toEdge->addChildElement(flow);
414 for (
const auto& viaEdge : via) {
415 viaEdge->addChildElement(flow);
427 const std::string& fromJunctionID,
const std::string& toJunctionID) {
435 if (vType ==
nullptr) {
436 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
448 flow->
incRef(
"buildFlow");
450 fromJunction->addChildElement(flow);
451 toJunction->addChildElement(flow);
466 if (type ==
nullptr) {
479 person->
incRef(
"buildPerson");
492 if (type ==
nullptr) {
493 WRITE_ERROR(
"Invalid personFlow type '" + personFlowParameters.
vtypeid +
"' used in " +
toString(personFlowParameters.
tag) +
" '" + personFlowParameters.
id +
"'.");
505 personFlow->
incRef(
"buildPersonFlow");
514 const std::string& fromJunctionID,
const std::string& toJunctionID,
const std::string& toBusStopID,
double arrivalPos,
515 const std::vector<std::string>& types,
const std::vector<std::string>& modes) {
525 if (fromEdge && toEdge) {
538 personTrip->
incRef(
"buildPersonTripFromTo");
540 }
else if (fromEdge && toBusStop) {
553 personTrip->
incRef(
"buildPersonTripFromBusStop");
555 }
else if (fromJunction && toJunction) {
568 personTrip->
incRef(
"buildPersonTripFromTo");
577 const std::string& fromJunctionID,
const std::string& toJunctionID,
const std::string& toBusStopID,
578 const std::vector<std::string>& edgeIDs,
const std::string& routeID,
double arrivalPos) {
590 if (edges.size() > 0) {
601 for (
const auto& edge : edges) {
602 edge->addChildElement(walk);
604 walk->
incRef(
"buildWalkEdges");
618 walk->
incRef(
"buildWalkRoute");
620 }
else if (fromEdge && toEdge) {
633 walk->
incRef(
"buildWalkFromTo");
635 }
else if (fromEdge && toBusStop) {
648 walk->
incRef(
"buildWalkFromBusStop");
650 }
else if (fromJunction && toJunction) {
663 walk->
incRef(
"buildWalkFromTo");
672 const std::string& toBusStopID,
double arrivalPos,
const std::vector<std::string>& lines) {
679 if (personParent && fromEdge) {
693 ride->
incRef(
"buildRideFromTo");
695 }
else if (toBusStop) {
708 ride->
incRef(
"buildRideFromBusStop");
721 if (type ==
nullptr) {
722 WRITE_ERROR(
"Invalid container type '" + containerParameters.
vtypeid +
"' used in " +
toString(containerParameters.
tag) +
" '" + containerParameters.
id +
"'.");
734 container->
incRef(
"buildContainer");
747 if (type ==
nullptr) {
748 WRITE_ERROR(
"Invalid containerFlow type '" + containerFlowParameters.
vtypeid +
"' used in " +
toString(containerFlowParameters.
tag) +
" '" + containerFlowParameters.
id +
"'.");
760 containerFlow->
incRef(
"buildContainerFlow");
769 const std::string& toContainerStopID,
const std::vector<std::string>& lines,
const double arrivalPos) {
776 if (containerParent && fromEdge) {
790 transport->
incRef(
"buildTransportFromTo");
792 }
else if (toContainerStop) {
805 transport->
incRef(
"buildTransportFromContainerStop");
814 const std::string& toContainerStopID,
const std::vector<std::string>& edgeIDs,
const double speed,
const double departPosition,
const double arrivalPosition) {
822 if (containerParent && fromEdge) {
823 if (edges.size() > 0) {
834 for (
const auto& edge : edges) {
835 edge->addChildElement(tranship);
837 tranship->
incRef(
"buildTranshipEdges");
852 tranship->
incRef(
"buildTranshipFromTo");
854 }
else if (toContainerStop) {
867 tranship->
incRef(
"buildTranshipFromContainerStop");
897 bool validParentDemandElement =
true;
899 if (stopParameters.
busstop.size() > 0) {
904 WRITE_ERROR(
"Containers don't support stops at busStops");
905 validParentDemandElement =
false;
912 WRITE_ERROR(
"Persons don't support stops at containerStops");
913 validParentDemandElement =
false;
920 WRITE_ERROR(
"Persons don't support stops at chargingStations");
921 validParentDemandElement =
false;
923 WRITE_ERROR(
"Containers don't support stops at chargingStations");
924 validParentDemandElement =
false;
926 }
else if (stopParameters.
parkingarea.size() > 0) {
931 WRITE_ERROR(
"Persons don't support stops at parkingAreas");
932 validParentDemandElement =
false;
934 WRITE_ERROR(
"Containers don't support stops at parkingAreas");
935 validParentDemandElement =
false;
937 }
else if (stopParameters.
lane.size() > 0) {
940 }
else if (stopParameters.
edge.size() > 0) {
944 WRITE_ERROR(
"vehicles don't support stops at edges");
945 validParentDemandElement =
false;
954 if (validParentDemandElement) {
956 if (stoppingPlace && lane && edge) {
957 WRITE_ERROR(
"A stop must be defined either over a stoppingPlace, a edge or a lane");
958 }
else if (!stoppingPlace && !lane && !edge) {
959 WRITE_ERROR(
"A stop requires only a stoppingPlace, edge or lane lane");
960 }
else if (stoppingPlace) {
968 stop =
new GNEStop(stopTagType,
myNet, stopParent, stoppingPlace, stopParameters);
979 stop->
incRef(
"buildStoppingPlaceStop");
993 stop->
incRef(
"buildLaneStop");
1012 stop->
incRef(
"buildLaneStop");
1029 personPlanObject->
setTag(tag);
1060 std::vector<std::string> edges;
1061 for (
const auto& path : pathCreator->
getPath()) {
1062 for (
const auto& edge : path.getSubPath()) {
1063 edges.push_back(edge->getID());
1073 if (fromEdge && toEdge) {
1083 if (fromEdge && toBusStop) {
1093 if (fromJunction && toJunction) {
1104 if (fromEdge && toEdge) {
1105 buildWalk(personPlanObject, fromEdge->
getID(), toEdge->
getID(),
"",
"",
"", {},
"", arrivalPos);
1114 if (fromEdge && toBusStop) {
1115 buildWalk(personPlanObject, fromEdge->
getID(),
"",
"",
"", toBusStop->
getID(), {},
"", arrivalPos);
1124 if (edges.size() > 0) {
1125 buildWalk(personPlanObject,
"",
"",
"",
"",
"", edges,
"", arrivalPos);
1135 buildWalk(personPlanObject,
"",
"",
"",
"",
"", {}, route->
getID(), arrivalPos);
1144 if (fromJunction && toJunction) {
1145 buildWalk(personPlanObject,
"",
"", fromJunction->
getID(), toJunction->
getID(),
"", {},
"", arrivalPos);
1155 if (fromEdge && toEdge) {
1165 if (fromEdge && toBusStop) {
1166 buildRide(personPlanObject, fromEdge->
getID(),
"", toBusStop->
getID(), arrivalPos, lines);
1177 stopParameters.
edge = fromEdge->
getID();
1179 buildStop(personPlanObject, stopParameters);
1190 buildStop(personPlanObject, stopParameters);
1223 containerPlanObject->
setTag(tag);
1239 std::vector<std::string> edges;
1240 for (
const auto& path : pathCreator->
getPath()) {
1241 for (
const auto& edge : path.getSubPath()) {
1242 edges.push_back(edge->getID());
1250 if (fromEdge && toEdge) {
1260 if (fromEdge && toBusStop) {
1271 if (fromEdge && toEdge) {
1281 if (fromEdge && toBusStop) {
1282 buildTranship(containerPlanObject, fromEdge->
getID(),
"", toBusStop->
getID(), {}, speed, departPos, arrivalPos);
1291 if (edges.size() > 0) {
1292 buildTranship(containerPlanObject,
"",
"",
"", edges, speed, departPos, arrivalPos);
1303 stopParameters.
edge = fromEdge->
getID();
1304 buildStop(containerPlanObject, stopParameters);
1315 buildStop(containerPlanObject, stopParameters);
1333 for (
const auto& vehicleTag : vehicleTags) {
1335 WRITE_ERROR(
"There is another " +
toString(vehicleTag) +
" with the same ID='" +
id +
"'.");
1347 WRITE_ERROR(
"There is another " +
toString(personTag) +
" with the same ID='" +
id +
"'.");
1359 WRITE_ERROR(
"There is another " +
toString(containerTag) +
" with the same ID='" +
id +
"'.");
1378 const auto vClass = originalVehicle->
getVClass();
1382 std::vector<GNEEdge*> routeEdges;
1397 std::vector<std::string> edgeIDs;
1398 for (
const auto& edge : routeEdges) {
1399 edgeIDs.push_back(edge->getID());
1402 if (routeEdges.empty()) {
1404 const std::string header =
"Problem transforming to vehicle";
1406 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1410 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1419 if (createEmbeddedRoute) {
1431 delete vehicleBaseOBject;
1438 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, {});
1440 vehicleParameters.
routeid = routeID;
1461 const auto vClass = originalVehicle->
getVClass();
1465 std::vector<GNEEdge*> routeEdges;
1480 std::vector<std::string> edgeIDs;
1481 for (
const auto& edge : routeEdges) {
1482 edgeIDs.push_back(edge->getID());
1485 if (routeEdges.empty()) {
1487 const std::string header =
"Problem transforming to vehicle";
1489 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1493 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1514 if (createEmbeddedRoute) {
1526 delete vehicleBaseOBject;
1533 routeHandler.
buildRoute(
nullptr, routeID, vClass, edgeIDs, routeColor,
false, 0, {});
1535 vehicleParameters.
routeid = routeID;
1558 std::vector<GNEEdge*> edges;
1573 if (edges.size() < 2) {
1575 const std::string header =
"Problem transforming to vehicle";
1577 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1581 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1596 routeHandler.
buildTrip(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID(), {});
1616 std::vector<GNEEdge*> edges;
1631 if (edges.empty()) {
1633 const std::string header =
"Problem transforming to vehicle";
1635 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1639 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1666 routeHandler.
buildFlow(
nullptr, vehicleParameters, edges.front()->getID(), edges.back()->getID(), {});
1700 switch (attribute) {
1764 if (junction ==
nullptr) {
1775 if (edge ==
nullptr) {
1782 std::vector<GNEEdge*>
1784 std::vector<GNEEdge*> edges;
1785 for (
const auto& edgeID : edgeIDs) {
1788 if (edge ==
nullptr) {
1793 edges.push_back(edge);
1813 if (personParent ==
nullptr) {
1816 return personParent;
1834 if (containerParent ==
nullptr) {
1837 return containerParent;
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 VEHPARS_PROB_SET
const int STOP_DURATION_SET
const int VEHPARS_VPH_SET
const int VEHPARS_END_SET
@ GIVEN
The lane is given.
@ GIVEN
The speed is given.
const int VEHPARS_DEPARTLANE_SET
const int VEHPARS_NUMBER_SET
const int VEHPARS_DEPARTSPEED_SET
const int VEHPARS_PERIOD_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_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_STOPCONTAINER_EDGE
@ SUMO_TAG_BUS_STOP
A bus stop.
@ 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)
@ 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
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_FLOWPARAMETERS
flow parameters (integer for mask end, number, etc...)
@ 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.
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 belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
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
An Element which don't belongs to GNENet but has influency 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
const std::string & getID() const
get ID
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
const std::vector< Path > & getPath() const
get path route
GNEAdditional * getToStoppingPlace(SumoXMLTag expectedTag) const
get to stoppingPlace
GNEDemandElement * getRoute() const
get route
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
const std::vector< GNEJunction * > & getSelectedJunctions() const
get current selected junctions
GNEAttributeCarrier * getTemplateAC(SumoXMLTag ACTag) const
get templateAC
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
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEEdge * getParentEdge() const
get arent 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
const std::string & getID() const
get ID
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="")
Increarse reference.
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
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
CommonXMLStructure::SumoBaseObject * myPlanObject
pointer for person and container plans
GNEDemandElement * getPersonParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get person parent
GNEEdge * getPreviousPlanEdge(const bool person, const CommonXMLStructure::SumoBaseObject *obj) const
get previos person/container plan edge
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 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)
build person trip
static bool isPersonIdDuplicated(GNENet *net, const std::string &id)
check if there is already a person (Person or PersonFlow) with the given ID
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
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
bool buildPersonPlan(SumoXMLTag tag, GNEDemandElement *personParent, GNEFrameAttributeModules::AttributesCreator *personPlanAttributes, GNEFrameModules::PathCreator *pathCreator, const bool centerAfterCreation)
build person plan
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 buildEmbeddedRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::vector< std::string > &edgeIDs, const RGBColor &color, const int repeat, const SUMOTime cycleTime, const std::map< std::string, std::string > &routeParameters)
build embedded route
void buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameters)
build a flow over an existent route
static bool isContainerIdDuplicated(GNENet *net, const std::string &id)
check if there is already a container (Container or ContainerFlow) with the given ID
static void setFlowParameters(const SumoXMLAttr attribute, int ¶meters)
set flow parameters
void buildVType(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVTypeParameter &vTypeParameter)
build vType
static bool isVehicleIdDuplicated(GNENet *net, const std::string &id)
check if there is already a vehicle (Vehicle, Trip, Flow or Flow) with the given ID
GNERouteHandler(const std::string &file, GNENet *net, bool undoDemandElements=true)
Constructor.
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
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::vector< std::string > &edgeIDs) const
parse edges
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
void buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::vector< std::string > &vTypes)
build vType distribution
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
bool myUndoDemandElements
flag to check if created demand elements must be undo and redo
~GNERouteHandler()
Destructor.
bool buildContainerPlan(SumoXMLTag tag, GNEDemandElement *containerParent, GNEFrameAttributeModules::AttributesCreator *containerPlanAttributes, GNEFrameModules::PathCreator *pathCreator)
build container plan
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 buildPersonFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &personFlowParameters)
build person flow
GNEEdge * parseEdge(const SumoXMLTag tag, const std::string &edgeID) const
parse edge
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 std::map< std::string, std::string > &routeParameters)
build route
GNEJunction * parseJunction(const SumoXMLTag tag, const std::string &junctionID) const
parse junction
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
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
bool isContainer() const
return true if tag correspond to a container element
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
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
GNEFrameModules::TagSelector * 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
void setStatusBarText(const std::string &text)
set staturBar text
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
Boundary getVisibleBoundary() const
get visible boundary
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static const RGBColor YELLOW
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.
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.