54 routeID(originalDemandElement->getTagProperty().isRoute() ?
55 originalDemandElement->getID() :
56 originalDemandElement->getNet()->generateDemandElementID(
SUMO_TAG_ROUTE)),
58 edges(originalDemandElement->getParentEdges()),
59 vClass(originalDemandElement->getVClass()),
60 color(originalDemandElement->getColor()) {
70 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(net, edgeIDs);
80 if (fromID.size() + toID.size() > 0) {
85 if (from ==
nullptr) {
86 WRITE_ERROR(
"Invalid from-edge '" + fromID +
"' used in trip '" + vehicleID +
"'.");
87 }
else if (to ==
nullptr) {
88 WRITE_ERROR(
"Invalid to-edge '" + toID +
"' used in trip '" + vehicleID +
"'.");
90 WRITE_ERROR(
"Invalid 'via' edges used in trip '" + vehicleID +
"'.");
93 std::vector<GNEEdge*> viaEdges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(net, viaIDs);
95 edges.push_back(from);
96 for (
const auto& i : viaEdges) {
133 for (
const auto& vehicleTag : vehicleTags) {
135 WRITE_ERROR(
"There is another " +
toString(vehicleTag) +
" with the same ID='" +
id +
"'.");
147 WRITE_ERROR(
"There is another " +
toString(personTag) +
" with the same ID='" +
id +
"'.");
159 if (undoDemandElements) {
163 for (
const auto& i : activeStops) {
169 for (
const auto& i : routeParameters.
edges) {
170 i->addChildElement(route);
172 route->
incRef(
"buildRoute");
174 for (
const auto& i : activeStops) {
187 if (vType ==
nullptr) {
188 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
189 }
else if (route ==
nullptr) {
198 if (undoDemandElements) {
202 for (
const auto& i : vehicleParameters.
stops) {
211 vehicle->
incRef(
"buildVehicleOverRoute");
213 for (
const auto& i : vehicleParameters.
stops) {
229 if (vType ==
nullptr) {
230 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
231 }
else if (route ==
nullptr) {
240 if (undoDemandElements) {
244 for (
const auto& i : vehicleParameters.
stops) {
253 flow->
incRef(
"buildFlowOverRoute");
255 for (
const auto& i : vehicleParameters.
stops) {
270 if (vType ==
nullptr) {
271 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
280 embeddedRouteParameters.
routeID = vehicleParameters.
id;
282 embeddedRouteParameters.
edges = edges;
292 if (undoDemandElements) {
303 vehicle->
incRef(
"buildVehicleWithEmbeddedRoute");
306 for (
const auto& edge : edges) {
307 edge->addChildElement(vehicle);
311 embeddedRoute->
incRef(
"buildVehicleWithEmbeddedRoute");
324 if (vType ==
nullptr) {
325 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
334 embeddedRouteParameters.
routeID = vehicleParameters.
id;
336 embeddedRouteParameters.
edges = edges;
346 if (undoDemandElements) {
357 flow->
incRef(
"buildFlowWithEmbeddedRoute");
360 for (
const auto& edge : edges) {
361 edge->addChildElement(flow);
365 embeddedRoute->
incRef(
"buildFlowWithEmbeddedRoute");
378 if (vType ==
nullptr) {
379 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
386 for (
const auto& viaEdge : via) {
387 vehicleParameters.
via.push_back(viaEdge->getID());
391 if (undoDemandElements) {
395 for (
const auto& i : vehicleParameters.
stops) {
403 trip->
incRef(
"buildTrip");
407 for (
const auto& viaEdge : via) {
408 viaEdge->addChildElement(trip);
411 for (
const auto& i : vehicleParameters.
stops) {
428 if (vType ==
nullptr) {
429 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
436 for (
const auto& viaEdge : via) {
437 vehicleParameters.
via.push_back(viaEdge->getID());
441 if (undoDemandElements) {
445 for (
const auto& i : vehicleParameters.
stops) {
453 flow->
incRef(
"buildFlow");
457 for (
const auto& viaEdge : via) {
458 viaEdge->addChildElement(flow);
461 for (
const auto& i : vehicleParameters.
stops) {
477 bool validParentDemandElement =
true;
478 if (stopParameters.
busstop.size() > 0) {
490 WRITE_ERROR(
"Persons don't support stops at container stops");
491 validParentDemandElement =
false;
499 WRITE_ERROR(
"Persons don't support stops at charging stations");
500 validParentDemandElement =
false;
504 }
else if (stopParameters.
parkingarea.size() > 0) {
508 WRITE_ERROR(
"Persons don't support stops at parking areas");
509 validParentDemandElement =
false;
513 }
else if (stopParameters.
lane.size() > 0) {
516 }
else if (stopParameters.
edge.size() > 0) {
521 if (validParentDemandElement) {
523 if (stoppingPlace && lane) {
524 WRITE_ERROR(
"A stop must be defined either over a stoppingPlace or over a lane");
525 }
else if (!stoppingPlace && !lane) {
526 WRITE_ERROR(
"A stop requires a stoppingPlace or a lane");
527 }
else if (stoppingPlace) {
531 if (undoDemandElements) {
539 stop->
incRef(
"buildStoppingPlaceStop");
545 if (undoDemandElements) {
553 stop->
incRef(
"buildLaneStop");
566 if (pType ==
nullptr) {
571 if (undoDemandElements) {
579 person->
incRef(
"buildPerson");
592 if (pType ==
nullptr) {
593 WRITE_ERROR(
"Invalid personFlow type '" + personFlowParameters.
vtypeid +
"' used in " +
toString(personFlowParameters.
tag) +
" '" + personFlowParameters.
id +
"'.");
597 if (undoDemandElements) {
605 personFlow->
incRef(
"buildPersonFlow");
619 const std::vector<std::string> types = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[
SUMO_ATTR_VTYPES]);
620 const std::vector<std::string> modes = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[
SUMO_ATTR_MODES]);
621 const std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[
SUMO_ATTR_LINES]);
632 std::vector<GNEEdge*> edges;
633 for (
const auto& path : pathCreator->
getPath()) {
634 for (
const auto& edge : path.getSubPath()) {
635 edges.push_back(edge);
645 if (fromEdge && toEdge) {
646 buildPersonTrip(viewNet->
getNet(),
true, personParent, fromEdge, toEdge,
nullptr,
nullptr, arrivalPos, types, modes);
649 viewNet->
setStatusBarText(
"A person trip from edge to edge needs two edges");
655 if (fromEdge && toBusStop) {
656 buildPersonTrip(viewNet->
getNet(),
true, personParent, fromEdge,
nullptr,
nullptr, toBusStop, arrivalPos, types, modes);
659 viewNet->
setStatusBarText(
"A ride from edge to bussTop needs an edge and a busSTop");
665 if (fromBusStop && toEdge) {
666 buildPersonTrip(viewNet->
getNet(),
true, personParent,
nullptr, toEdge, fromBusStop,
nullptr, arrivalPos, types, modes);
669 viewNet->
setStatusBarText(
"A ride from busStop to edge needs a busStop and an edge");
675 if (fromBusStop && toBusStop) {
676 buildPersonTrip(viewNet->
getNet(),
true, personParent,
nullptr,
nullptr, fromBusStop, toBusStop, arrivalPos, types, modes);
679 viewNet->
setStatusBarText(
"A person trip from busStop to busStop needs two busStops");
686 if (fromEdge && toEdge) {
687 buildWalk(viewNet->
getNet(),
true, personParent, fromEdge, toEdge,
nullptr,
nullptr, {},
nullptr, arrivalPos);
696 if (fromEdge && toBusStop) {
697 buildWalk(viewNet->
getNet(),
true, personParent, fromEdge,
nullptr,
nullptr, toBusStop, {},
nullptr, arrivalPos);
700 viewNet->
setStatusBarText(
"A ride from edge to bussTop needs an edge and a busSTop");
706 if (fromBusStop && toEdge) {
707 buildWalk(viewNet->
getNet(),
true, personParent,
nullptr, toEdge, fromBusStop,
nullptr, {},
nullptr, arrivalPos);
710 viewNet->
setStatusBarText(
"A ride from busStop to edge needs a busStop and an edge");
716 if (fromBusStop && toBusStop) {
717 buildWalk(viewNet->
getNet(),
true, personParent,
nullptr,
nullptr, fromBusStop, toBusStop, {},
nullptr, arrivalPos);
720 viewNet->
setStatusBarText(
"A walk from busStop to busStop needs two busStops");
726 if (edges.size() > 0) {
727 buildWalk(viewNet->
getNet(),
true, personParent,
nullptr,
nullptr,
nullptr,
nullptr, edges,
nullptr, arrivalPos);
730 viewNet->
setStatusBarText(
"A walk with edges attribute needs a list of edges");
737 buildWalk(viewNet->
getNet(),
true, personParent,
nullptr,
nullptr,
nullptr,
nullptr, {}, route, arrivalPos);
747 if (fromEdge && toEdge) {
748 buildRide(viewNet->
getNet(),
true, personParent, fromEdge, toEdge,
nullptr,
nullptr, arrivalPos, lines);
757 if (fromEdge && toBusStop) {
758 buildRide(viewNet->
getNet(),
true, personParent, fromEdge,
nullptr,
nullptr, toBusStop, arrivalPos, lines);
761 viewNet->
setStatusBarText(
"A ride from edge to busStop needs an edge and a busStop");
767 if (fromBusStop && toEdge) {
768 buildRide(viewNet->
getNet(),
true, personParent,
nullptr, toEdge, fromBusStop,
nullptr, arrivalPos, lines);
771 viewNet->
setStatusBarText(
"A ride from busStop to edge needs a busStop and an edge");
777 if (fromBusStop && toBusStop) {
778 buildRide(viewNet->
getNet(),
true, personParent,
nullptr,
nullptr, fromBusStop, toBusStop, arrivalPos, lines);
781 viewNet->
setStatusBarText(
"A ride from busStop to busStop needs two busStops");
816 GNEAdditional* busStopFrom,
GNEAdditional* busStopTo,
double arrivalPos,
const std::vector<std::string>& types,
const std::vector<std::string>& modes) {
820 if (fromEdge && toEdge) {
822 personTrip =
new GNEPersonTrip(net, personParent, fromEdge, toEdge, arrivalPos, types, modes);
824 if (undoDemandElements) {
836 personTrip->
incRef(
"buildPersonTrip");
838 }
else if (fromEdge && busStopTo) {
840 personTrip =
new GNEPersonTrip(net, personParent, fromEdge, busStopTo, arrivalPos, types, modes);
842 if (undoDemandElements) {
854 personTrip->
incRef(
"buildPersonTrip");
856 }
else if (busStopFrom && toEdge) {
858 personTrip =
new GNEPersonTrip(net, personParent, busStopFrom, toEdge, arrivalPos, types, modes);
860 if (undoDemandElements) {
872 personTrip->
incRef(
"buildPersonTrip");
874 }
else if (busStopFrom && busStopTo) {
876 personTrip =
new GNEPersonTrip(net, personParent, busStopFrom, busStopTo, arrivalPos, types, modes);
878 if (undoDemandElements) {
890 personTrip->
incRef(
"buildPersonTrip");
904 if (fromEdge && toEdge) {
906 walk =
new GNEWalk(net, personParent, fromEdge, toEdge, arrivalPos);
908 if (undoDemandElements) {
920 walk->
incRef(
"buildWalk");
922 }
else if (fromEdge && busStopTo) {
924 walk =
new GNEWalk(net, personParent, fromEdge, busStopTo, arrivalPos);
926 if (undoDemandElements) {
938 walk->
incRef(
"buildWalk");
940 }
else if (busStopFrom && toEdge) {
942 walk =
new GNEWalk(net, personParent, busStopFrom, toEdge, arrivalPos);
944 if (undoDemandElements) {
956 walk->
incRef(
"buildWalk");
958 }
else if (busStopFrom && busStopTo) {
960 walk =
new GNEWalk(net, personParent, busStopFrom, busStopTo, arrivalPos);
962 if (undoDemandElements) {
974 walk->
incRef(
"buildWalk");
976 }
else if (edges.size() > 0) {
978 walk =
new GNEWalk(net, personParent, edges, arrivalPos);
980 if (undoDemandElements) {
989 for (
const auto& edge : edges) {
990 edge->addChildElement(walk);
993 walk->
incRef(
"buildWalk");
997 walk =
new GNEWalk(net, personParent, route, arrivalPos);
999 if (undoDemandElements) {
1010 walk->
incRef(
"buildWalk");
1024 if (fromEdge && toEdge) {
1026 ride =
new GNERide(net, personParent, fromEdge, toEdge, arrivalPos, lines);
1028 if (undoDemandElements) {
1040 ride->
incRef(
"buildRide");
1042 }
else if (fromEdge && busStopTo) {
1044 ride =
new GNERide(net, personParent, fromEdge, busStopTo, arrivalPos, lines);
1046 if (undoDemandElements) {
1058 ride->
incRef(
"buildRide");
1060 }
else if (busStopFrom && toEdge) {
1062 ride =
new GNERide(net, personParent, busStopFrom, toEdge, arrivalPos, lines);
1064 if (undoDemandElements) {
1076 ride->
incRef(
"buildRide");
1078 }
else if (busStopFrom && busStopTo) {
1080 ride =
new GNERide(net, personParent, busStopFrom, busStopTo, arrivalPos, lines);
1082 if (undoDemandElements) {
1094 ride->
incRef(
"buildRide");
1109 personStop =
new GNEPersonStop(net, personParent, edge, stopParameters);
1111 if (undoDemandElements) {
1122 personStop->
incRef(
"buildPersonStop");
1124 }
else if (busStop) {
1126 personStop =
new GNEPersonStop(net, personParent, busStop, stopParameters);
1128 if (undoDemandElements) {
1139 personStop->
incRef(
"buildPersonStop");
1173 if (routeParameters.
edges.empty()) {
1175 const std::string header =
"Problem transforming to vehicle";
1177 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1181 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1190 if (createEmbeddedRoute) {
1239 if (routeParameters.
edges.empty()) {
1241 const std::string header =
"Problem transforming to vehicle";
1243 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1247 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1269 if (createEmbeddedRoute) {
1303 std::vector<GNEEdge*> edges;
1318 if (edges.size() < 2) {
1320 const std::string header =
"Problem transforming to vehicle";
1322 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1326 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1341 buildTrip(net,
true, vehicleParameters, edges.front(), edges.back(), {});
1359 std::vector<GNEEdge*> edges;
1374 if (edges.empty()) {
1376 const std::string header =
"Problem transforming to vehicle";
1378 const std::string message =
"Vehicle cannot be transformed. Invalid number of edges";
1382 FXMessageBox::warning(originalVehicle->
getNet()->
getViewNet()->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
1410 buildFlow(net,
true, vehicleParameters, edges.front(), edges.back(), {});
1432 switch (attribute) {
1570 if (vType ==
nullptr) {
1604 embeddedRoute->
incRef(
"buildVehicleAndRoute");
1679 vType->
incRef(
"buildVType");
1694 if (pType ==
nullptr) {
1705 switch (personPlanValue.tag) {
1708 buildPersonTrip(
myNet,
true, person, personPlanValue.fromEdge, personPlanValue.toEdge,
nullptr,
nullptr,
1709 personPlanValue.
arrivalPos, personPlanValue.vTypes, personPlanValue.modes);
1713 buildPersonTrip(
myNet,
true, person, personPlanValue.fromEdge,
nullptr,
nullptr, personPlanValue.toBusStop,
1714 personPlanValue.
arrivalPos, personPlanValue.vTypes, personPlanValue.modes);
1718 buildPersonTrip(
myNet,
true, person,
nullptr, personPlanValue.toEdge, personPlanValue.fromBusStop,
nullptr,
1719 personPlanValue.
arrivalPos, personPlanValue.vTypes, personPlanValue.modes);
1723 buildPersonTrip(
myNet,
true, person,
nullptr,
nullptr, personPlanValue.fromBusStop, personPlanValue.toBusStop,
1724 personPlanValue.
arrivalPos, personPlanValue.vTypes, personPlanValue.modes);
1729 buildWalk(
myNet,
true, person, personPlanValue.fromEdge, personPlanValue.toEdge,
nullptr,
nullptr, {},
nullptr,
1734 buildWalk(
myNet,
true, person, personPlanValue.fromEdge,
nullptr,
nullptr, personPlanValue.toBusStop, {},
nullptr,
1739 buildWalk(
myNet,
true, person,
nullptr, personPlanValue.toEdge, personPlanValue.fromBusStop,
nullptr, {},
nullptr,
1744 buildWalk(
myNet,
true, person,
nullptr,
nullptr, personPlanValue.fromBusStop, personPlanValue.toBusStop, {},
nullptr,
1749 buildWalk(
myNet,
true, person,
nullptr,
nullptr,
nullptr,
nullptr, personPlanValue.edges,
nullptr,
1754 buildWalk(
myNet,
true, person,
nullptr,
nullptr,
nullptr,
nullptr, {}, personPlanValue.route,
1760 buildRide(
myNet,
true, person, personPlanValue.fromEdge, personPlanValue.toEdge,
nullptr,
nullptr,
1761 personPlanValue.
arrivalPos, personPlanValue.lines);
1765 buildRide(
myNet,
true, person, personPlanValue.fromEdge,
nullptr,
nullptr, personPlanValue.toBusStop,
1766 personPlanValue.
arrivalPos, personPlanValue.lines);
1770 buildRide(
myNet,
true, person,
nullptr, personPlanValue.toEdge, personPlanValue.fromBusStop,
nullptr,
1771 personPlanValue.
arrivalPos, personPlanValue.lines);
1775 buildRide(
myNet,
true, person,
nullptr,
nullptr, personPlanValue.fromBusStop, personPlanValue.toBusStop,
1776 personPlanValue.
arrivalPos, personPlanValue.lines);
1830 std::vector<GNEEdge*> viaEdges;
1848 std::vector<GNEEdge*> viaEdges;
1862 std::string errorSuffix;
1877 if (bs ==
nullptr) {
1899 if (cs ==
nullptr) {
1918 if (cs ==
nullptr) {
1936 if (pa ==
nullptr) {
1953 if (stop.
lane ==
nullptr) {
1965 WRITE_ERROR(
"Deprecated attribute 'pos' in description of stop" + errorSuffix);
2048 fromBusStop(nullptr),
2054 containerStop(nullptr),
2055 chargingStation(nullptr),
2056 parkingArea(nullptr),
2064 if (fromEdge && toEdge) {
2073 }
else if (fromEdge && toBusStop) {
2082 }
else if (fromBusStop && toEdge) {
2091 }
else if (fromBusStop && toBusStop) {
2100 }
else if (edges.size() > 0) {
2106 }
else if (edgeStop || lane) {
2117 bool correct =
false;
2119 if (fromEdge && toEdge) {
2123 if (fromEdge && toBusStop) {
2131 if (fromBusStop && toEdge) {
2139 if (fromBusStop && toBusStop) {
2147 if (edges.size() > 0) {
2177 if (fromEdge && toEdge) {
2181 if (fromEdge && toBusStop) {
2185 if (fromBusStop && toEdge) {
2189 if (fromBusStop && toBusStop) {
2193 if (edges.size() > 0) {
2212 }
else if (toEdge) {
2214 }
else if (fromBusStop) {
2216 }
else if (toBusStop) {
2217 return toBusStop->getParentLanes().front()->getParentEdge();
2219 return route->getParentEdges().back();
2220 }
else if (edges.size() > 0) {
2221 return edges.back();
2222 }
else if (edgeStop) {
2237 personPlansValuesLoaded.
tag = tag;
2241 const std::string edgeStr = attrs.
get<std::string>(
SUMO_ATTR_FROM,
"", abort,
false);
2248 if (personPlansValuesLoaded.
fromEdge ==
nullptr) {
2256 const std::string edgeStr = attrs.
get<std::string>(
SUMO_ATTR_TO,
"", abort,
false);
2263 if (personPlansValuesLoaded.
toEdge ==
nullptr) {
2278 if (personPlansValuesLoaded.
toBusStop ==
nullptr) {
2286 const std::string edgeIDs = attrs.
get<std::string>(
SUMO_ATTR_EDGES,
"", abort,
false);
2288 personPlansValuesLoaded.
edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(net, edgeIDs);
2290 if (personPlansValuesLoaded.
edges.empty()) {
2300 const std::string routeStr = attrs.
get<std::string>(
SUMO_ATTR_ROUTE,
"", abort,
false);
2307 if (personPlansValuesLoaded.
route ==
nullptr) {
2316 personPlansValuesLoaded.
vTypes = GNEAttributeCarrier::parse<std::vector<std::string> >(vTypes);
2323 personPlansValuesLoaded.
vTypes = GNEAttributeCarrier::parse<std::vector<std::string> >(vTypes);
2330 personPlansValuesLoaded.
modes = GNEAttributeCarrier::parse<std::vector<std::string> >(modes);
2338 personPlansValuesLoaded.
lines = GNEAttributeCarrier::parse<std::vector<std::string> >(lines);
2345 if (!abort && GNEAttributeCarrier::canParse<double>(arrivalPosStr)) {
2346 personPlansValuesLoaded.
arrivalPos = GNEAttributeCarrier::parse<double>(arrivalPosStr);
2352 const std::string laneStr = attrs.
get<std::string>(
SUMO_ATTR_LANE,
"", abort,
false);
2367 myPersonPlanValues.push_back(personPlansValuesLoaded);
2374 if (myPersonPlanValues.empty()) {
2378 if (!myPersonPlanValues.front().isFirstPersonPlan()) {
2382 myPersonPlanValues.front().updateGNETag();
2384 for (
int i = 1; i < (int)myPersonPlanValues.size(); i++) {
2389 if (previousPlan.
toEdge) {
2393 }
else if (previousPlan.
edges.size() > 0) {
2395 }
else if (previousPlan.
route) {
2397 }
else if (previousPlan.
edgeStop) {
2399 }
else if (previousPlan.
lane) {
2401 }
else if (previousPlan.
busStop) {
#define WRITE_WARNING(msg)
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_PEDESTRIAN
pedestrian
const std::string DEFAULT_PEDTYPE_ID
const std::string DEFAULT_VTYPE_ID
const std::string DEFAULT_BIKETYPE_ID
const int VEHPARS_PROB_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_FORCE_REROUTE
const int VEHPARS_DEPARTSPEED_SET
const int VEHPARS_PERIOD_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_WALK_BUSSTOP_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_EDGE
@ GNE_TAG_PERSONSTOP_BUSSTOP
@ GNE_TAG_RIDE_BUSSTOP_BUSSTOP
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
@ GNE_TAG_PERSONTRIP_BUSSTOP_EDGE
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_VTYPE
description of a vehicle type
@ 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)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ 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_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)
@ GNE_TAG_RIDE_BUSSTOP_EDGE
@ SUMO_TAG_PARKING_AREA
A parking area.
@ GNE_TAG_PERSONSTOP_EDGE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ GNE_TAG_PERSONTRIP_EDGE_BUSSTOP
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_WALK_BUSSTOP_EDGE
@ GNE_TAG_VEHICLE_WITHROUTE
@ GNE_TAG_RIDE_EDGE_BUSSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_BUSSTOP
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
@ GNE_TAG_WALK_EDGE_BUSSTOP
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
@ SUMO_TAG_TRIP
a single trip definition (used by router)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_PERSONSPERHOUR
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belongs to GNENet but has influency in the simulation.
virtual std::string getAttribute(SumoXMLAttr key) const =0
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
GNENet * getNet() const
get pointer to net
An Element which don't belongs to GNENet but has influency in the simulation.
virtual void updateGeometry()=0
update pre-computed geometry information
virtual double getAttributeDouble(SumoXMLAttr key) const =0
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
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
std::vector< GNEEdge * > getSelectedEdges() const
get current selected additionals
const std::vector< Path > & getPath() const
get path route
GNEDemandElement * getRoute() const
get route
GNEAdditional * getToStoppingPlace(SumoXMLTag expectedTag) const
get to stoppingPlace
GNEAdditional * getFromStoppingPlace(SumoXMLTag expectedTag) const
get from stoppingPlace
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.
double getLaneParametricLength() const
returns the parameteric length of the lane
GNEEdge * getParentEdge() const
get arent edge
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element element int GNENet container.
std::vector< GNEEdge * > calculatePath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
A NBNetBuilder extended by visualisation and editing capabilities.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
GNENetHelper::PathCalculator * getPathCalculator()
obtain instance of PathCalculator
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
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.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEViewNet * getViewNet() const
get view net
void incRef(const std::string &debugMsg="")
Increarse reference.
void closePerson()
Ends the processing of a person.
static void buildVehicleOverRoute(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters)
build a vehicle over an existent route
static void buildRide(GNENet *net, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, GNEAdditional *busStopFrom, GNEAdditional *busStopTo, double arrivalPos, const std::vector< std::string > &lines)
build ride
RouteParameter myRouteParameter
NETEDIT Route Parameters.
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
bool myAbort
flag used for parsing values
static void buildFlowEmbeddedRoute(GNENet *net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, const std::vector< GNEEdge * > &edges)
build flow with a embedded route
static void buildPersonTrip(GNENet *net, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, GNEAdditional *busStopFrom, GNEAdditional *busStopTo, double arrivalPos, const std::vector< std::string > &types, const std::vector< std::string > &modes)
build person trip
void closeFlow()
Ends the processing of a routeFlow.
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
static void buildPerson(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &personParameters)
void addContainer(const SUMOSAXAttributes &attrs)
Processing of a container.
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
GNENet * myNet
pointer to GNENet
void openRouteFlow(const SUMOSAXAttributes &attrs)
opens a routeFlow for reading
static bool isPersonIdDuplicated(GNENet *net, const std::string &id)
check if there is already a person (Person or PersonFlow) with the given ID
void closeContainer()
Ends the processing of a container.
static void buildRoute(GNENet *net, bool undoDemandElements, const RouteParameter &routeParameters, const std::vector< SUMOVehicleParameter::Stop > &activeStops)
build route
void closePersonFlow()
Ends the processing of a personFlow.
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
void closeVehicle()
Ends the processing of a vehicle.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
static void buildPersonStop(GNENet *net, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *edge, GNEAdditional *busStop, const SUMOVehicleParameter::Stop &stopParameters)
build stop
static void buildWalk(GNENet *net, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, GNEAdditional *busStopFrom, GNEAdditional *busStopTo, const std::vector< GNEEdge * > &edges, GNEDemandElement *route, double arrivalPos)
build walk
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
void closeRoute(const bool mayBeDisconnected=false)
static void buildPersonFlow(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &personFlowParameters)
build person flow
void addPerson(const SUMOSAXAttributes &attrs)
Processing of a person.
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
static void setFlowParameters(const SumoXMLAttr attribute, int ¶meters)
configure flow parameters
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 openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
PersonValue myPersonValues
NETEDIT person values.
void closeRouteDistribution()
closes (ends) the building of a distribution
static bool buildPersonPlan(SumoXMLTag tag, GNEDemandElement *personParent, GNEFrameAttributesModuls::AttributesCreator *personPlanAttributes, GNEFrameModuls::PathCreator *pathCreator)
void openFlow(const SUMOSAXAttributes &attrs)
opens a routeFlow for reading
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
void closeVType()
Ends the processing of a vehicle Type.
bool myUndoDemandElements
flag to check if created demand elements must be undo and redo
~GNERouteHandler()
Destructor.
GNEDemandElement * myLoadedVehicleWithEmbebbedRoute
Pointer to loaded vehicle with embebbed route (needed for GNEStops)
static void buildStop(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter::Stop &stopParameters, GNEDemandElement *stopParent)
build stop
void closeTrip()
Ends the processing of a trip.
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
static void buildVehicleEmbeddedRoute(GNENet *net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, const std::vector< GNEEdge * > &edges)
build vehicle with a embedded route
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
static void transformToPersonFlow(GNEPerson *originalPerson)
transform routeFlow over an existent route
static void buildFlowOverRoute(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters)
build a flow over an existent route
static void buildFlow(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters, GNEEdge *fromEdge, GNEEdge *toEdge, const std::vector< GNEEdge * > &via)
build flow
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
static void buildTrip(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters, GNEEdge *fromEdge, GNEEdge *toEdge, const std::vector< GNEEdge * > &via)
build trip
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isPerson() const
return true if tag correspond to a person element
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
int currentCommandGroupSize() const
get size of current CommandGroup
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
SUMOVehicleClass getVClass() const
static void overwriteVType(GNEDemandElement *vType, SUMOVTypeParameter *newVTypeParameter, GNEUndoList *undoList)
overwrite all values of GNEVehicleType with a SUMOVTypeParameter
GNENet * getNet() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void setStatusBarText(const std::string &text)
set staturBar text
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
void clearParameter()
Clears the parameter map.
static const RGBColor YELLOW
static const RGBColor CYAN
Parser for routes during their loading.
bool parseStop(SUMOVehicleParameter::Stop &stop, const SUMOSAXAttributes &attrs, std::string errorSuffix, MsgHandler *const errorOutput)
parses attributes common to all stops
std::vector< SUMOVehicleParameter::Stop > myActiveRouteStops
List of the stops on the parsed route.
std::string myActiveRouteID
The id of the current route.
Parameterised myLoadedParameterised
Parameterised used for saving loaded generic parameters that aren't saved in Vehicles or Vehicle Type...
SUMOVehicleParameter * myVehicleParameter
Parameter of the current vehicle, trip, person, container or flow.
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOVehicleClass vehicleClass
The vehicle's class.
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.
bool friendlyPos
enable or disable friendly position (used by NETEDIT)
std::string parkingarea
(Optional) parking area if one is assigned to the stop
double startPos
The stopping position start.
std::string chargingStation
(Optional) charging station if one is assigned to the stop
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
Structure representing possible vehicle parameter.
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.
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.
double arrivalPos
(optional) The position the vehicle shall arrive on
std::string routeid
The vehicle's route id.
std::string id
The vehicle's id.
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
bool wasSet(int what) const
Returns whether the given parameter was set.
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
struct used for load person plans (Rides, Walks, etc.)
GNEEdge * getLastEdge() const
return last valid edge (used to create consecutive person plans)
std::vector< std::string > vTypes
vehicle types
GNELane * lane
lane (stop)
GNEAdditional * chargingStation
charging station (stop)
bool isFirstPersonPlan() const
is first person plan
std::vector< std::string > lines
lines
GNEAdditional * fromBusStop
from busStop
std::vector< GNEEdge * > edges
list of edges
GNEEdge * fromEdge
from edge
void updateGNETag()
update tag
PersonPlansValues()
default constructor
double arrivalPos
arrival pos
GNEAdditional * busStop
bus stop (stop)
SUMOVehicleParameter::Stop stopParameters
stop parameters
GNEAdditional * parkingArea
parking area (stop)
std::vector< std::string > modes
modes
GNEDemandElement * route
arrival route
GNEEdge * edgeStop
edge stop
GNEAdditional * toBusStop
to busStop
GNEAdditional * containerStop
container stop (stop)
bool checkIntegrity() const
check integrity
std::vector< PersonPlansValues > myPersonPlanValues
container for person trips loaded values
bool addPersonValue(GNENet *net, SumoXMLTag tag, const SUMOSAXAttributes &attrs)
add person plan value (
bool checkPersonPlanValues()
check person plan loaded (this will change tags, set begin and end elements, etc.)
struct for saving route parameters
bool loadedID
flag to check if route was loaded
std::string routeID
string for saving parsed Route ID
std::vector< GNEEdge * > edges
edges
RGBColor color
string for saving parsed route colors
void clearEdges()
clear edges
Parameterised parameters
parameters
void setEdges(GNENet *net, const std::string &edgeIDs)
set edges (list of consecutive edges)
RouteParameter()
constructor