71 myUndoAdditionals(undoAdditionals),
72 myAdditionalParent(additionalParent),
73 myLastInsertedAdditional(nullptr) {
74 if (additionalParent) {
206 const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
207 double begin = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_BEGIN, abort);
208 double end = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_END, abort);
209 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_NAME, abort);
215 if (edge ==
nullptr) {
219 }
else if (begin > end) {
234 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
235 std::string edgeId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_EDGE, abort);
236 std::string freq = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FREQUENCY, abort);
237 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
238 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
239 double begin = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_BEGIN, abort);
247 }
else if (edge ==
nullptr) {
249 WRITE_WARNING(
"The edge '" + edgeId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
252 if (GNEAttributeCarrier::canParse<double>(freq)) {
253 if (GNEAttributeCarrier::parse<double>(freq) < 0) {
275 std::string routeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
276 std::string edgeIDs = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, routeID, tag,
SUMO_ATTR_EDGES, abort);
277 RGBColor color = GNEAttributeCarrier::parseAttributeFromXML<RGBColor>(attrs, routeID, tag,
SUMO_ATTR_COLOR, abort);
281 std::vector<GNEEdge*> edges;
283 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), edgeIDs);
288 }
else if (edges.size() == 0) {
303 std::string vehicleTypeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
304 double accel = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_ACCEL, abort);
305 double decel = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_DECEL, abort);
306 double sigma = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_SIGMA, abort);
307 double tau = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_TAU, abort);
308 double length = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_LENGTH, abort);
309 double minGap = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_MINGAP, abort);
310 double maxSpeed = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_MAXSPEED, abort);
311 double speedFactor = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_SPEEDFACTOR, abort);
312 double speedDev = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_SPEEDDEV, abort);
313 RGBColor color = GNEAttributeCarrier::parseAttributeFromXML<RGBColor>(attrs, vehicleTypeID, tag,
SUMO_ATTR_COLOR, abort);
315 std::string emissionClass = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, vehicleTypeID, tag,
SUMO_ATTR_EMISSIONCLASS, abort);
317 double width = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_WIDTH, abort);
318 std::string filename = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, vehicleTypeID, tag,
SUMO_ATTR_IMGFILE, abort);
319 double impatience = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_IMPATIENCE, abort);
320 std::string laneChangeModel = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, vehicleTypeID, tag,
SUMO_ATTR_LANE_CHANGE_MODEL, abort);
321 std::string carFollowModel = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, vehicleTypeID, tag,
SUMO_ATTR_CAR_FOLLOW_MODEL, abort);
322 int personCapacity = GNEAttributeCarrier::parseAttributeFromXML<int>(attrs, vehicleTypeID, tag,
SUMO_ATTR_PERSON_CAPACITY, abort);
323 int containerCapacity = GNEAttributeCarrier::parseAttributeFromXML<int>(attrs, vehicleTypeID, tag,
SUMO_ATTR_CONTAINER_CAPACITY, abort);
324 double boardingDuration = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_BOARDING_DURATION, abort);
325 double loadingDuration = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_LOADING_DURATION, abort);
326 std::string latAlignment = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, vehicleTypeID, tag,
SUMO_ATTR_LATALIGNMENT, abort);
327 double minGapLat = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_MINGAP_LAT, abort);
328 double maxSpeedLat = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, vehicleTypeID, tag,
SUMO_ATTR_MAXSPEED_LAT, abort);
335 myLastInsertedAdditional =
buildVehicleType(
myViewNet,
true, vehicleTypeID, accel, decel, sigma, tau, length, minGap, maxSpeed, speedFactor, speedDev, color, vClass, emissionClass, shape, width,
336 filename, impatience, laneChangeModel, carFollowModel, personCapacity, containerCapacity, boardingDuration, loadingDuration, latAlignment, minGapLat, maxSpeedLat);
348 std::string vehicleTypeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_TYPE, abort);
349 std::string routeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ROUTE, abort);
350 std::string vehsPerHour = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_VEHSPERHOUR, abort);
351 std::string speed = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_SPEED, abort);
353 std::string departLane = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_DEPARTLANE, abort);
354 std::string departPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_DEPARTPOS, abort);
355 std::string departSpeed = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_DEPARTSPEED, abort);
356 std::string arrivalLane = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ARRIVALLANE, abort);
357 std::string arrivalPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ARRIVALPOS, abort);
358 std::string arrivalSpeed = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ARRIVALSPEED, abort);
359 std::string line = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_LINE, abort);
360 int personNumber = GNEAttributeCarrier::parseAttributeFromXML<int>(attrs,
"", tag,
SUMO_ATTR_PERSON_NUMBER, abort);
362 bool reroute = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
"", tag,
SUMO_ATTR_REROUTE, abort);
363 std::string departPosLat = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_DEPARTPOS_LAT, abort);
364 std::string arrivalPosLat = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ARRIVALPOS_LAT, abort);
365 double begin = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_BEGIN, abort);
366 double end = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_END, abort);
374 if (route ==
nullptr) {
377 }
else if (vtype ==
nullptr) {
380 }
else if ((vehsPerHour.empty()) && (speed.empty())) {
383 }
else if (calibrator != NULL) {
384 myLastInsertedAdditional =
buildCalibratorFlow(
myViewNet,
true, calibrator, route, vtype, vehsPerHour, speed, color, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
385 line, personNumber, containerNumber, reroute, departPosLat, arrivalPosLat, begin, end);
402 WRITE_WARNING(
"Error parsing key from additional generic parameter. Key cannot be empty");
406 WRITE_WARNING(
"Error parsing key from additional generic parameter. Key contains invalid characters");
410 WRITE_WARNING(
"Error parsing key from additional generic parameter. Key doesn't exist");
416 WRITE_WARNING(
"Error parsing value from additional generic parameter. Value contains invalid characters");
432 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
433 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
434 GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
435 std::string lanesIDs = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANES, abort);
440 std::vector<GNELane*> lanes;
442 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(
myViewNet->
getNet(), lanesIDs);
447 }
else if (lanes.size() == 0) {
448 WRITE_WARNING(
"A Variable Speed Sign needs at least one lane.");
461 double time = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_TIME, abort);
462 double speed = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_SPEED, abort);
468 if (variableSpeedSign !=
nullptr) {
481 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
482 std::string edgesIDs = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_EDGES, abort);
483 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
484 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
485 double probability = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_PROB, abort);
486 bool off = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_OFF, abort);
488 const std::string vTypes = attrs.getOpt<std::string>(
SUMO_ATTR_VTYPES,
id.c_str(), abort,
"");
493 std::vector<GNEEdge*> edges;
495 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), edgesIDs);
500 }
else if (edges.size() == 0) {
503 myLastInsertedAdditional =
buildRerouter(
myViewNet,
myUndoAdditionals,
id, pos, edges, probability, name, file, off, timeThreshold, vTypes,
false);
515 double begin = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_BEGIN, abort);
516 double end = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_END, abort);
522 if (rerouter ==
nullptr) {
524 if (lastInsertedRerouterInterval) {
531 }
else if (rerouter !=
nullptr) {
544 std::string laneID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
545 std::string allow = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ALLOW, abort);
546 std::string disallow = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_DISALLOW, abort);
553 if (lane ==
nullptr) {
555 }
else if (rerouterInterval !=
nullptr) {
568 std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
569 std::string allow = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ALLOW, abort);
570 std::string disallow = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_DISALLOW, abort);
577 if (edge ==
nullptr) {
579 }
else if (rerouterInterval !=
nullptr) {
592 std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
593 double probability = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_PROB, abort);
600 if (edge ==
nullptr) {
602 }
else if (rerouterInterval !=
nullptr) {
615 std::string parkingAreaID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
616 double probability = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_PROB, abort);
617 bool visible = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
"", tag,
SUMO_ATTR_VISIBLE, abort);
624 if (parkingArea ==
nullptr) {
625 WRITE_WARNING(
"The parkingArea '" + parkingAreaID +
"' to use within the " +
toString(tag) +
" is not known.");
626 }
else if (rerouterInterval !=
nullptr) {
639 std::string routeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
640 double probability = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_PROB, abort);
646 if (rerouterInterval !=
nullptr) {
659 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
660 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
661 std::string startPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_STARTPOS, abort);
662 std::string endPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_ENDPOS, abort);
663 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
664 std::vector<std::string> lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs, id, tag,
SUMO_ATTR_LINES, abort);
665 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
673 }
else if (lane ==
nullptr) {
675 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
692 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
693 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
694 std::string startPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_STARTPOS, abort);
695 std::string endPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_ENDPOS, abort);
696 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
697 std::vector<std::string> lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs, id, tag,
SUMO_ATTR_LINES, abort);
698 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
706 }
else if (lane ==
nullptr) {
708 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
725 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_LANE, abort);
726 std::string position = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_POSITION, abort);
727 std::string length = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_LENGTH, abort);
728 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
"", tag,
SUMO_ATTR_FRIENDLY_POS, abort);
731 double posDouble = GNEAttributeCarrier::parse<double>(position);
736 if (lane ==
nullptr) {
738 }
else if (busStop ==
nullptr) {
743 WRITE_WARNING(
"Edge '" + lane->getParentEdge().getID() +
"' already has an Access for busStop '" + busStop->
getID() +
"'");
757 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
758 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
759 std::string startPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_STARTPOS, abort);
760 std::string endPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_ENDPOS, abort);
761 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
762 double chargingPower = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_CHARGINGPOWER, abort);
763 double efficiency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_EFFICIENCY, abort);
764 bool chargeInTransit = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_CHARGEINTRANSIT, abort);
765 double chargeDelay = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_CHARGEDELAY, abort);
766 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
774 }
else if (lane ==
nullptr) {
776 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
781 myLastInsertedAdditional =
buildChargingStation(
myViewNet,
myUndoAdditionals,
id, lane, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition,
false);
793 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
794 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
795 std::string startPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_STARTPOS, abort);
796 std::string endPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_ENDPOS, abort);
797 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
798 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
800 double width = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_WIDTH, abort);
801 std::string length = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LENGTH, abort);
802 double angle = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_ANGLE, abort);
810 }
else if (lane ==
nullptr) {
812 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
817 myLastInsertedAdditional =
buildParkingArea(
myViewNet,
myUndoAdditionals,
id, lane, startPos, endPos, name, friendlyPosition, roadSideCapacity, width, length, angle,
false);
829 double x = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_X, abort);
830 double y = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_Y, abort);
831 double z = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_Z, abort);
832 double width = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_WIDTH, abort);
833 double length = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_LENGTH, abort);
834 double angle = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_ANGLE, abort);
840 if (parkingAreaParent !=
nullptr) {
853 std::string edgeID, laneId, id;
858 id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", typeOfCalibrator,
SUMO_ATTR_ID, abort);
859 edgeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, typeOfCalibrator,
SUMO_ATTR_EDGE, abort);
860 std::string outfile = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, typeOfCalibrator,
SUMO_ATTR_OUTPUT, abort);
861 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, typeOfCalibrator,
SUMO_ATTR_POSITION, abort);
862 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
863 double freq = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, typeOfCalibrator,
SUMO_ATTR_FREQUENCY, abort);
872 }
else if (edge ==
nullptr) {
873 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(typeOfCalibrator) +
" '" +
id +
"' is not known.");
882 id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", typeOfCalibrator,
SUMO_ATTR_ID, abort);
883 laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, typeOfCalibrator,
SUMO_ATTR_LANE, abort);
884 std::string outfile = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, typeOfCalibrator,
SUMO_ATTR_OUTPUT, abort);
885 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, typeOfCalibrator,
SUMO_ATTR_POSITION, abort);
886 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
887 double freq = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, typeOfCalibrator,
SUMO_ATTR_FREQUENCY, abort);
897 }
else if (lane ==
nullptr) {
898 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(typeOfCalibrator) +
" '" +
id +
"' is not known.");
915 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
916 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
917 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_POSITION, abort);
918 double frequency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_FREQUENCY, abort);
919 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
920 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_VTYPES, abort);
921 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
922 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
930 }
else if (lane ==
nullptr) {
932 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
936 myLastInsertedAdditional =
buildDetectorE1(
myViewNet,
myUndoAdditionals,
id, lane, position, frequency, file, vehicleTypes, name, friendlyPos,
false);
948 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
949 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
950 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_POSITION, abort);
951 double frequency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_FREQUENCY, abort);
952 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
953 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_VTYPES, abort);
954 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
955 double length = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_LENGTH, abort);
959 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
961 GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_CONT, abort);
969 }
else if (lane ==
nullptr) {
971 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
975 myLastInsertedAdditional =
buildDetectorE2(
myViewNet,
myUndoAdditionals,
id, lane, position, length, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos,
false);
987 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
988 double frequency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_FREQUENCY, abort);
989 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
990 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_VTYPES, abort);
991 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
1001 myLastInsertedAdditional =
buildDetectorE3(
myViewNet,
myUndoAdditionals,
id, pos, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold,
false);
1013 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_LANE, abort);
1014 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_POSITION, abort);
1015 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
"", tag,
SUMO_ATTR_FRIENDLY_POS, abort);
1022 if (lane ==
nullptr) {
1026 }
else if (E3Parent) {
1039 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_LANE, abort);
1040 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
"", tag,
SUMO_ATTR_POSITION, abort);
1041 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
"", tag,
SUMO_ATTR_FRIENDLY_POS, abort);
1048 if (lane ==
nullptr) {
1052 }
else if (E3Parent) {
1065 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", tag,
SUMO_ATTR_ID, abort);
1066 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_LANE, abort);
1067 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, tag,
SUMO_ATTR_POSITION, abort);
1068 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_FILE, abort);
1069 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_VTYPES, abort);
1070 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, tag,
SUMO_ATTR_NAME, abort);
1071 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
1079 }
else if (lane ==
nullptr) {
1081 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
1104 std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LINES]);
1109 return buildBusStop(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, lines, friendlyPos, blockMovement);
1124 if (lane && busStop) {
1126 return buildAccess(viewNet, allowUndoRedo, busStop, lane, pos, length, friendlyPos, blockMovement);
1142 std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LINES]);
1147 return buildContainerStop(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, lines, friendlyPos, blockMovement);
1167 return buildChargingStation(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPos, blockMovement);
1181 double width = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_WIDTH]);
1183 double angle = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ANGLE]);
1187 return buildParkingArea(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, friendlyPos, roadSideCapacity, width, lenght, angle, blockMovement);
1196 double z = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_Z]);
1197 double width = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_WIDTH]);
1198 double lenght = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_LENGTH]);
1199 double angle = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ANGLE]);
1203 return buildParkingSpace(viewNet, allowUndoRedo, parkingArea, pos.
x(), pos.
y(), z, width, lenght, angle, blockMovement);
1218 return buildDetectorE1(viewNet, allowUndoRedo,
id, lane, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement);
1229 double length = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_LENGTH]);
1240 return buildDetectorE2(viewNet, allowUndoRedo,
id, lane, pos, length, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
1258 if (pos.size() == 1) {
1259 return buildDetectorE3(viewNet, allowUndoRedo,
id, pos[0], freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement);
1273 return buildDetectorEntry(viewNet, allowUndoRedo, E3, lane, pos, friendlyPos, blockMovement);
1287 return buildDetectorExit(viewNet, allowUndoRedo, E3, lane, pos, friendlyPos, blockMovement);
1304 return buildDetectorE1Instant(viewNet, allowUndoRedo,
id, lane, pos, filename, vehicleTypes, name, friendlyPos, blockMovement);
1314 std::vector<GNELane*> lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(viewNet->
getNet(), values[
SUMO_ATTR_LANES]);
1319 if (pos.size() == 1) {
1336 return buildCalibrator(viewNet, allowUndoRedo,
id, edge, pos, name, outfile, freq);
1352 return buildCalibrator(viewNet, allowUndoRedo,
id, lane, pos, name, outfile, freq);
1362 std::vector<GNEEdge*> edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(viewNet->
getNet(), values[
SUMO_ATTR_EDGES]);
1364 bool off = GNEAttributeCarrier::parse<bool>(values[
SUMO_ATTR_OFF]);
1365 double prob = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_PROB]);
1372 if (pos.size() == 1) {
1373 return buildRerouter(viewNet, allowUndoRedo,
id, pos[0], edges, prob, name, file, off, timeThreshold, vTypes, blockMovement);
1385 double begin = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_BEGIN]);
1388 return buildRouteProbe(viewNet, allowUndoRedo,
id, edge, freq, name, filename, begin);
1396 double begin = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_BEGIN]);
1397 double end = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_END]);
1404 return buildVaporizer(viewNet, allowUndoRedo, edge, begin, end, name);
1418 GNEAdditionalHandler::buildBusStop(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
const std::string& startPos,
const std::string& endPos,
const std::string& name,
const std::vector<std::string>& lines,
bool friendlyPosition,
bool blockMovement) {
1420 GNEBusStop* busStop =
new GNEBusStop(
id, lane, viewNet, startPos, endPos, name, lines, friendlyPosition, blockMovement);
1421 if (allowUndoRedo) {
1428 busStop->
incRef(
"buildBusStop");
1440 if (lane ==
nullptr) {
1442 }
else if (busStop ==
nullptr) {
1447 GNEAccess* access =
new GNEAccess(busStop, lane, viewNet, pos, length, friendlyPos, blockMovement);
1448 if (allowUndoRedo) {
1456 access->
incRef(
"buildAccess");
1467 if (allowUndoRedo) {
1474 containerStop->
incRef(
"buildContainerStop");
1476 return containerStop;
1485 double chargingPower,
double efficiency,
bool chargeInTransit,
double chargeDelay,
bool friendlyPosition,
bool blockMovement) {
1487 GNEChargingStation* chargingStation =
new GNEChargingStation(
id, lane, viewNet, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
1488 if (allowUndoRedo) {
1495 chargingStation->
incRef(
"buildChargingStation");
1497 return chargingStation;
1506 bool friendlyPosition,
int roadSideCapacity,
double width,
const std::string& length,
double angle,
bool blockMovement) {
1508 GNEParkingArea* parkingArea =
new GNEParkingArea(
id, lane, viewNet, startPos, endPos, name, friendlyPosition, roadSideCapacity, width, length, angle, blockMovement);
1509 if (allowUndoRedo) {
1516 parkingArea->
incRef(
"buildParkingArea");
1528 if (allowUndoRedo) {
1535 parkingSpace->
incRef(
"buildParkingSpace");
1537 return parkingSpace;
1542 GNEAdditionalHandler::buildDetectorE1(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
double pos,
double freq,
const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
bool friendlyPos,
bool blockMovement) {
1544 GNEDetectorE1* detectorE1 =
new GNEDetectorE1(
id, lane, viewNet, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement);
1545 if (allowUndoRedo) {
1552 detectorE1->
incRef(
"buildDetectorE1");
1563 const std::string& vehicleTypes,
const std::string& name,
const double timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
1565 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lane, viewNet, pos, length, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
1566 if (allowUndoRedo) {
1573 detectorE2->
incRef(
"buildDetectorE2");
1584 const std::string& name,
const double timeThreshold,
double speedThreshold,
bool blockMovement) {
1586 GNEDetectorE3* detectorE3 =
new GNEDetectorE3(
id, viewNet, pos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement);
1587 if (allowUndoRedo) {
1593 detectorE3->
incRef(
"buildDetectorE3");
1605 if (lane ==
nullptr) {
1607 }
else if (E3Parent ==
nullptr) {
1611 if (allowUndoRedo) {
1619 entry->
incRef(
"buildDetectorEntry");
1629 if (lane ==
nullptr) {
1631 }
else if (E3Parent ==
nullptr) {
1635 if (allowUndoRedo) {
1643 exit->
incRef(
"buildDetectorExit");
1654 if (allowUndoRedo) {
1661 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
1663 return detectorE1Instant;
1674 if (allowUndoRedo) {
1683 calibrator->
incRef(
"buildCalibrator");
1696 if (allowUndoRedo) {
1705 calibrator->
incRef(
"buildCalibrator");
1719 if (allowUndoRedo) {
1725 route->
incRef(
"buildCalibratorRoute");
1737 double accel,
double decel,
double sigma,
double tau,
double length,
double minGap,
double maxSpeed,
1738 double speedFactor,
double speedDev,
const RGBColor& color,
SUMOVehicleClass vClass,
const std::string& emissionClass,
1739 SUMOVehicleShape shape,
double width,
const std::string& filename,
double impatience,
const std::string& laneChangeModel,
1740 const std::string& carFollowModel,
int personCapacity,
int containerCapacity,
double boardingDuration,
1741 double loadingDuration,
const std::string& latAlignment,
double minGapLat,
double maxSpeedLat) {
1745 speedFactor, speedDev, color, vClass, emissionClass, shape, width, filename, impatience,
1746 laneChangeModel, carFollowModel, personCapacity, containerCapacity, boardingDuration,
1747 loadingDuration, latAlignment, minGapLat, maxSpeedLat);
1748 if (allowUndoRedo) {
1754 vType->
incRef(
"buildCalibratorVehicleType");
1765 const std::string& vehsPerHour,
const std::string& speed,
const RGBColor& color,
const std::string& departLane,
const std::string& departPos,
1766 const std::string& departSpeed,
const std::string& arrivalLane,
const std::string& arrivalPos,
const std::string& arrivalSpeed,
const std::string& line,
1767 int personNumber,
int containerNumber,
bool reroute,
const std::string& departPosLat,
const std::string& arrivalPosLat,
double begin,
double end) {
1771 arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute,
1772 departPosLat, arrivalPosLat, begin, end);
1773 if (allowUndoRedo) {
1779 flow->
incRef(
"buildCalibratorFlow");
1786 GNEAdditionalHandler::buildRerouter(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
Position pos,
const std::vector<GNEEdge*>& edges,
double prob,
const std::string& name,
const std::string& file,
bool off,
double timeThreshold,
const std::string& vTypes,
bool blockMovement) {
1788 GNERerouter* rerouter =
new GNERerouter(
id, viewNet, pos, edges, name, file, prob, off, timeThreshold, vTypes, blockMovement);
1789 if (allowUndoRedo) {
1796 for (
auto i : edges) {
1797 i->addAdditionalParent(rerouter);
1799 rerouter->
incRef(
"buildRerouter");
1802 if (!file.empty()) {
1806 GNEAdditionalHandler rerouterValuesHandler(currentAdditionalFilename + file, viewNet, allowUndoRedo, rerouter);
1829 if (allowUndoRedo) {
1835 rerouterInterval->
incRef(
"buildRerouterInterval");
1837 return rerouterInterval;
1849 if (allowUndoRedo) {
1855 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
1857 return closingLaneReroute;
1866 if (allowUndoRedo) {
1872 closingReroute->
incRef(
"buildClosingReroute");
1874 return closingReroute;
1883 if (allowUndoRedo) {
1889 destProbReroute->
incRef(
"builDestProbReroute");
1891 return destProbReroute;
1900 if (allowUndoRedo) {
1906 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
1908 return parkingAreaReroute;
1917 if (allowUndoRedo) {
1923 routeProbReroute->
incRef(
"buildRouteProbReroute");
1925 return routeProbReroute;
1933 if (allowUndoRedo) {
1942 routeProbe->
incRef(
"buildRouteProbe");
1955 if (allowUndoRedo) {
1962 for (
auto i : lanes) {
1963 i->addAdditionalParent(variableSpeedSign);
1965 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
1967 return variableSpeedSign;
1979 if (allowUndoRedo) {
1985 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
1987 return variableSpeedSignStep;
1994 if (allowUndoRedo) {
2003 vaporizer->
incRef(
"buildVaporizer");
2037 WRITE_WARNING(
"The position of additional '" + additionalID +
"' lies beyond the lane's '" + lane.
getID() +
"' length.");
2047 if (GNEAttributeCarrier::canParse<double>(startPos) && GNEAttributeCarrier::canParse<double>(endPos)) {
2049 double startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
2050 double endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
2053 if (minLength > laneLength) {
2056 if (startPosDouble < 0) {
2057 startPosDouble += laneLength;
2059 if (endPosDouble < 0) {
2060 endPosDouble += laneLength;
2062 if ((endPosDouble < minLength) || (endPosDouble > laneLength)) {
2066 if (endPosDouble < minLength) {
2067 endPosDouble = minLength;
2069 if (endPosDouble > laneLength) {
2070 endPosDouble = laneLength;
2073 if ((startPosDouble < 0) || (startPosDouble > (endPosDouble - minLength))) {
2077 if (startPosDouble < 0) {
2080 if (startPosDouble > (endPosDouble - minLength)) {
2081 startPosDouble = (endPosDouble - minLength);
2085 startPos =
toString(startPosDouble);
2087 }
else if (GNEAttributeCarrier::canParse<double>(startPos)) {
2089 if (endPos.empty() || !GNEAttributeCarrier::canParse<double>(endPos)) {
2091 double startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
2093 if (minLength > laneLength) {
2096 if (startPosDouble < 0) {
2097 startPosDouble += laneLength;
2099 if ((startPosDouble < 0) || startPosDouble > (laneLength - minLength)) {
2103 if (startPosDouble < 0) {
2106 if (startPosDouble > (laneLength - minLength)) {
2107 startPosDouble = (laneLength - minLength);
2111 startPos =
toString(startPosDouble);
2115 }
else if (GNEAttributeCarrier::canParse<double>(endPos)) {
2117 if (startPos.empty() || !GNEAttributeCarrier::canParse<double>(startPos)) {
2119 double endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
2121 if (minLength > laneLength) {
2124 if (endPosDouble < 0) {
2125 endPosDouble += laneLength;
2127 if ((endPosDouble < minLength) || (endPosDouble > laneLength)) {
2131 if (endPosDouble < minLength) {
2132 endPosDouble = minLength;
2134 if (endPosDouble > laneLength) {
2135 endPosDouble = laneLength;
2138 if (0 > (endPosDouble - minLength)) {
2154 if ((pos < 0) || (pos > laneLength)) {
2157 }
else if (pos < 0) {
2159 }
else if (pos > laneLength) {
2168 if ((pos < 0) || ((pos + length) > laneLength)) {
2171 }
else if (pos < 0) {
2173 }
else if (pos > laneLength) {
2176 }
else if ((pos + length) > laneLength) {
2177 length = laneLength - pos;
2205 std::vector<std::pair<double, double>> sortedIntervals;
2208 sortedIntervals.push_back(std::make_pair(0., 0.));
2210 sortedIntervals.back().first = GNEAttributeCarrier::parse<double>(i->getAttribute(
SUMO_ATTR_BEGIN));
2211 sortedIntervals.back().second = GNEAttributeCarrier::parse<double>(i->getAttribute(
SUMO_ATTR_END));
2214 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
2216 std::sort(sortedIntervals.begin(), sortedIntervals.end());
2218 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
2219 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
2229 myInsertedElements.push_back(std::make_pair(tag,
""));
2235 myInsertedElements.back().second = id;
2241 if (!myInsertedElements.empty()) {
2242 myInsertedElements.pop_back();
2249 if (myInsertedElements.size() < 2) {
2251 WRITE_WARNING(
"A " +
toString(myInsertedElements.back().first) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2255 if (retrievedAdditional ==
nullptr) {
2257 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->first) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2259 }
else if (retrievedAdditional->
getTag() != expectedTag) {
2261 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->first) +
" cannot be declared within the definition of a " +
toString(retrievedAdditional->
getTag()) +
".");
2264 return retrievedAdditional;
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
SumoXMLTag
Numbers representing SUMO-XML - element names.
vehicle space used by GNEParkingAreas
static GNEAdditional * buildVehicleType(GNEViewNet *viewNet, bool allowUndoRedo, std::string vehicleTypeID, double accel, double decel, double sigma, double tau, double length, double minGap, double maxSpeed, double speedFactor, double speedDev, const RGBColor &color, SUMOVehicleClass vClass, const std::string &emissionClass, SUMOVehicleShape shape, double width, const std::string &filename, double impatience, const std::string &laneChangeModel, const std::string &carFollowModel, int personCapacity, int containerCapacity, double boardingDuration, double loadingDuration, const std::string &latAlignment, double minGapLat, double maxSpeedLat)
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
alternative tag for e1 detector
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
description of a vehicle type
void parseAndBuildRerouterRouteProbReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Route Prob Reroute.
void parseAndBuildRerouterParkingAreaReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a parkingAreaReroute.
static bool fixStoppinPlacePosition(std::string &startPos, std::string &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name) ...
void parseAndBuildDetectorE1(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a induction loop detector (E1)
static GNEAdditional * buildCalibrator(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &name, const std::string &outfile, double freq)
builds a microscopic calibrator over a lane
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
begin/end of the description of a single lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
a flow definition (used by router)
void commitElementInsertion(const std::string &id)
commit element insertion (used to save ID of last correct inserted element)
static GNEAdditional * buildVariableSpeedSign(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNELane *> &destLanes, const std::string &name, bool blockMovement)
Builds a VariableSpeedSign (lane speed trigger)
A calibrator placed over edge.
static GNEAdditional * buildDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double length, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement)
Builds a lane Area Detector (E2)
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
void parseAndBuildChargingStation(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a charging station.
lane of a reroute of type closing
Allow/disallow charge in transit in Charging Stations.
void parseAndBuildParkingSpace(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a parking space.
const std::string & getFileName() const
returns the current file name
double y() const
Returns the y-position.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
bool myUndoAdditionals
flag to check if created additionals must be undo and redo
double x() const
Returns the x-position.
Representation of a RouteProbe in netedit.
weights: time range begin
static bool checkAndFixDetectorPositionPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
void parseAndBuildDetectorExit(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Exit detector.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
static GNEAdditional * buildDetectorE3(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, const double timeThreshold, double speedThreshold, bool blockMovement)
Builds a multi entry exit detector (E3)
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
static GNEAdditional * buildCalibratorRoute(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &routeID, const std::vector< GNEEdge *> &edges, const RGBColor &color)
GNEAdditionalHandler(const std::string &file, GNEViewNet *viewNet, bool undoAdditionals=true, GNEAdditional *additionalParent=nullptr)
Constructor.
SAX-handler base for SUMO-files.
A parking space for a single vehicle within a parking area.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
GNEAdditional * retrieveAdditionalParent(GNEViewNet *viewNet, SumoXMLTag expectedTag) const
retrieve additional parent correspond to current status of myInsertedElements
double getPosition(double pos, GNELane &lane, bool friendlyPos, const std::string &additionalID)
extracts the position, checks whether it shall be mirrored and checks whether it is within the lane...
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
static GNEAdditional * buildContainerStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition, bool blockMovement)
Builds a container stop.
static GNEAdditional * buildClosingReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *closedEdge, SVCPermissions permissions)
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
begin/end of the description of a route
#define WRITE_WARNING(msg)
void parseAndBuildVariableSpeedSign(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Variable Speed Signal (lane speed trigger)
HierarchyInsertedElements myParentElements
HierarchyInsertedElements used for insert childs.
void parseAndBuildDetectorE2(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a lane area detector (E2)
static OptionsCont & getOptions()
Retrieves the options.
static GNEAdditional * builDestProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *newEdgeDestination, double probability)
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
static GNEAdditional * buildDetectorE1Instant(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Builds a Instant Induction Loop Detector (E1Instant)
static GNEAdditional * buildDetectorEntry(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a entry detector (E3)
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
static GNEAdditional * buildRouteProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, const std::string &newRouteId, double probability)
void parseAndBuildDetectorE1Instant(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Instant induction loop detector (E1Instant)
GNEUndoList * getUndoList() const
get the undoList object
~GNEAdditionalHandler()
Destructor.
void parseAndBuildCalibratorVehicleType(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses vehicle type values of Calibrators.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A lane area vehicles can park at (netedit-version)
GNEEdge & getParentEdge()
Returns underlying parent edge.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this edge
static bool checkOverlappingRerouterIntervals(GNEAdditional *rerouter, double newBegin, double newEnd)
check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted ...
void parseAndBuildRerouterInterval(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Rerouter Interval.
static GNEAdditional * buildChargingStation(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, double chargeDelay, bool friendlyPosition, bool blockMovement)
Builds a charging Station.
Encapsulated SAX-Attributes.
An instantenous induction loop.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
parameter associated to a certain key
static GNEAdditional * buildAccess(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *busStop, GNELane *lane, const std::string &pos, const std::string &length, bool friendlyPos, bool blockMovement)
Builds an Access.
static GNEAdditional * buildDetectorE1(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Builds a induction loop detector (E1)
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
void parseAndBuildRerouter(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a rerouter.
A calibrator placed over lane (used in netedit)
Representation of a vaporizer in netedit.
void parseAndBuildCalibratorRoute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses route values of Calibrators.
block movement of a graphic element
static GNEAdditional * buildRerouterInterval(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterParent, double begin, double end)
builds a rerouter interval
A lane area vehicles can halt at (netedit-version)
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
probability of route of a reroute
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
probability of destiny of a reroute
const std::string getID() const
function to support debugging
GNEViewNet * myViewNet
pointer to View's Net
void incRef(const std::string &debugMsg="")
Increarse reference.
double getLaneShapeLength() const
returns the length of the lane's shape
double getFinalLength() const
get length that will be assigned to the lanes in the final network
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge &edge)
check if a GNEAccess can be created in a certain Edge
void parseAndBuildDetectorE3(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a multi entry exit detector (E3)
static GNEAdditional * buildRerouter(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNEEdge *> &edges, double prob, const std::string &name, const std::string &file, bool off, double timeThreshold, const std::string &vTypes, bool blockMovement)
builds a rerouter
void parseAndBuildRouteProbe(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds routeProbe.
static GNEAdditional * buildParkingSpace(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *parkingAreaParent, double x, double y, double z, double width, double length, double angle, bool blockMovement)
Builds a Parking Space.
GNEAdditional * getFirstAdditionalParent() const
void parseAndBuildRerouterDestProbReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Destiny Prob Reroute.
A road/street connecting two junctions (netedit-version)
entry for an alternative parking zone
void parseAndBuildCalibrator(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a mesoscopic or microscopic calibrator.
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
void parseAndBuildVariableSpeedSignStep(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Variable Speed Signal Step.
void parseGenericParameter(const SUMOSAXAttributes &attrs)
Parse generic parameter and insert it in the last created additional.
static GNEAdditional * buildParkingArea(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, bool friendlyPosition, int roadSideCapacity, double width, const std::string &length, double angle, bool blockMovement)
Builds a Parking Area.
trigger: the time of the step
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
A train stop (alias for bus stop)
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
void parseAndBuildBusStop(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a bus stop.
void parseAndBuildContainerStop(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a container stop.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
static GNEAdditional * builParkingAreaReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEAdditional *newParkignArea, double probability, bool visible)
static bool fixE2DetectorPositionPosition(double &pos, double &length, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
An Element which don't belongs to GNENet but has influency in the simulation.
static GNEAdditional * buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, std::map< SumoXMLAttr, std::string > values)
Build additionals.
void parseAndBuildCalibratorFlow(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses flow values of Calibrators.
static GNEAdditional * buildVaporizer(GNEViewNet *viewNet, bool allowUndoRedo, GNEEdge *edge, double startTime, double end, const std::string &name)
Builds a vaporizer (lane speed trigger)
GNEAdditional * myLastInsertedAdditional
pointer to last inserted additional (used for generic parameters)
void parseAndBuildVaporizer(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Builds a vaporization.
void parseAndBuildRerouterClosingLaneReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Closing Lane reroute.
GNENet * getNet() const
get the net object
static GNEAdditional * buildRouteProbe(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNEEdge *edge, const std::string &freq, const std::string &name, const std::string &file, double begin)
builds a Route probe
void parseAndBuildParkingArea(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a parking area.
GUIGlID getGlID() const
Returns the numerical id of the object.
an aggreagated-output interval
static GNEAdditional * buildCalibratorFlow(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *calibratorParent, GNEAdditional *route, GNEAdditional *vtype, const std::string &vehsPerHour, const std::string &speed, const RGBColor &color, const std::string &departLane, const std::string &departPos, const std::string &departSpeed, const std::string &arrivalLane, const std::string &arrivalPos, const std::string &arrivalSpeed, const std::string &line, int personNumber, int containerNumber, bool reroute, const std::string &departPosLat, const std::string &arrivalPosLat, double begin, double end)
Eficiency of the charge in Charging Stations.
void parseAndBuildAccess(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses values and adds access to the current bus stop.
static std::string getFilePath(const std::string &path)
Removes the file information from the given path.
parent of an additional element
static GNEAdditional * buildBusStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition, bool blockMovement)
Builds a bus stop.
void myEndElement(int element)
Called when a closing tag occurs.
static GNEAdditional * buildVariableSpeedSignStep(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *VSSParent, double time, double speed)
Builds a VariableSpeedSign Step.
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
Delay in the charge of charging stations.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this additional
void insertElement(SumoXMLTag tag)
insert new element (called only in function myStartElement)
void popElement()
pop last inserted element (used only in function myEndElement)
NBEdge * getNBEdge()
returns the internal NBEdge
A lane area vehicles can halt at (netedit-version)
#define WRITE_MESSAGE(msg)
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
An access point for a train stop.
static GNEAdditional * buildClosingLaneReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNELane *closedLane, SVCPermissions permissions)
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
static GNEAdditional * buildDetectorExit(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a exit detector (E3)
void parseAndBuildDetectorEntry(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Entry detector.
alternative tag for e3 detector
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.
alternative tag for e2 detector
trigger: a step description
void parseAndBuildRerouterClosingReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Closing Reroute.
SumoXMLTag getTag() const
get XML Tag assigned to this object