67 myAllowUndoRedo(allowUndoRedo),
68 myOverwrite(overwrite) {
78 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
79 const std::vector<std::string>& lines,
const int personCapacity,
const double parkingLength,
90 if (lane ==
nullptr) {
94 }
else if (personCapacity < 0) {
96 }
else if (parkingLength < 0) {
101 parkingLength, color, friendlyPosition, parameters);
111 busStop->
incRef(
"buildBusStop");
122 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
123 const std::vector<std::string>& lines,
const int personCapacity,
const double parkingLength,
134 if (lane ==
nullptr) {
138 }
else if (personCapacity < 0) {
140 }
else if (parkingLength < 0) {
145 parkingLength, color, friendlyPosition, parameters);
155 trainStop->
incRef(
"buildTrainStop");
166 const double pos,
const double length,
const bool friendlyPos,
const Parameterised::Map& parameters) {
173 if (busStop ==
nullptr) {
177 if (lane ==
nullptr) {
179 }
else if (busStop ==
nullptr) {
183 }
else if ((length != -1) && (length < 0)) {
188 WRITE_WARNING(
TLF(
"Could not build access in netedit; The lane '%' doesn't support pedestrians", lane->
getID()));
202 access->
incRef(
"buildAccess");
210 const double startPos,
const double endPos,
const std::string& name,
const std::vector<std::string>& lines,
const int containerCapacity,
221 if (lane ==
nullptr) {
225 }
else if (containerCapacity < 0) {
227 }
else if (parkingLength < 0) {
232 color, friendlyPosition, parameters);
242 containerStop->
incRef(
"buildContainerStop");
253 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
const double chargingPower,
254 const double efficiency,
const bool chargeInTransit,
const SUMOTime chargeDelay,
const bool friendlyPosition,
265 if (lane ==
nullptr) {
269 }
else if (chargingPower < 0) {
271 }
else if (chargeDelay < 0) {
276 chargeDelay, friendlyPosition, parameters);
286 chargingStation->
incRef(
"buildChargingStation");
298 const double startPos,
const double endPos,
const std::string& departPos,
const std::string& name,
const bool friendlyPosition,
299 const int roadSideCapacity,
const bool onRoad,
const double width,
const double length,
const double angle,
310 const double departPosDouble = GNEAttributeCarrier::canParse<double>(departPos) ? GNEAttributeCarrier::parse<double>(departPos) : 0;
312 if (lane ==
nullptr) {
316 }
else if (roadSideCapacity < 0) {
318 }
else if (width < 0) {
320 }
else if (length < 0) {
323 writeError(
TLF(
"Could not build parking area with ID '%' in netedit; Invalid departPos over lane.",
id));
327 name, friendlyPosition, roadSideCapacity, onRoad,
338 parkingArea->
incRef(
"buildParkingArea");
349 const std::string& name,
const std::string& width,
const std::string& length,
const std::string& angle,
const double slope,
352 if (!width.empty() && !GNEAttributeCarrier::canParse<double>(width)) {
353 writeError(
TL(
"Could not build parking space in netedit; attribute width cannot be parse to float."));
354 }
else if (!length.empty() && !GNEAttributeCarrier::canParse<double>(length)) {
355 writeError(
TL(
"Could not build parking space in netedit; attribute length cannot be parse to float."));
356 }
else if (!angle.empty() && !GNEAttributeCarrier::canParse<double>(angle)) {
357 writeError(
TL(
"Could not build parking space in netedit; attribute angle cannot be parse to float."));
364 const double widthDouble = width.empty() ? 0 : GNEAttributeCarrier::parse<double>(width);
365 const double lengthDouble = length.empty() ? 0 : GNEAttributeCarrier::parse<double>(length);
367 if (parkingArea ==
nullptr) {
369 }
else if (widthDouble < 0) {
371 }
else if (lengthDouble < 0) {
375 GNEAdditional* parkingSpace =
new GNEParkingSpace(
myNet, parkingArea,
Position(x, y, z), width, length, angle, slope, name, parameters);
385 parkingSpace->
incRef(
"buildParkingSpace");
396 const double position,
const SUMOTime period,
const std::string& file,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
407 if (lane ==
nullptr) {
411 }
else if (period < 0) {
429 detectorE1->
incRef(
"buildDetectorE1");
440 const double pos,
const double length,
const SUMOTime period,
const std::string& trafficLight,
const std::string& filename,
const std::vector<std::string>& vehicleTypes,
441 const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
const double jamThreshold,
const bool friendlyPos,
452 if (lane ==
nullptr) {
456 }
else if (length < 0) {
458 }
else if ((period != -1) && (period < 0)) {
462 writeError(
TLF(
"Could not build lane area detector with ID '%' in netedit; invalid traffic light ID.",
id));
463 }
else if (timeThreshold < 0) {
465 }
else if (speedThreshold < 0) {
467 }
else if (jamThreshold < 0) {
469 }
else if (timeThreshold < 0) {
471 }
else if (speedThreshold < 0) {
473 }
else if (jamThreshold < 0) {
482 id, lane,
myNet, pos, length, period, trafficLight, filename,
483 vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold,
484 friendlyPos, parameters);
494 detectorE2->
incRef(
"buildDetectorE2");
505 const double pos,
const double endPos,
const SUMOTime period,
const std::string& trafficLight,
const std::string& filename,
const std::vector<std::string>& vehicleTypes,
506 const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
const double jamThreshold,
const bool friendlyPos,
517 if (lanes.size() > 0) {
520 writeError(
TLF(
"Could not build lane area detector with ID '%' in netedit; Lanes aren't consecutives.",
id));
522 pos, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(),
523 endPos, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
525 }
else if ((period != -1) && (period < 0)) {
529 writeError(
TLF(
"Could not build lane area detector with ID '%' in netedit; invalid traffic light ID.",
id));
530 }
else if (timeThreshold < 0) {
532 }
else if (speedThreshold < 0) {
534 }
else if (jamThreshold < 0) {
543 id, lanes,
myNet, pos, endPos, period, trafficLight, filename,
544 vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold,
545 friendlyPos, parameters);
554 for (
const auto& lane : lanes) {
555 lane->addChildElement(detectorE2);
557 detectorE2->
incRef(
"buildDetectorE2Multilane");
571 const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
576 }
else if (period < 0) {
578 }
else if (timeThreshold < 0) {
580 }
else if (speedThreshold < 0) {
599 E3->incRef(
"buildDetectorE3");
615 if (lane ==
nullptr) {
617 }
else if (
E3 ==
nullptr) {
635 E3->addChildElement(entry);
636 entry->
incRef(
"buildDetectorEntry");
650 if (lane ==
nullptr) {
652 }
else if (
E3 ==
nullptr) {
670 E3->addChildElement(exit);
671 exit->
incRef(
"buildDetectorExit");
679 const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
const bool friendlyPos,
const Parameterised::Map& parameters) {
689 if (lane ==
nullptr) {
707 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
718 const std::string& name,
const std::string& outfile,
const SUMOTime period,
const std::string& routeprobeID,
const double jamThreshold,
const std::vector<std::string>& vTypes,
729 }
else if ((routeprobeID.size() > 0) && (routeProbe ==
nullptr)) {
731 }
else if (lane ==
nullptr) {
739 }
else if (period < 0) {
741 }
else if (jamThreshold < 0) {
746 new GNECalibrator(
id,
myNet, lane, pos, period, name, outfile, jamThreshold, vTypes, parameters) :
747 new GNECalibrator(
id,
myNet, lane, pos, period, name, outfile, routeProbe, jamThreshold, vTypes, parameters);
764 calibrator->
incRef(
"buildCalibrator");
773 const std::string& name,
const std::string& outfile,
const SUMOTime period,
const std::string& routeprobeID,
const double jamThreshold,
const std::vector<std::string>& vTypes,
784 }
else if ((routeprobeID.size() > 0) && (routeProbe ==
nullptr)) {
786 }
else if (edge ==
nullptr) {
793 }
else if (period < 0) {
795 }
else if (jamThreshold < 0) {
800 new GNECalibrator(
id,
myNet, edge, pos, period, name, outfile, jamThreshold, vTypes, parameters) :
801 new GNECalibrator(
id,
myNet, edge, pos, period, name, outfile, routeProbe, jamThreshold, vTypes, parameters);
818 calibrator->
incRef(
"buildCalibrator");
834 if (vType ==
nullptr) {
836 }
else if (route ==
nullptr) {
838 }
else if (calibrator ==
nullptr) {
853 flow->
incRef(
"buildCalibratorFlow");
861 const std::vector<std::string>& edgeIDs,
const double prob,
const std::string& name,
const bool off,
const SUMOTime timeThreshold,
866 }
else if (prob < 0) {
868 }
else if (timeThreshold < 0) {
878 if (edges.size() > 0) {
882 if (edges.size() > 0) {
883 PositionVector laneShape = edges.front()->getLanes().front()->getLaneShape();
892 rerouter =
new GNERerouter(
id,
myNet, pos, name, prob, off, timeThreshold, vTypes, parameters);
895 std::vector<GNEAdditional*> rerouterSymbols;
896 for (
const auto& edge : edges) {
905 for (
const auto& rerouterSymbol : rerouterSymbols) {
911 rerouter->
incRef(
"buildRerouter");
913 for (
const auto& rerouterSymbol : rerouterSymbols) {
917 for (
int i = 0; i < (int)edges.size(); i++) {
918 edges.at(i)->addChildElement(rerouterSymbols.at(i));
933 if (rerouter ==
nullptr) {
935 }
else if (begin < 0) {
937 }
else if (end < 0) {
939 }
else if (end < begin) {
940 writeError(
TLF(
"Could not build interval with ID '%' in netedit; begin is greather than end.", rerouter->
getID()));
954 rerouterInterval->
incRef(
"buildRerouterInterval");
970 if (lane ==
nullptr) {
972 }
else if (rerouterInterval ==
nullptr) {
985 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
998 if (edge ==
nullptr) {
1000 }
else if (rerouterInterval ==
nullptr) {
1013 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
1025 if (edge ==
nullptr) {
1027 }
else if (rerouterInterval ==
nullptr) {
1040 destProbReroute->
incRef(
"builDestProbReroute");
1053 if (parkingArea ==
nullptr) {
1055 }
else if (rerouterInterval ==
nullptr) {
1068 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
1081 if (route ==
nullptr) {
1083 }
else if (rerouterInterval ==
nullptr) {
1096 routeProbReroute->
incRef(
"buildRouteProbReroute");
1114 if (edge ==
nullptr) {
1116 }
else if (period < 0) {
1118 }
else if (begin < 0) {
1138 routeProbe->
incRef(
"buildRouteProbe");
1149 const std::vector<std::string>& laneIDs,
const std::string& name,
const std::vector<std::string>& vTypes,
const Parameterised::Map& parameters) {
1159 if (lanes.size() > 0) {
1167 std::vector<GNEAdditional*> VSSSymbols;
1168 for (
const auto& lane : lanes) {
1176 for (
const auto& VSSSymbol : VSSSymbols) {
1182 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
1184 for (
const auto& VSSSymbol : VSSSymbols) {
1188 for (
int i = 0; i < (int)lanes.size(); i++) {
1189 lanes.at(i)->addChildElement(VSSSymbols.at(i));
1205 if (VSS ==
nullptr) {
1207 }
else if (time < 0) {
1220 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
1238 if (edge ==
nullptr) {
1240 }
else if (beginTime < 0) {
1242 }
else if (endTime < 0) {
1244 }
else if (endTime < beginTime) {
1245 writeError(
TLF(
"Could not build Vaporizer with ID '%' in netedit; begin is greather than end.", edge->
getID()));
1262 vaporizer->
incRef(
"buildVaporizer");
1273 const Position& center,
const bool fill,
const RGBColor& color,
const std::vector<std::string>& edgeIDs,
1279 if (TAZShape.size() == 0) {
1282 for (
const auto& edge : edges) {
1283 TAZBoundary.
add(edge->getCenteringBoundary());
1290 if (sourceSinkEdge) {
1296 TAZShape = TAZBoundary.
getShape(
true);
1305 }
else if (TAZShape.size() == 0) {
1306 writeError(
TLF(
"Could not build TAZ with ID '%' in netedit; Invalid Shape.",
id));
1321 for (
const auto& edge : edges) {
1332 TAZ->incRef(
"buildTAZ");
1333 for (
const auto& edge : edges) {
1336 TAZSource->
incRef(
"buildTAZ");
1337 TAZ->addChildElement(TAZSource);
1340 TAZSink->
incRef(
"buildTAZ");
1341 TAZ->addChildElement(TAZSink);
1347 TAZ->updateGeometry();
1361 if (
TAZ ==
nullptr) {
1363 }
else if (edge ==
nullptr) {
1367 for (
const auto& TAZElement :
TAZ->getChildAdditionals()) {
1369 TAZSink = TAZElement;
1373 if (TAZSink ==
nullptr) {
1384 TAZSink->
incRef(
"buildTAZSource");
1390 for (
const auto& TAZElement :
TAZ->getChildAdditionals()) {
1392 TAZSource = TAZElement;
1396 if (TAZSource ==
nullptr) {
1407 TAZSource->
incRef(
"buildTAZSource");
1417 TAZSource->
incRef(
"buildTAZSource");
1431 if (
TAZ ==
nullptr) {
1433 }
else if (edge ==
nullptr) {
1439 for (
const auto& TAZElement :
TAZ->getChildAdditionals()) {
1441 TAZSource = TAZElement;
1445 if (TAZSource ==
nullptr) {
1456 TAZSource->
incRef(
"buildTAZSink");
1461 for (
const auto& TAZElement :
TAZ->getChildAdditionals()) {
1463 TAZSink = TAZElement;
1467 if (TAZSink ==
nullptr) {
1478 TAZSink->
incRef(
"buildTAZSink");
1488 TAZSink->
incRef(
"buildTAZSink");
1497 const double voltage,
const double currentLimit,
const Parameterised::Map& parameters) {
1501 }
else if (voltage < 0) {
1503 }
else if (currentLimit < 0) {
1518 tractionSubstation->
incRef(
"buildTractionSubstation");
1528 const std::vector<std::string>& laneIDs,
const double startPos,
const double endPos,
const bool friendlyPos,
1529 const std::vector<std::string>& forbiddenInnerLanes,
const Parameterised::Map& parameters) {
1541 if (lanes.size() > 0) {
1544 writeError(
TLF(
"Could not build overhead wire with ID '%' in netedit; Lanes aren't consecutives.",
id));
1546 startPos, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(),
1547 endPos, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
1549 }
else if (tractionSubstation ==
nullptr) {
1562 for (
const auto& lane : lanes) {
1563 lane->addChildElement(overheadWire);
1565 overheadWire->
incRef(
"buildOverheadWire");
1579 const std::string& ,
const std::string& ,
const std::string& ,
1587 const RGBColor& color,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
const PositionVector& shape,
bool geo,
bool fill,
1596 }
else if (lineWidth < 0) {
1602 GNEPoly* poly =
new GNEPoly(
myNet,
id, type, shape, geo, fill, lineWidth, color, layer, angle, imgFile, relativePath, name, parameters);
1612 poly->
incRef(
"addPolygon");
1620 const RGBColor& color,
const double x,
const double y,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
1621 double width,
double height,
const std::string& name,
const Parameterised::Map& parameters) {
1625 }
else if (width < 0) {
1627 }
else if (height < 0) {
1635 GNEPOI*
POI =
new GNEPOI(
myNet,
id, type, color, x, y,
false, layer, angle, imgFile, relativePath, width, height, name, parameters);
1645 POI->incRef(
"addPOI");
1655 const RGBColor& color,
const std::string& laneID,
double posOverLane,
const bool friendlyPos,
double posLat,
double layer,
double angle,
1656 const std::string& imgFile,
bool relativePath,
double width,
double height,
const std::string& name,
const Parameterised::Map& parameters) {
1660 }
else if (width < 0) {
1662 }
else if (height < 0) {
1672 if (lane ==
nullptr) {
1678 GNEAdditional* POILane =
new GNEPOI(
myNet,
id, type, color, lane, posOverLane, friendlyPos, posLat, layer, angle, imgFile, relativePath, width, height, name, parameters);
1689 POILane->
incRef(
"buildPOILane");
1700 const RGBColor& color,
const double lon,
const double lat,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
1701 double width,
double height,
const std::string& name,
const Parameterised::Map& parameters) {
1705 }
else if (width < 0) {
1707 }
else if (height < 0) {
1712 writeError(
TLF(
"Could not build POI with ID '%' in netedit",
id) + std::string(
"; ") +
TL(
"Network requires a geo projection."));
1717 GNEPOI*
POIGEO =
new GNEPOI(
myNet,
id, type, color, lon, lat,
true, layer, angle, imgFile, relativePath, width, height, name, parameters);
1727 POIGEO->incRef(
"buildPOIGeo");
1739 for (
const auto& lane : edge->
getLanes()) {
1752 std::vector<std::pair<SUMOTime, SUMOTime>> sortedIntervals;
1755 if (!rerouterChild->getTagProperty().isSymbol()) {
1763 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
1765 std::sort(sortedIntervals.begin(), sortedIntervals.end());
1767 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
1768 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
1786 if ((pos < 0) || (pos > laneLength)) {
1790 if ((pos + length) > laneLength) {
1809 if (pos >= laneLength) {
1810 pos = (laneLength - POSITION_EPS);
1813 if ((length < 0) || ((pos + length) > laneLength)) {
1814 length = POSITION_EPS;
1837 if ((to - from) < POSITION_EPS) {
1840 if ((from < 0) || (from > laneLength)) {
1843 if ((to < 0) || (to > laneLength)) {
1864 }
else if (from > laneLength) {
1873 }
else if (to > laneLength) {
1877 if ((to - from) < POSITION_EPS) {
1878 if (to >= POSITION_EPS) {
1879 from = to - POSITION_EPS;
1908 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TL(
"ID contains invalid characters."));
1914 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TL(
"Invalid position over lane."));
1920 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TL(
"Declared twice."));
1926 std::string first, second;
1927 if (
id.size() > 0) {
1928 first =
TLF(
"Could not build % '%' in netedit",
toString(tag),
id);
1930 first =
TLF(
"Could not build % in netedit",
toString(tag));
1932 if (parentID.size() > 0) {
1933 second =
TLF(
"% '%' doesn't exist.",
toString(parent), parentID);
1935 second =
TLF(
"% doesn't exist.",
toString(parent));
1937 writeError(first + std::string(
"; ") + second);
1943 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TLF(
"Attribute % cannot be negative.",
toString(attribute)));
1949 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TL(
"List of VTypes isn't valid."));
1955 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TL(
"Filename is invalid."));
1961 writeError(
TLF(
"Could not build % with ID '%' in netedit",
toString(tag),
id) + std::string(
"; ") +
TL(
"List of lanes isn't valid."));
1967 for (
const auto& vTypeID : vTypeIDs) {
2009std::vector<GNEEdge*>
2011 std::vector<GNEEdge*> edges;
2012 for (
const auto& edgeID : edgeIDs) {
2015 if (edge ==
nullptr) {
2020 edges.push_back(edge);
2027std::vector<GNELane*>
2029 std::vector<GNELane*> lanes;
2030 for (
const auto& laneID : laneIDs) {
2033 if (lane ==
nullptr) {
2038 lanes.push_back(lane);
2082 myAllowUndoRedo(false),
2083 myOverwrite(false) {
2101 centerAfterCreation(false) {
#define WRITE_WARNING(msg)
const std::string DEFAULT_VTYPE_ID
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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
begin/end of the 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_SINK
Sink(s) specification.
@ 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.
@ 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
@ 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
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ 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]
@ GNE_ATTR_SELECTED
element is selected
@ 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.
const double INVALID_DOUBLE
invalid double
const double SUMO_const_laneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void writeError(const std::string &error)
write error and enable error creating element
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
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time 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
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::vector< SumoBaseObject * > & getSumoBaseObjectChildren() const
get SumoBaseObject children
void 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 bool relativePath, 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.
void 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::string &name, const SUMOTime timeThreshold, const double speedThreshold, const Parameterised::Map ¶meters)
Builds a multi entry exit detector (E3)
void 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 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.
void 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)
~GNEAdditionalHandler()
Destructor.
void 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
GNEAdditional * getRerouterIntervalParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get rerouter interval parent
void writeInvalidID(const SumoXMLTag tag, const std::string &id)
write invalid id
static void fixLaneDoublePosition(double &from, double &to, const double laneLengt)
fix the given positions over lane
void 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
void 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::string &name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a single-lane Area Detector (E2)
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge *edge)
check if a GNEAccess can be created in a certain Edge
void 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 double layer, const double angle, const std::string &imgFile, const bool relativePath, const double width, const double height, const std::string &name, const Parameterised::Map ¶meters)
Builds a POI over lane using the given values.
void buildPOI(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double x, const double y, const double layer, const double angle, const std::string &imgFile, bool relativePath, const double width, const double height, const std::string &name, const Parameterised::Map ¶meters)
Builds a POI using the given values.
void 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
void buildTAZSink(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const double arrivalWeight)
Builds a TAZSink (Traffic Assignment Zone)
void buildVariableSpeedSignStep(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOTime time, const std::string &speed)
Builds a VariableSpeedSign Step.
void 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 SUMOTime timeThreshold, const std::vector< std::string > &vTypes, const Parameterised::Map ¶meters)
builds a rerouter
GNEAdditional * getAdditionalParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, SumoXMLTag tag) const
get additional parent
void writeErrorInvalidNegativeValue(const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute)
write error "invalid negative element"
void 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
std::vector< GNELane * > parseLanes(const SumoXMLTag tag, const std::vector< std::string > &laneIDs)
parse lanes
void writeErrorDuplicated(const SumoXMLTag tag, const std::string &id)
write error "duplicated additional"
void buildRerouterInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOTime begin, const SUMOTime end)
builds a rerouter interval
void buildCalibratorFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameter)
builds a calibrator flow
void buildAccess(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const double length, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds an Access.
void overwriteAdditional()
remove overwrited additional
void 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)
void buildClosingLaneReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &closedLane, SVCPermissions permissions)
builds a closing lane reroute
void 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.
void writeErrorInvalidVTypes(const SumoXMLTag tag, const std::string &id)
write error "invalid list of vehicle types"
void buildClosingReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &closedEdgeID, SVCPermissions permissions)
builds a closing edge reroute
void writeErrorInvalidPosition(const SumoXMLTag tag, const std::string &id)
write error "invalid position"
static void fixMultiLanePosition(double fromPos, const double fromLaneLength, double toPos, const double tolaneLength)
fix the given positions over two lanes
void buildDestProbReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newEdgeDestinationID, const double probability)
builds a dest prob reroute
bool checkListOfVehicleTypes(const std::vector< std::string > &vTypeIDs) const
check list of IDs
const bool myAllowUndoRedo
allow undo/redo
static bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
void buildParkingAreaReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newParkignAreaID, const double probability, const bool visible)
builds a parking area reroute
void buildPOIGeo(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double lon, const double lat, const double layer, const double angle, const std::string &imgFile, bool relativePath, const double width, const double height, const std::string &name, const Parameterised::Map ¶meters)
Builds a POI in GEO coordinaten using the given values.
static bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
void 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 Parameterised::Map ¶meters)
builds a Route probe
void 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 Parameterised::Map ¶meters)
Builds a bus stop.
GNEAdditionalHandler()
invalidate default constructo
void writeErrorInvalidFilename(const SumoXMLTag tag, const std::string &id)
write error "invalid filename"
void 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 Parameterised::Map ¶meters)
Builds a train stop.
void 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::string &name, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a induction loop detector (E1)
void writeErrorInvalidLanes(const SumoXMLTag tag, const std::string &id)
write error "invalid list of lanes"
static 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
static void fixLanePosition(double &pos, double &length, const double laneLength)
fix given position over lane
GNENet * myNet
pointer to GNENet
void buildRouteProbReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newRouteID, const double probability)
builds a route prob reroute
void 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::string &name, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a Instant Induction Loop Detector (E1Instant)
void buildTAZSource(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const double departWeight)
Builds a TAZSource (Traffic Assignment Zone)
bool checkDuplicatedAdditional(const SumoXMLTag tag, const std::string &id)
check if given ID correspond to a duplicated additional
void writeErrorInvalidParent(const SumoXMLTag tag, const std::string &id, const SumoXMLTag parent, const std::string &parentID)
write error "invalid parent element"
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::vector< std::string > &edgeIDs)
parse edges
void buildMultiLaneDetectorE2(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::vector< std::string > &lanes, 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::string &name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a multi-lane Area Detector (E2)
void 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)
void 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 Parameterised::Map ¶meters)
Builds a container stop.
GNEAdditional * myAdditionalToOverwrite
additional to overwrite (using undor-redo
void buildDetectorEntry(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a entry detector (E3)
void buildDetectorExit(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const bool friendlyPos, const Parameterised::Map ¶meters)
Builds a exit detector (E3)
void 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
void 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 bool friendlyPosition, const Parameterised::Map ¶meters)
Builds a charging Station.
const bool myOverwrite
check if overwrite
static 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
An Element which don't belong to GNENet but has influence in the simulation.
virtual void updateGeometry()=0
update pre-computed geometry information
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
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
get ID (all Attribute Carriers have one)
A lane area vehicles can halt at (netedit-version)
A lane area vehicles can halt at (netedit-version)
An Element which don't belong to GNENet but has influence in the simulation.
A road/street connecting two junctions (netedit-version)
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
void addChildElement(T *element)
add child element
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool allowPedestrians() const
check if current lane allow pedestrians
GNEEdge * getParentEdge() const
get parent edge
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEAdditional * retrieveRerouterInterval(const std::string &rerouterID, const SUMOTime begin, const SUMOTime end) const
Returns the rerouter interval defined by given begin and end.
void insertAdditional(GNEAdditional *additional)
Insert a additional 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 deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
void enableUpdateGeometry()
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
A lane area vehicles can park at (netedit-version)
vehicle space used by GNEParkingAreas
void incRef(const std::string &debugMsg="")
Increase reference.
Representation of a RouteProbe in netedit.
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...
Representation of a vaporizer in netedit.
GNEUndoList * getUndoList() const
get the undoList object
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
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
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 ammount
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
Position positionAtOffset2D(double pos, double lateralOffset=0) 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 bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidAdditionalID(const std::string &value)
whether the given string is a valid id for an additional object
static bool isValidDetectorID(const std::string &value)
whether the given string is a valid id for an detector
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
struct for Netedit parameters
const bool centerAfterCreation
center view after creation
~NeteditParameters()
destructor
NeteditParameters()
default constructor