88 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
89 const std::vector<std::string>& lines,
const int personCapacity,
const double parkingLength,
90 const RGBColor& color,
const bool friendlyPosition,
const double angle,
100 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
102 if (lane ==
nullptr) {
113 parkingLength, color, friendlyPosition, angle, parameters);
116 myNet->getViewNet()->getUndoList()->begin(busStop,
TL(
"add bus stop '") +
id +
"'");
118 myNet->getViewNet()->getUndoList()->end();
120 myNet->getAttributeCarriers()->insertAdditional(busStop);
122 busStop->
incRef(
"buildBusStop");
132 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
133 const std::vector<std::string>& lines,
const int personCapacity,
const double parkingLength,
134 const RGBColor& color,
const bool friendlyPosition,
const double angle,
144 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
146 if (lane ==
nullptr) {
157 parkingLength, color, friendlyPosition, angle, parameters);
160 myNet->getViewNet()->getUndoList()->begin(trainStop,
TL(
"add train stop '") +
id +
"'");
162 myNet->getViewNet()->getUndoList()->end();
164 myNet->getAttributeCarriers()->insertAdditional(trainStop);
166 trainStop->
incRef(
"buildTrainStop");
176 const std::string& pos,
const double length,
const bool friendlyPos,
const Parameterised::Map& parameters) {
178 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
184 if ((busStop ==
nullptr) && (trainStop ==
nullptr) && (containerStop ==
nullptr)) {
191 GNEAdditional* accessParent = busStop ? busStop : trainStop ? trainStop : containerStop;
193 bool validPos =
true;
194 double posDouble = 0;
199 }
else if (pos ==
"random" || pos ==
"doors" || pos ==
"carriage") {
201 }
else if (pos.empty()) {
208 if (lane ==
nullptr) {
210 }
else if (!validPos) {
218 return writeError(
TLF(
"Could not build access in netedit; The lane '%' doesn't support pedestrians", lane->
getID()));
221 GNEAdditional* access =
new GNEAccess(accessParent, lane, posDouble, pos, friendlyPos, length, parameters);
224 myNet->getViewNet()->getUndoList()->begin(access,
TL(
"add access in '") + accessParent->
getID() +
"'");
226 myNet->getViewNet()->getUndoList()->end();
228 myNet->getAttributeCarriers()->insertAdditional(access);
231 access->
incRef(
"buildAccess");
240 const double startPos,
const double endPos,
const std::string& name,
const std::vector<std::string>& lines,
const int containerCapacity,
241 const double parkingLength,
const RGBColor& color,
const bool friendlyPosition,
const double angle,
const Parameterised::Map& parameters) {
250 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
252 if (lane ==
nullptr) {
262 GNEAdditional* containerStop =
new GNEContainerStop(
id,
myNet,
myFilename, lane, startPos, endPos, name, lines, containerCapacity, parkingLength,
263 color, friendlyPosition, angle, parameters);
266 myNet->getViewNet()->getUndoList()->begin(containerStop,
TL(
"add container stop '") +
id +
"'");
268 myNet->getViewNet()->getUndoList()->end();
270 myNet->getAttributeCarriers()->insertAdditional(containerStop);
272 containerStop->
incRef(
"buildContainerStop");
282 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
const double chargingPower,
283 const double efficiency,
const bool chargeInTransit,
const SUMOTime chargeDelay,
const std::string& chargeType,
284 const SUMOTime waitingTime,
const bool friendlyPosition,
const std::string& parkingAreaID,
const Parameterised::Map& parameters) {
293 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
295 if (lane ==
nullptr) {
307 GNEAdditional* chargingStation =
new GNEChargingStation(
id,
myNet,
myFilename, lane, startPos, endPos, name, chargingPower, efficiency, chargeInTransit,
308 chargeDelay, chargeType, waitingTime, parkingAreaID, friendlyPosition, parameters);
311 myNet->getViewNet()->getUndoList()->begin(chargingStation,
TL(
"add charging station '") +
id +
"'");
313 myNet->getViewNet()->getUndoList()->end();
315 myNet->getAttributeCarriers()->insertAdditional(chargingStation);
317 chargingStation->
incRef(
"buildChargingStation");
327 const double startPos,
const double endPos,
const std::string& departPos,
const std::string& name,
328 const std::vector<std::string>& badges,
const bool friendlyPosition,
const int roadSideCapacity,
const bool onRoad,
329 const double width,
const double length,
const double angle,
const bool lefthand,
const Parameterised::Map& parameters) {
338 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
342 if (lane ==
nullptr) {
353 return writeError(
TLF(
"Could not build parking area with ID '%' in netedit; Invalid departPos over lane.",
id));
357 name, badges, friendlyPosition, roadSideCapacity, onRoad,
361 myNet->getViewNet()->getUndoList()->begin(parkingArea,
TL(
"add parking area '") +
id +
"'");
363 myNet->getViewNet()->getUndoList()->end();
365 myNet->getAttributeCarriers()->insertAdditional(parkingArea);
367 parkingArea->
incRef(
"buildParkingArea");
377 const std::string& name,
const std::string& width,
const std::string& length,
const std::string& angle,
const double slope,
381 return writeError(
TL(
"Could not build parking space in netedit; attribute width cannot be parse to float."));
383 return writeError(
TL(
"Could not build parking space in netedit; attribute length cannot be parse to float."));
385 return writeError(
TL(
"Could not build parking space in netedit; attribute angle cannot be parse to float."));
394 if (parkingArea ==
nullptr) {
405 myNet->getViewNet()->getUndoList()->begin(parkingSpace,
TL(
"add parking space in '") + parkingArea->
getID() +
"'");
407 myNet->getViewNet()->getUndoList()->end();
409 myNet->getAttributeCarriers()->insertAdditional(parkingSpace);
411 parkingSpace->
incRef(
"buildParkingSpace");
423 const double position,
const SUMOTime period,
const std::string& file,
const std::vector<std::string>& vehicleTypes,
424 const std::vector<std::string>& nextEdges,
const std::string& detectPersons,
const std::string& name,
434 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
436 if (lane ==
nullptr) {
449 nextEdges, detectPersons, name, friendlyPos, parameters);
452 myNet->getViewNet()->getUndoList()->begin(detectorE1,
TL(
"add induction loop '") +
id +
"'");
454 myNet->getViewNet()->getUndoList()->end();
456 myNet->getAttributeCarriers()->insertAdditional(detectorE1);
458 detectorE1->
incRef(
"buildDetectorE1");
468 const double pos,
const double length,
const SUMOTime period,
const std::string& trafficLight,
const std::string& filename,
469 const std::vector<std::string>& vehicleTypes,
const std::vector<std::string>& nextEdges,
const std::string& detectPersons,
470 const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
const double jamThreshold,
480 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
482 if (lane ==
nullptr) {
495 return writeError(
TLF(
"Could not build lane area detector with ID '%' in netedit; invalid traffic light ID.",
id));
509 vehicleTypes, nextEdges, detectPersons, name, timeThreshold,
510 speedThreshold, jamThreshold, friendlyPosCheck, show, parameters);
513 myNet->getViewNet()->getUndoList()->begin(detectorE2,
TL(
"add lane area detector '") +
id +
"'");
515 myNet->getViewNet()->getUndoList()->end();
517 myNet->getAttributeCarriers()->insertAdditional(detectorE2);
519 detectorE2->
incRef(
"buildDetectorE2");
530 const double pos,
const double endPos,
const SUMOTime period,
const std::string& trafficLight,
const std::string& filename,
531 const std::vector<std::string>& vehicleTypes,
const std::vector<std::string>& nextEdges,
const std::string& detectPersons,
532 const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
const double jamThreshold,
549 return writeError(
TLF(
"Could not build lane area detector with ID '%' in netedit; Lanes aren't consecutives.",
id));
551 pos, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(),
552 endPos, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
558 return writeError(
TLF(
"Could not build lane area detector with ID '%' in netedit; invalid traffic light ID.",
id));
572 vehicleTypes, nextEdges, detectPersons, name, timeThreshold,
573 speedThreshold, jamThreshold, friendlyPos, show, parameters);
576 myNet->getViewNet()->getUndoList()->begin(detectorE2,
TL(
"add lane area detector '") +
id +
"'");
578 myNet->getViewNet()->getUndoList()->end();
580 myNet->getAttributeCarriers()->insertAdditional(detectorE2);
581 for (
const auto& lane : lanes) {
582 lane->addChildElement(detectorE2);
584 detectorE2->
incRef(
"buildDetectorE2Multilane");
595 const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::vector<std::string>& nextEdges,
596 const std::string& detectPersons,
const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
597 const bool openEntry,
const bool expectedArrival,
const Parameterised::Map& parameters) {
617 name, timeThreshold, speedThreshold, openEntry, expectedArrival, parameters);
620 myNet->getViewNet()->getUndoList()->begin(
E3,
TL(
"add entry-exit detector '") +
id +
"'");
622 myNet->getViewNet()->getUndoList()->end();
624 myNet->getAttributeCarriers()->insertAdditional(
E3);
625 E3->incRef(
"buildDetectorE3");
636 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
640 if (lane ==
nullptr) {
642 }
else if (
E3 ==
nullptr) {
651 myNet->getViewNet()->getUndoList()->begin(entry,
TL(
"add entry detector in '") +
E3->getID() +
"'");
653 myNet->getViewNet()->getUndoList()->end();
655 myNet->getAttributeCarriers()->insertAdditional(entry);
657 E3->addChildElement(entry);
658 entry->
incRef(
"buildDetectorEntry");
669 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
673 if (lane ==
nullptr) {
675 }
else if (
E3 ==
nullptr) {
684 myNet->getViewNet()->getUndoList()->begin(exit,
TL(
"add exit detector in '") +
E3->getID() +
"'");
686 myNet->getViewNet()->getUndoList()->end();
688 myNet->getAttributeCarriers()->insertAdditional(exit);
690 E3->addChildElement(exit);
691 exit->
incRef(
"buildDetectorExit");
700 const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::vector<std::string>& nextEdges,
701 const std::string& detectPersons,
const std::string& name,
const bool friendlyPos,
const Parameterised::Map& parameters) {
710 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
712 if (lane ==
nullptr) {
721 detectPersons, name, friendlyPos, parameters);
724 myNet->getViewNet()->getUndoList()->begin(detectorE1Instant,
TL(
"add instant induction loop '") +
id +
"'");
726 myNet->getViewNet()->getUndoList()->end();
728 myNet->getAttributeCarriers()->insertAdditional(detectorE1Instant);
730 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
740 const std::string& name,
const std::string& outfile,
const SUMOTime period,
const std::string& routeprobeID,
const double jamThreshold,
const std::vector<std::string>& vTypes,
743 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
752 }
else if ((routeprobeID.size() > 0) && (routeProbe ==
nullptr)) {
754 }
else if (lane ==
nullptr) {
767 new GNECalibrator(
id,
myNet,
myFilename, lane, pos, period, name, outfile, jamThreshold, vTypes, parameters) :
768 new GNECalibrator(
id,
myNet,
myFilename, lane, pos, period, name, outfile, routeProbe, jamThreshold, vTypes, parameters);
771 myNet->getViewNet()->getUndoList()->begin(calibrator,
TL(
"add lane calibrator '") +
id +
"'");
773 myNet->getViewNet()->getUndoList()->end();
780 myNet->getAttributeCarriers()->insertAdditional(calibrator);
785 calibrator->
incRef(
"buildCalibrator");
795 const std::string& name,
const std::string& outfile,
const SUMOTime period,
const std::string& routeprobeID,
const double jamThreshold,
const std::vector<std::string>& vTypes,
798 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(edgeID,
false);
807 }
else if ((routeprobeID.size() > 0) && (routeProbe ==
nullptr)) {
809 }
else if (edge ==
nullptr) {
821 new GNECalibrator(
id,
myNet,
myFilename, edge, pos, period, name, outfile, jamThreshold, vTypes, parameters) :
822 new GNECalibrator(
id,
myNet,
myFilename, edge, pos, period, name, outfile, routeProbe, jamThreshold, vTypes, parameters);
825 myNet->getViewNet()->getUndoList()->begin(calibrator,
TL(
"add calibrator '") +
id +
"'");
827 myNet->getViewNet()->getUndoList()->end();
834 myNet->getAttributeCarriers()->insertAdditional(calibrator);
839 calibrator->
incRef(
"buildCalibrator");
856 if (vType ==
nullptr) {
858 }
else if (route ==
nullptr) {
860 }
else if (calibrator ==
nullptr) {
867 myNet->getViewNet()->getUndoList()->begin(flow,
TL(
"add calibrator flow in '") + calibrator->
getID() +
"'");
869 myNet->getViewNet()->getUndoList()->end();
871 myNet->getAttributeCarriers()->insertAdditional(flow);
875 flow->
incRef(
"buildCalibratorFlow");
884 const std::vector<std::string>& edgeIDs,
const double prob,
const std::string& name,
885 const bool off,
const bool optional,
const SUMOTime timeThreshold,
909 if (edges.size() > 0) {
910 PositionVector laneShape = edges.front()->getChildLanes().front()->getLaneShape();
914 rerouter =
new GNERerouter(
id,
myNet,
myFilename, laneShape.
positionAtOffset2D(laneShape.
length2D() - 6), name, prob, off, optional, timeThreshold, vTypes, parameters);
916 rerouter =
new GNERerouter(
id,
myNet,
myFilename,
Position(0, 0), name, prob, off, optional, timeThreshold, vTypes, parameters);
919 rerouter =
new GNERerouter(
id,
myNet,
myFilename, pos, name, prob, off, optional, timeThreshold, vTypes, parameters);
922 std::vector<GNEAdditional*> rerouterSymbols;
923 for (
const auto& edge : edges) {
928 myNet->getViewNet()->getUndoList()->begin(rerouter,
TL(
"add rerouter '") +
id +
"'");
931 for (
const auto& rerouterSymbol : rerouterSymbols) {
934 myNet->getViewNet()->getUndoList()->end();
936 myNet->getAttributeCarriers()->insertAdditional(rerouter);
937 rerouter->
incRef(
"buildRerouter");
939 for (
const auto& rerouterSymbol : rerouterSymbols) {
943 for (
int i = 0; i < (int)edges.size(); i++) {
944 edges.at(i)->addChildElement(rerouterSymbols.at(i));
958 if (rerouter ==
nullptr) {
964 }
else if (end < begin) {
965 return writeError(
TLF(
"Could not build interval with ID '%' in netedit; begin is greater than end.", rerouter->
getID()));
973 myNet->getViewNet()->getUndoList()->begin(rerouterInterval,
TL(
"add rerouter interval in '") + rerouter->
getID() +
"'");
975 myNet->getViewNet()->getUndoList()->end();
978 rerouterInterval->
incRef(
"buildRerouterInterval");
995 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(closedLaneID,
false);
997 if (lane ==
nullptr) {
999 }
else if (rerouterInterval ==
nullptr) {
1006 myNet->getViewNet()->getUndoList()->begin(closingLaneReroute,
TL(
"add closing lane reroute in '") + lane->
getID() +
"'");
1008 myNet->getViewNet()->getUndoList()->end();
1011 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
1025 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(closedEdgeID,
false);
1027 if (edge ==
nullptr) {
1029 }
else if (rerouterInterval ==
nullptr) {
1036 myNet->getViewNet()->getUndoList()->begin(closingLaneReroute,
TL(
"add closing reroute in '") + edge->
getID() +
"'");
1038 myNet->getViewNet()->getUndoList()->end();
1041 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
1054 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(newEdgeDestinationID,
false);
1056 if (edge ==
nullptr) {
1058 }
else if (rerouterInterval ==
nullptr) {
1065 myNet->getViewNet()->getUndoList()->begin(destProbReroute,
TL(
"add dest prob reroute in '") + edge->
getID() +
"'");
1067 myNet->getViewNet()->getUndoList()->end();
1070 destProbReroute->
incRef(
"builDestProbReroute");
1086 if (parkingArea ==
nullptr) {
1088 }
else if (rerouterInterval ==
nullptr) {
1095 myNet->getViewNet()->getUndoList()->begin(parkingAreaReroute,
TL(
"add parking area reroute in '") + parkingArea->
getID() +
"'");
1097 myNet->getViewNet()->getUndoList()->end();
1100 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
1116 if (route ==
nullptr) {
1118 }
else if (rerouterInterval ==
nullptr) {
1125 myNet->getViewNet()->getUndoList()->begin(routeProbReroute,
TL(
"add route prob reroute in '") + route->
getID() +
"'");
1127 myNet->getViewNet()->getUndoList()->end();
1130 routeProbReroute->
incRef(
"buildRouteProbReroute");
1141 const std::string& name,
const std::string& file,
const SUMOTime begin,
const std::vector<std::string>& vTypes,
1151 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(edgeID,
false);
1153 if (edge ==
nullptr) {
1166 myNet->getViewNet()->getUndoList()->begin(routeProbe,
TL(
"add route probe '") +
id +
"'");
1168 myNet->getViewNet()->getUndoList()->end();
1175 myNet->getAttributeCarriers()->insertAdditional(routeProbe);
1177 routeProbe->
incRef(
"buildRouteProbe");
1187 const std::vector<std::string>& laneIDs,
const std::string& name,
const std::vector<std::string>& vTypes,
const Parameterised::Map& parameters) {
1198 if (lanes.empty()) {
1208 std::vector<GNEAdditional*> VSSSymbols;
1209 for (
const auto& lane : lanes) {
1214 myNet->getViewNet()->getUndoList()->begin(variableSpeedSign,
TL(
"add Variable Speed Sign '") +
id +
"'");
1216 for (
const auto& VSSSymbol : VSSSymbols) {
1219 myNet->getViewNet()->getUndoList()->end();
1221 myNet->getAttributeCarriers()->insertAdditional(variableSpeedSign);
1222 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
1224 for (
const auto& VSSSymbol : VSSSymbols) {
1228 for (
int i = 0; i < (int)lanes.size(); i++) {
1229 lanes.at(i)->addChildElement(VSSSymbols.at(i));
1244 if (
VSS ==
nullptr) {
1253 myNet->getViewNet()->getUndoList()->begin(variableSpeedSignStep,
TL(
"add VSS Step in '") +
VSS->
getID() +
"'");
1255 myNet->getViewNet()->getUndoList()->end();
1257 VSS->addChildElement(variableSpeedSignStep);
1258 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
1261 VSS->updateCenteringBoundary(
true);
1278 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(edgeID,
false);
1280 if (edge ==
nullptr) {
1286 }
else if (endTime < beginTime) {
1287 return writeError(
TLF(
"Could not build Vaporizer with ID '%' in netedit; begin is greater than end.", edge->
getID()));
1293 myNet->getViewNet()->getUndoList()->begin(vaporizer,
TL(
"add vaporizer in '") + edge->
getID() +
"'");
1295 myNet->getViewNet()->getUndoList()->end();
1302 myNet->getAttributeCarriers()->insertAdditional(vaporizer);
1304 vaporizer->
incRef(
"buildVaporizer");
1314 const Position& center,
const bool fill,
const RGBColor& color,
const std::vector<std::string>& edgeIDs,
1318 if (edges.size() != edgeIDs.size()) {
1323 if (TAZShape.size() == 0) {
1326 for (
const auto& edge : edges) {
1327 TAZBoundary.
add(edge->getCenteringBoundary());
1333 const GNEEdge* sourceSinkEdge =
myNet->getAttributeCarriers()->retrieveEdge(sourceSink->getStringAttribute(
SUMO_ATTR_ID),
false);
1334 if (sourceSinkEdge) {
1340 TAZShape = TAZBoundary.
getShape(
true);
1348 }
else if (TAZShape.size() == 0) {
1349 return writeError(
TLF(
"Could not build TAZ with ID '%' in netedit; Invalid Shape.",
id));
1355 myNet->disableUpdateGeometry();
1358 myNet->getViewNet()->getUndoList()->begin(
TAZ,
TL(
"add TAZ '") +
id +
"'");
1361 for (
const auto& edge : edges) {
1369 myNet->getViewNet()->getUndoList()->end();
1371 myNet->getAttributeCarriers()->insertAdditional(
TAZ);
1372 TAZ->incRef(
"buildTAZ");
1373 for (
const auto& edge : edges) {
1376 myNet->getAttributeCarriers()->insertTAZSourceSink(TAZSource);
1377 TAZSource->
incRef(
"buildTAZ");
1378 TAZ->addChildElement(TAZSource);
1379 edge->addChildElement(TAZSource);
1382 myNet->getAttributeCarriers()->insertTAZSourceSink(TAZSink);
1383 TAZSink->
incRef(
"buildTAZ");
1384 TAZ->addChildElement(TAZSink);
1385 edge->addChildElement(TAZSink);
1389 myNet->enableUpdateGeometry();
1391 TAZ->updateGeometry();
1403 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(edgeID,
false);
1405 if (
TAZ ==
nullptr) {
1407 }
else if (edge ==
nullptr) {
1414 if (((*it)->getTagProperty()->getTag() ==
SUMO_TAG_TAZSOURCE) && ((*it)->getParentAdditionals().front() ==
TAZ)) {
1415 existentTAZSource = (*it);
1419 if (existentTAZSource ==
nullptr) {
1424 myNet->getViewNet()->getUndoList()->begin(
TAZ,
TL(
"add TAZ Source in '") +
TAZ->getID() +
"'");
1426 myNet->getViewNet()->getUndoList()->end();
1428 myNet->getAttributeCarriers()->insertTAZSourceSink(TAZSource);
1429 TAZ->addChildElement(TAZSource);
1431 TAZSource->
incRef(
"buildTAZSource");
1436 myNet->getViewNet()->getUndoList()->begin(
TAZ,
TL(
"update TAZ Source in '") +
TAZ->getID() +
"'");
1438 myNet->getViewNet()->getUndoList()->end();
1453 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(edgeID,
false);
1455 if (
TAZ ==
nullptr) {
1457 }
else if (edge ==
nullptr) {
1464 if (((*it)->getTagProperty()->getTag() ==
SUMO_TAG_TAZSINK) && ((*it)->getParentAdditionals().front() ==
TAZ)) {
1465 existentTAZSink = (*it);
1469 if (existentTAZSink ==
nullptr) {
1474 myNet->getViewNet()->getUndoList()->begin(
TAZ,
TL(
"add TAZ Sink in '") +
TAZ->getID() +
"'");
1476 myNet->getViewNet()->getUndoList()->end();
1478 myNet->getAttributeCarriers()->insertTAZSourceSink(TAZSink);
1479 TAZ->addChildElement(TAZSink);
1481 TAZSink->
incRef(
"buildTAZSink");
1486 myNet->getViewNet()->getUndoList()->begin(
TAZ,
TL(
"update TAZ Sink in '") +
TAZ->getID() +
"'");
1488 myNet->getViewNet()->getUndoList()->end();
1500 const double voltage,
const double currentLimit,
const Parameterised::Map& parameters) {
1516 myNet->getViewNet()->getUndoList()->begin(tractionSubstation,
TL(
"add traction substation '") +
id +
"'");
1518 myNet->getViewNet()->getUndoList()->end();
1520 myNet->getAttributeCarriers()->insertAdditional(tractionSubstation);
1521 tractionSubstation->
incRef(
"buildTractionSubstation");
1530 const std::vector<std::string>& laneIDs,
const double startPos,
const double endPos,
const bool friendlyPos,
1531 const std::vector<std::string>& forbiddenInnerLanes,
const Parameterised::Map& parameters) {
1544 if (lanes.empty()) {
1549 return writeError(
TLF(
"Could not build overhead wire with ID '%' in netedit; Lanes aren't consecutives.",
id));
1551 startPos, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(),
1552 endPos, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
1554 }
else if (tractionSubstation ==
nullptr) {
1561 myNet->getViewNet()->getUndoList()->begin(overheadWire,
TL(
"add overhead wire '") +
id +
"'");
1563 myNet->getViewNet()->getUndoList()->end();
1565 myNet->getAttributeCarriers()->insertAdditional(overheadWire);
1566 for (
const auto& lane : lanes) {
1567 lane->addChildElement(overheadWire);
1569 overheadWire->
incRef(
"buildOverheadWire");
1580 const std::string& ,
const std::string& ,
const std::string& ,
1589 const RGBColor& color,
double layer,
double angle,
const std::string& imgFile,
const PositionVector& shape,
1590 bool geo,
bool fill,
double lineWidth,
const std::string& name,
const Parameterised::Map& parameters) {
1592 if (type ==
"jupedsim.walkable_area") {
1594 }
else if (type ==
"jupedsim.obstacle") {
1607 GNEPoly* poly =
new GNEPoly(
id,
myNet,
myFilename, type, shape, geo, fill, lineWidth, color, layer, angle, imgFile, name, parameters);
1610 myNet->getViewNet()->getUndoList()->begin(poly,
TL(
"add polygon '") +
id +
"'");
1612 myNet->getViewNet()->getUndoList()->end();
1615 myNet->getAttributeCarriers()->insertAdditional(poly);
1616 poly->
incRef(
"addPolygon");
1626 const RGBColor& color,
const double x,
const double y,
const std::string& icon,
double layer,
double angle,
1627 const std::string& imgFile,
double width,
double height,
const std::string& name,
const Parameterised::Map& parameters) {
1646 GNEPOI*
POI =
new GNEPOI(
id,
myNet,
myFilename, type, color, pos,
false,
POIIcon, layer, angle, imgFile, width, height, name, parameters);
1649 myNet->getViewNet()->getUndoList()->begin(
POI,
TLF(
"add POI '%'",
id));
1651 myNet->getViewNet()->getUndoList()->end();
1654 myNet->getAttributeCarriers()->insertAdditional(
POI);
1655 POI->incRef(
"addPOI");
1664 const RGBColor& color,
const std::string& laneID,
double posOverLane,
const bool friendlyPos,
double posLat,
1665 const std::string& icon,
double layer,
double angle,
const std::string& imgFile,
double width,
double height,
1681 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
1683 if (lane ==
nullptr) {
1691 GNEAdditional* POILane =
new GNEPOI(
id,
myNet,
myFilename, type, color, lane, posOverLane, friendlyPos, posLat,
POIIcon, layer,
1692 angle, imgFile, width, height, name, parameters);
1695 myNet->getViewNet()->getUndoList()->begin(POILane,
TLF(
"add POI lane '%'",
id));
1697 myNet->getViewNet()->getUndoList()->end();
1700 myNet->getAttributeCarriers()->insertAdditional(POILane);
1702 POILane->
incRef(
"buildPOILane");
1712 const RGBColor& color,
const double lon,
const double lat,
const std::string& icon,
double layer,
1713 double angle,
const std::string& imgFile,
double width,
double height,
const std::string& name,
1728 return writeError(
TLF(
"Could not build POI with ID '%' in netedit",
id) + std::string(
"; ") +
TL(
"Network requires a geo projection."));
1731 const auto pos =
Position(lon, lat);
1735 GNEPOI*
POIGEO =
new GNEPOI(
id,
myNet,
myFilename, type, color, pos,
true,
POIIcon, layer, angle, imgFile, width, height, name, parameters);
1738 myNet->getViewNet()->getUndoList()->begin(
POIGEO,
TLF(
"add POI GEO '%'",
id));
1740 myNet->getViewNet()->getUndoList()->end();
1743 myNet->getAttributeCarriers()->insertAdditional(
POIGEO);
1744 POIGEO->incRef(
"buildPOIGeo");
1765 myNet->getViewNet()->getUndoList()->begin(walkableArea,
TL(
"add jps walkable area '") +
id +
"'");
1767 myNet->getViewNet()->getUndoList()->end();
1770 myNet->getAttributeCarriers()->insertAdditional(walkableArea);
1771 walkableArea->
incRef(
"addWalkableArea");
1792 myNet->getViewNet()->getUndoList()->begin(obstacle,
TL(
"add jps obstacle '") +
id +
"'");
1794 myNet->getViewNet()->getUndoList()->end();
1797 myNet->getAttributeCarriers()->insertAdditional(obstacle);
1798 obstacle->
incRef(
"addObstacle");
1826 std::vector<std::pair<SUMOTime, SUMOTime>> sortedIntervals;
1829 if (!rerouterChild->getTagProperty()->isSymbol()) {
1837 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
1839 std::sort(sortedIntervals.begin(), sortedIntervals.end());
1841 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
1842 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
1860 if ((pos < 0) || (pos > laneLength)) {
1864 if ((pos + length) > laneLength) {
1874 if (friendlyPos ==
true) {
1882 if ((pos < 0) || (pos > laneLength)) {
1886 if ((pos + length) > laneLength) {
1912 if ((to - from) < POSITION_EPS) {
1915 if ((from < 0) || (from > laneLength)) {
1918 if ((to < 0) || (to > laneLength)) {
1939 }
else if (from > laneLength) {
1948 }
else if (to > laneLength) {
1952 if ((to - from) < POSITION_EPS) {
1953 if (to >= POSITION_EPS) {
1954 from = to - POSITION_EPS;
1998 return myNet->getAttributeCarriers()->retrieveRerouterInterval(
2006std::vector<GNEEdge*>
2008 std::vector<GNEEdge*> edges;
2009 for (
const auto& edgeID : edgeIDs) {
2010 GNEEdge* edge =
myNet->getAttributeCarriers()->retrieveEdge(edgeID,
false);
2012 if (edge ==
nullptr) {
2017 edges.push_back(edge);
2024std::vector<GNELane*>
2026 std::vector<GNELane*> lanes;
2027 for (
const auto& laneID : laneIDs) {
2028 GNELane* lane =
myNet->getAttributeCarriers()->retrieveLane(laneID,
false);
2030 if (lane ==
nullptr) {
2035 lanes.push_back(lane);
2044 for (
const auto& tag : tags) {
2046 auto additionalElement =
myNet->getAttributeCarriers()->retrieveAdditional(tag,
id,
false);
2047 if (additionalElement) {
2048 return additionalElement;
2057 if (additionalElement) {
2060 myNet->deleteAdditional(additionalElement,
myNet->getViewNet()->getUndoList());
2070 myNet->deleteAdditional(additionalElement,
myNet->getViewNet()->getUndoList());
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const std::string DEFAULT_VTYPE_ID
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_TRACTION_SUBSTATION
A traction substation.
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ SUMO_TAG_REROUTER
A rerouter.
@ GNE_TAG_MULTI_LANE_AREA_DETECTOR
an e2 detector over multiple lanes (placed here due create Additional Frame)
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_STEP
trigger: a step description
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_DET_ENTRY
an e3 entry point
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
@ SUMO_TAG_ROUTE
description of a route
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_OVERHEAD_WIRE_SECTION
An overhead wire section.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop).
@ SUMO_TAG_SOURCE
a source
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destination of a reroute
@ GNE_TAG_POILANE
Point of interest over Lane.
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_DET_EXIT
an e3 exit point
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
@ SUMO_TAG_LANE_AREA_DETECTOR
alternative tag for e2 detector
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_ENTRY_EXIT_DETECTOR
alternative tag for e3 detector
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ SUMO_ATTR_PARKING_LENGTH
@ SUMO_ATTR_VOLTAGE
voltage of the traction substation [V]
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_ROADSIDE_CAPACITY
@ SUMO_ATTR_CURRENTLIMIT
current limit of the traction substation [A]
@ SUMO_ATTR_CHARGINGPOWER
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations (different of waiting time).
@ SUMO_ATTR_TIME
trigger: the time of the step
const double INVALID_DOUBLE
invalid double
const double SUMO_const_laneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
AdditionalHandler(const std::string &filename)
Constructor.
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
PositionVector getShape(const bool closeShape) const
get position vector (shape) based on this boundary
bool writeError(const std::string &error)
write error and enable error creating element
bool checkValidDetectorID(const SumoXMLTag tag, const std::string &value)
check if the given detector ID is valid
bool checkListOfVehicleTypes(const SumoXMLTag tag, const std::string &id, const std::vector< std::string > &vTypeIDs)
check list of IDs
bool writeWarningDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write warning duplicated element
bool writeErrorInvalidParent(const SumoXMLTag tag, const std::string &id, const std::vector< SumoXMLTag > parentTags, const std::string &parentID)
write error "invalid parent element" giving ids of current and parent element
bool myOverwriteElements
overwrite elements
bool checkValidAdditionalID(const SumoXMLTag tag, const std::string &value)
check if the given additional ID is valid
bool checkFileName(const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const std::string &value)
check if the given filename is valid
bool writeErrorInvalidPosition(const SumoXMLTag tag, const std::string &id)
write error "invalid position"
const std::string myFilename
filename
bool checkNegative(const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const int value, const bool canBeZero)
check if the given int value is NOT negative
bool myRemainElements
remain elements
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time attribute
bool hasBoolAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given bool attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
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
get XML myTag
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::vector< SumoBaseObject * > & getSumoBaseObjectChildren() const
get SumoBaseObject children
GNEAdditional * retrieveAdditionalElement(const std::vector< SumoXMLTag > tags, const std::string &id)
get element by ID
bool buildJpsWalkableArea(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const PositionVector &shape, bool geo, const std::string &name, const Parameterised::Map ¶meters)
Builds a JuPedSim walkable area using the given values.
bool buildLaneCalibrator(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double pos, const std::string &name, const std::string &outfile, const SUMOTime period, const std::string &routeprobe, const double jamThreshold, const std::vector< std::string > &vTypes, const Parameterised::Map ¶meters)
builds a microscopic calibrator over a lane
bool buildClosingReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &closedEdgeID, SVCPermissions permissions)
builds a closing edge reroute
~GNEAdditionalHandler()
Destructor.
GNEAdditional * getRerouterIntervalParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get rerouter interval parent
std::vector< GNELane * > parseLanes(const SumoXMLTag tag, const std::string &id, const std::vector< std::string > &laneIDs)
parse lanes
void fixLaneDoublePosition(double &from, double &to, const double laneLengt)
fix the given positions over lane
bool checkFriendlyPosSmallLanes(double pos, const double length, const double laneLength, const bool friendlyPos)
check if enable friendly pos in small lanes
bool buildPOI(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double x, const double y, const std::string &icon, const double layer, const double angle, const std::string &imgFile, const double width, const double height, const std::string &name, const Parameterised::Map ¶meters)
Builds a POI using the given values.
bool buildPOIGeo(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double lon, const double lat, const std::string &icon, const double layer, const double angle, const std::string &imgFile, const double width, const double height, const std::string &name, const Parameterised::Map ¶meters)
Builds a POI in GEO coordinaten using the given values.
bool buildTrainStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const std::vector< std::string > &lines, const int personCapacity, const double parkingLength, const RGBColor &color, const bool friendlyPosition, const double angle, const Parameterised::Map ¶meters)
Builds a train stop.
bool buildTAZSource(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const double departWeight)
Builds a TAZSource (Traffic Assignment Zone).
bool buildOverheadWireClamp(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &overheadWireIDStartClamp, const std::string &laneIDStartClamp, const std::string &overheadWireIDEndClamp, const std::string &laneIDEndClamp, const Parameterised::Map ¶meters)
build overhead wire clamp
bool buildOverheadWire(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &substationId, const std::vector< std::string > &laneIDs, const double startPos, const double endPos, const bool friendlyPos, const std::vector< std::string > &forbiddenInnerLanes, const Parameterised::Map ¶meters)
build overhead wire
GNEAdditional * getAdditionalParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, SumoXMLTag tag) const
get additional parent
bool buildMultiLaneDetectorE2(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::vector< std::string > &laneIDs, const double pos, const double endPos, const SUMOTime period, const std::string &trafficLight, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::vector< std::string > &nextEdges, const std::string &detectPersons, const std::string &name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold, const bool friendlyPos, const bool show, const Parameterised::Map ¶meters)
Builds a multi-lane Area Detector (E2).
bool buildE1Detector(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double position, const SUMOTime period, const std::string &file, const std::vector< std::string > &vehicleTypes, const std::vector< std::string > &nextEdges, const std::string &detectPersons, const std::string &name, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a induction loop detector (E1).
bool buildVariableSpeedSignStep(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOTime time, const double speed)
Builds a VariableSpeedSign Step.
bool buildPOILane(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const std::string &laneID, const double posOverLane, const bool friendlyPos, const double posLat, const std::string &icon, const double layer, const double angle, const std::string &imgFile, const double width, const double height, const std::string &name, const Parameterised::Map ¶meters)
Builds a POI over lane using the given values.
bool buildBusStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const std::vector< std::string > &lines, const int personCapacity, const double parkingLength, const RGBColor &color, const bool friendlyPosition, const double angle, const Parameterised::Map ¶meters)
Builds a bus stop.
bool buildAccess(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const std::string &pos, const double length, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds an Access.
static bool accessExists(const GNEAdditional *stoppingPlaceParent, const GNEEdge *edge)
check if a GNEAccess can be created in the given edge
bool buildDetectorEntry(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a entry detector (E3).
bool buildContainerStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const std::vector< std::string > &lines, const int containerCapacity, const double parkingLength, const RGBColor &color, const bool friendlyPosition, const double angle, const Parameterised::Map ¶meters)
Builds a container stop.
bool buildEdgeCalibrator(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &edgeID, const double pos, const std::string &name, const std::string &outfile, const SUMOTime period, const std::string &routeprobe, const double jamThreshold, const std::vector< std::string > &vTypes, const Parameterised::Map ¶meters)
builds a microscopic calibrator over an edge
bool buildRerouter(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const std::vector< std::string > &edgeIDs, const double prob, const std::string &name, const bool off, const bool optional, const SUMOTime timeThreshold, const std::vector< std::string > &vTypes, const Parameterised::Map ¶meters)
builds a rerouter
bool buildDestProbReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newEdgeDestinationID, const double probability)
builds a dest prob reroute
bool buildClosingLaneReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &closedLane, SVCPermissions permissions)
builds a closing lane reroute
bool buildCalibratorFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameter)
builds a calibrator flow
bool buildVariableSpeedSign(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const std::vector< std::string > &laneIDs, const std::string &name, const std::vector< std::string > &vTypes, const Parameterised::Map ¶meters)
Builds a VariableSpeedSign (lane speed additional).
bool buildParkingAreaReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newParkignAreaID, const double probability, const bool visible)
builds a parking area reroute
GNEAdditionalHandler()=delete
invalidate default constructo
bool buildDetectorExit(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a exit detector (E3).
bool buildParkingSpace(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const double x, const double y, const double z, const std::string &name, const std::string &width, const std::string &length, const std::string &angle, const double slope, const Parameterised::Map ¶meters)
Builds a Parking Space.
const bool myAllowUndoRedo
allow undo/redo
bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::string &id, const std::vector< std::string > &edgeIDs)
parse edges
bool postParserTasks()
run post parser tasks
bool buildTractionSubstation(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const double voltage, const double currentLimit, const Parameterised::Map ¶meters)
build traction substation
bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
bool buildRerouterInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOTime begin, const SUMOTime end)
builds a rerouter interval
bool buildDetectorE1Instant(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double pos, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::vector< std::string > &nextEdges, const std::string &detectPersons, const std::string &name, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a Instant Induction Loop Detector (E1Instant).
bool buildTAZSink(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const double arrivalWeight)
Builds a TAZSink (Traffic Assignment Zone).
bool checkElement(const SumoXMLTag tag, GNEAdditional *additional)
check if element exist, and if overwrite
bool buildSingleLaneDetectorE2(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double pos, const double length, const SUMOTime period, const std::string &trafficLight, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::vector< std::string > &nextEdges, const std::string &detectPersons, const std::string &name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold, const bool friendlyPos, const bool show, const Parameterised::Map ¶meters)
Builds a single-lane Area Detector (E2).
bool checkOverlappingRerouterIntervals(GNEAdditional *rerouter, const SUMOTime newBegin, const SUMOTime newEnd)
check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted
GNENet * myNet
pointer to GNENet
bool buildChargingStation(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const double chargingPower, const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay, const std::string &chargeType, const SUMOTime waitingTime, const bool friendlyPosition, const std::string &parkingAreaID, const Parameterised::Map ¶meters)
Builds a charging Station.
bool buildJpsObstacle(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const PositionVector &shape, bool geo, const std::string &name, const Parameterised::Map ¶meters)
Builds a JuPedSim obstacle using the given values.
bool buildParkingArea(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &departPos, const std::string &name, const std::vector< std::string > &badges, const bool friendlyPosition, const int roadSideCapacity, const bool onRoad, const double width, const double length, const double angle, const bool lefthand, const Parameterised::Map ¶meters)
Builds a Parking Area.
bool buildTAZ(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const PositionVector &shape, const Position ¢er, const bool fill, const RGBColor &color, const std::vector< std::string > &edgeIDs, const std::string &name, const Parameterised::Map ¶meters)
Builds a TAZ (Traffic Assignment Zone).
bool buildVaporizer(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const SUMOTime from, const SUMOTime endTime, const std::string &name, const Parameterised::Map ¶meters)
Builds a vaporizer (lane speed additional).
bool buildRouteProbe(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &edgeID, const SUMOTime period, const std::string &name, const std::string &file, const SUMOTime begin, const std::vector< std::string > &vTypes, const Parameterised::Map ¶meters)
builds a Route probe
bool buildDetectorE3(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const SUMOTime period, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::vector< std::string > &nextEdges, const std::string &detectPersons, const std::string &name, const SUMOTime timeThreshold, const double speedThreshold, const bool openEntry, const bool expectedArrival, const Parameterised::Map ¶meters)
Builds a multi entry exit detector (E3).
bool buildRouteProbReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newRouteID, const double probability)
builds a route prob reroute
bool buildPolygon(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double layer, const double angle, const std::string &imgFile, const PositionVector &shape, const bool geo, const bool fill, const double lineWidth, const std::string &name, const Parameterised::Map ¶meters)
Builds a polygon using the given values.
bool checkMultiLanePosition(double fromPos, const double fromLaneLength, const double toPos, const double tolaneLength, const bool friendlyPos)
check if the given positions over two lanes are valid
virtual void updateCenteringBoundary(const bool updateGrid)=0
update centering boundary (implies change in RTREE)
static bool areLaneConsecutives(const std::vector< GNELane * > &lanes)
check if the given lanes are consecutive
virtual Position getPositionInView() const =0
Returns position of additional in view.
const std::string getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
const std::string & getTagStr() const
get tag assigned to this object in string format
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual void updateGeometry()=0
update pre-computed geometry information
static GNEBusStop * buildTrainStop(GNENet *net)
default constructor
static GNEBusStop * buildBusStop(GNENet *net)
default constructor
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
NBEdge * getNBEdge() const
returns the internal NBEdge
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
const GNEHierarchicalContainerChildrenSet< GNETAZSourceSink * > & getChildTAZSourceSinks() const
return child TAZSourceSinks (Set)
void addChildElement(ChildType *element)
add child without updating parent (ONLY used if we're creating elements without undo-redo)
bool allowPedestrians() const
check if current lane allow pedestrians
GNEEdge * getParentEdge() const
get parent edge
A NBNetBuilder extended by visualisation and editing capabilities.
void incRef(const std::string &debugMsg="")
Increase reference.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
double getFinalLength() const
get length that will be assigned to the lanes in the final network
static const std::vector< SumoXMLTag > busStops
busStops namespace
static const std::vector< SumoXMLTag > laneAreaDetectors
lane area detectors namespace
static const std::vector< SumoXMLTag > POIs
POIs namespace.
static const std::vector< SumoXMLTag > calibrators
calibrators namespace
static const std::vector< SumoXMLTag > polygons
polygon namespace
static OptionsCont & getOptions()
Retrieves the options.
C++ TraCI client API implementation.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
static const Position INVALID
used to indicate that a position is valid
double length2D() const
Returns the length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed).
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
Structure representing possible vehicle parameter.
std::string vtypeid
The vehicle's type id.
std::string routeid
The vehicle's route id.
static StringBijection< ChargeType > ChargeTypes
charge type
static StringBijection< POIIcon > POIIcons
POI icon values.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element