66 myUndoAdditionals(undoAdditionals),
68 myCalibratorParent(NULL),
69 myVariableSpeedSignParent(NULL),
70 rerouterIntervalToInsertValues(NULL),
210 const std::string edgeId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_EDGE, abort);
211 double startTime = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_STARTTIME, abort);
212 double endTime = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_END, abort);
220 }
else if (startTime > endTime) {
236 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
237 std::string edgeId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_EDGE, abort);
238 double freq = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_FREQUENCY, abort);
239 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_FILE, abort,
false);
240 double begin = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_BEGIN, abort);
247 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
250 }
else if (edge == NULL) {
252 WRITE_WARNING(
"The edge '" + edgeId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
265 std::string routeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
266 std::vector<std::string> edgeIDs = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs, 0, tag,
SUMO_ATTR_EDGES, abort);
267 RGBColor color = GNEAttributeCarrier::parseAttributeFromXML<RGBColor>(attrs, 0, tag,
SUMO_ATTR_COLOR, abort,
false);
278 std::vector<GNEEdge*> edges;
279 for (std::vector<std::string>::const_iterator i = edgeIDs.begin(); (i != edgeIDs.end()) && (abort ==
false); i++) {
282 if (retrievedEdge != NULL) {
283 edges.push_back(retrievedEdge);
303 std::string vehicleTypeID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
304 double accel = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_ACCEL, abort);
305 double decel = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_DECEL, abort);
306 double sigma = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_SIGMA, abort);
307 double tau = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_TAU, abort);
308 double length = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_LENGTH, abort);
309 double minGap = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_MINGAP, abort);
310 double maxSpeed = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_MAXSPEED, abort);
311 double speedFactor = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_SPEEDFACTOR, abort);
312 double speedDev = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_SPEEDDEV, abort);
313 RGBColor color = GNEAttributeCarrier::parseAttributeFromXML<RGBColor>(attrs, 0, tag,
SUMO_ATTR_COLOR, abort,
false);
315 std::string emissionClass = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_EMISSIONCLASS, abort);
317 double width = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_WIDTH, abort);
318 std::string filename = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_IMGFILE, abort);
319 double impatience = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_IMPATIENCE, abort);
320 std::string laneChangeModel = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_LANE_CHANGE_MODEL, abort);
321 std::string carFollowModel = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_CAR_FOLLOW_MODEL, abort);
325 double loadingDuration = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_LOADING_DURATION, abort);
326 std::string latAlignment = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_LATALIGNMENT, abort);
327 double minGapLat = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_MINGAP_LAT, abort);
328 double maxSpeedLat = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_MAXSPEED_LAT, abort);
338 speedFactor, speedDev, color, vClass, emissionClass, shape, width, filename, impatience,
339 laneChangeModel, carFollowModel, personCapacity, containerCapacity, boardingDuration,
340 loadingDuration, latAlignment, minGapLat, maxSpeedLat);
352 std::string flowID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
353 std::string vehicleType = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_TYPE, abort);
354 std::string route = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ROUTE, abort);
355 RGBColor color = GNEAttributeCarrier::parseAttributeFromXML<RGBColor>(attrs, 0, tag,
SUMO_ATTR_COLOR, abort,
false);
356 std::string departLane = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTLANE, abort);
357 std::string departPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTPOS, abort);
358 std::string departSpeed = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTSPEED, abort);
359 std::string arrivalLane = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ARRIVALLANE, abort);
360 std::string arrivalPos = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ARRIVALPOS, abort);
361 std::string arrivalSpeed = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ARRIVALSPEED, abort);
362 std::string line = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_LINE, abort);
363 int personNumber = GNEAttributeCarrier::parseAttributeFromXML<int>(attrs, 0, tag,
SUMO_ATTR_PERSON_NUMBER, abort);
365 bool reroute = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, 0, tag,
SUMO_ATTR_REROUTE, abort);
366 std::string departPosLat = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTPOS_LAT, abort);
367 std::string arrivalPosLat = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ARRIVALPOS_LAT, abort);
368 double begin = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_BEGIN, abort);
369 double end = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_END, abort);
370 double vehsPerHour = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_VEHSPERHOUR, abort);
371 double period = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_PERIOD, abort);
372 double probability = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_PROB, abort);
373 int number = GNEAttributeCarrier::parseAttributeFromXML<int>(attrs, 0, tag,
SUMO_ATTR_NUMBER, abort);
397 arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute,
398 departPosLat, arrivalPosLat, begin, end, vehsPerHour, period, probability, number);
410 double time = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_TIME, abort);
411 double speed = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_SPEED, abort);
419 "'; Already exist another " +
toString(step.
getTag()) +
" with the same " +
toString(SUMO_ATTR_TIME) +
".");
431 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
432 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort,
false);
433 std::vector<std::string> lanesID = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_LANES, abort);
434 double posx = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_X, abort);
435 double posy = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_Y, abort);
440 std::vector<GNEVariableSpeedSignStep> steps;
442 std::vector<GNELane*> lanes;
443 for (std::vector<std::string>::iterator i = lanesID.begin(); (i < lanesID.end()) && (abort ==
false); i++) {
446 lanes.push_back(lane);
464 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
465 std::vector<std::string> edgesID = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_EDGES, abort);
466 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort,
false);
467 double probability = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_PROB, abort);
468 bool off = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_OFF, abort);
469 double posx = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_X, abort);
470 double posy = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_Y, abort);
476 std::vector<GNEEdge*> edges;
477 for (
int i = 0; i < (int)edgesID.size(); i++) {
480 edges.push_back(edge);
497 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
498 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
499 double startPos = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_STARTPOS, abort);
500 double endPos = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_ENDPOS, abort);
501 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_NAME, abort,
false);
502 std::vector<std::string> lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_LINES, abort,
false);
503 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_FRIENDLY_POS, abort,
false);
510 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
513 }
else if (lane == NULL) {
515 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
530 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
531 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
532 double startPos = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_STARTPOS, abort);
533 double endPos = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_ENDPOS, abort);
534 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_NAME, abort,
false);
535 std::vector<std::string> lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_LINES, abort,
false);
536 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_FRIENDLY_POS, abort,
false);
543 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
546 }
else if (lane == NULL) {
548 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
563 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
564 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
565 double startPos = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_STARTPOS, abort);
566 double endPos = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_ENDPOS, abort);
567 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_NAME, abort,
false);
568 double chargingPower = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_CHARGINGPOWER, abort);
569 double efficiency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_EFFICIENCY, abort);
570 bool chargeInTransit = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_CHARGEINTRANSIT, abort);
571 double chargeDelay = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_CHARGEDELAY, abort);
572 bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_FRIENDLY_POS, abort,
false);
579 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
582 }
else if (lane == NULL) {
584 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
588 }
else if (
buildChargingStation(
myViewNet,
myUndoAdditionals,
id, lane, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition)) {
599 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
600 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
601 std::string outfile = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_OUTPUT, abort,
false);
602 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_POSITION, abort);
603 double freq = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
605 std::vector<GNECalibratorRoute> calibratorRoutes;
606 std::vector<GNECalibratorFlow> calibratorFlows;
607 std::vector<GNECalibratorVehicleType> calibratorVehicleTypes;
614 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
617 }
else if (lane == NULL) {
619 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
631 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
632 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
633 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_POSITION, abort);
634 double frequency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
635 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort,
false);
636 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_VTYPES, abort,
false);
637 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_FRIENDLY_POS, abort);
644 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
647 }
else if (lane == NULL) {
649 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
663 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
664 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
665 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_POSITION, abort);
666 double frequency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
667 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort,
false);
668 double length = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_LENGTH, abort);
671 double jamDistThreshold = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_JAM_DIST_THRESHOLD, abort);
672 bool cont = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_CONT, abort);
673 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_FRIENDLY_POS, abort);
680 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
683 }
else if (lane == NULL) {
685 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
688 }
else if (
buildDetectorE2(
myViewNet,
myUndoAdditionals,
id, lane, position, length, frequency, file, cont, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos)) {
699 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
700 double frequency = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
701 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort,
false);
704 double posx = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_X, abort);
705 double posy = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_Y, abort);
710 WRITE_WARNING(
"The id '" +
id +
"' of additional " +
toString(tag) +
" contains invalid characters.");
730 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_LANE, abort);
731 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_POSITION, abort);
732 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, 0, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
755 std::string laneId = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, 0, tag,
SUMO_ATTR_LANE, abort);
756 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, 0, tag,
SUMO_ATTR_POSITION, abort);
757 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, 0, tag,
SUMO_ATTR_FRIENDLY_POS, abort);
785 double endPos = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ENDPOS]);
787 std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LINES]);
791 return buildBusStop(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, lines, friendlyPos);
801 double endPos = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ENDPOS]);
803 std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LINES]);
807 return buildContainerStop(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, lines, friendlyPos);
817 double endPos = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ENDPOS]);
826 return buildChargingStation(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPos);
842 return buildDetectorE1(viewNet, allowUndoRedo,
id, lane, pos, freq, filename, vehicleTypes, friendlyPos);
853 double length = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_LENGTH]);
855 bool cont = GNEAttributeCarrier::parse<bool>(values[
SUMO_ATTR_CONT]);
862 return buildDetectorE2(viewNet, allowUndoRedo,
id, lane, pos, length, freq, filename, cont, timeThreshold, speedThreshold, jamThreshold, friendlyPos);
877 if (pos.size() == 1) {
878 return buildDetectorE3(viewNet, allowUndoRedo,
id, pos[0], freq, filename, timeThreshold, speedThreshold);
915 std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LANES]);
917 std::vector<GNEVariableSpeedSignStep> steps;
919 std::vector<GNELane*> lanes;
920 for (
int i = 0; i < (int)laneIds.size(); i++) {
924 if (pos.size() == 1) {
940 std::vector<GNECalibratorRoute> calibratorRoutes;
941 std::vector<GNECalibratorFlow> calibratorFlows;
942 std::vector<GNECalibratorVehicleType> calibratorVehicleTypes;
945 return buildCalibrator(viewNet, allowUndoRedo,
id, lane, pos, outfile, freq, calibratorRoutes, calibratorFlows, calibratorVehicleTypes);
956 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_EDGES]);
958 bool off = GNEAttributeCarrier::parse<bool>(values[
SUMO_ATTR_OFF]);
959 double prob = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_PROB]);
962 std::vector<GNEEdge*> edges;
963 for (
int i = 0; i < (int)edgeIds.size(); i++) {
967 if (pos.size() == 1) {
968 return buildRerouter(viewNet, allowUndoRedo,
id, pos[0], edges, prob, file, off);
979 double begin = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_BEGIN]);
982 return buildRouteProbe(viewNet, allowUndoRedo,
id, edge, freq, filename, begin);
991 double end = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_END]);
994 return buildVaporizer(viewNet, allowUndoRedo, edge, startTime, end);
1008 GNEBusStop* busStop =
new GNEBusStop(
id, lane, viewNet, startPos, endPos, name, lines, friendlyPosition);
1009 if (allowUndoRedo) {
1028 if (allowUndoRedo) {
1044 GNEAdditionalHandler::buildChargingStation(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
double startPos,
double endPos,
const std::string& name,
double chargingPower,
double efficiency,
bool chargeInTransit,
double chargeDelay,
bool friendlyPosition) {
1046 GNEChargingStation* chargingStation =
new GNEChargingStation(
id, lane, viewNet, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition);
1047 if (allowUndoRedo) {
1066 if (allowUndoRedo) {
1083 bool cont,
const double timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos) {
1085 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lane, viewNet, pos, length, freq, filename, cont, timeThreshold, speedThreshold, jamThreshold, friendlyPos);
1086 if (allowUndoRedo) {
1105 if (allowUndoRedo) {
1124 }
else if (E3Parent == NULL) {
1128 if (allowUndoRedo) {
1160 }
else if (E3Parent == NULL) {
1164 if (allowUndoRedo) {
1193 const std::vector<GNECalibratorRoute>& calibratorRoutes,
const std::vector<GNECalibratorFlow>& calibratorFlows,
1194 const std::vector<GNECalibratorVehicleType>& calibratorVehicleTypes) {
1196 GNECalibrator* calibrator =
new GNECalibrator(
id, lane, viewNet, pos, freq, outfile, calibratorRoutes, calibratorFlows, calibratorVehicleTypes);
1197 if (allowUndoRedo) {
1216 if (allowUndoRedo) {
1222 for (std::vector<GNEEdge*>::const_iterator i = edges.begin(); i != edges.end(); i++) {
1223 (*i)->addGNERerouter(rerouter);
1237 if (allowUndoRedo) {
1256 if (allowUndoRedo) {
1276 if (allowUndoRedo) {
1316 WRITE_WARNING(
"The position of additional '" + additionalID +
"' lies beyond the lane's '" + lane.
getID() +
"' length.");
1325 if (minLength > laneLength) {
1329 startPos += laneLength;
1332 endPos += laneLength;
1334 if (endPos < minLength || endPos > laneLength) {
1338 if (endPos < minLength) {
1341 if (endPos > laneLength) {
1342 endPos = laneLength;
1345 if (startPos < 0 || startPos > endPos - minLength) {
1352 if (startPos > endPos - minLength) {
1353 startPos = endPos - minLength;
1361 if ((pos < 0) || (pos > laneLength)) {
1364 }
else if (pos < 0) {
1366 }
else if (pos > laneLength) {
1376 if ((vehsPerHour == -1) && (period == -1) && (probability == -1)) {
1381 int vehsPerHourDefined = (vehsPerHour != -1) ? 1 : 0;
1382 int periodDefined = (period != -1) ? 1 : 0;
1383 int probabilityDefined = (probability != -1) ? 1 : 0;
1385 if ((vehsPerHourDefined + periodDefined + probabilityDefined) != 1) {
1389 }
else if (vehsPerHourDefined == 1) {
1391 }
else if (periodDefined == 1) {
1393 }
else if (probabilityDefined == 1) {
1403 if ((pos < 0) || ((pos + length) > laneLength)) {
1406 }
else if (pos < 0) {
1408 }
else if (pos > laneLength) {
1411 }
else if ((pos + length) > laneLength) {
1412 length = laneLength - pos;
void parseVariableSpeedSignStep(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses step values of VariableSpeedSigns.
double getLaneShapeLength() const
returns the length of the lane's shape
SumoXMLTag
Numbers representing SUMO-XML - element names.
void parseCalibratorVehicleType(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses vehicle type values of Calibrators.
void parseCalibratorFlow(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses flow values of Calibrators.
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 addCalibratorRoute(const GNECalibratorRoute &route)
add calibrator route
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
void parseAndBuildDetectorE1(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a induction loop detector (E1)
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 addCalibratorFlow(const GNECalibratorFlow &flow)
add calibrator flow
void parseAndBuildChargingStation(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a charging station.
static bool buildRerouter(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNEEdge * > &edges, double prob, const std::string &file, bool off)
builds a rerouter
Allow/disallow charge in transit in Charging Stations.
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
void addExitChild(GNEDetectorExit *exit)
add an Exit child
bool myUndoAdditionals
flag to check if created additionals must be undo and redo
static bool buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, std::map< SumoXMLAttr, std::string > values)
Build additionals.
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
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
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.
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...
GNEVariableSpeedSign * myVariableSpeedSignParent
Pointer to the last inserted variableSpeedSign.
static bool buildVaporizer(GNEViewNet *viewNet, bool allowUndoRedo, GNEEdge *edge, double startTime, double end)
Builds a vaporizer (lane speed trigger)
SAX-handler base for SUMO-files.
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...
begin/end of the description of a route
static bool buildDetectorEntry(GNEViewNet *viewNet, bool allowUndoRedo, GNEDetectorE3 *E3Parent, GNELane *lane, double pos, bool friendlyPos)
Builds a entry detector (E3)
#define WRITE_WARNING(msg)
void parseAndBuildVariableSpeedSign(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Variable Speed Signal (lane speed trigger)
void parseAndBuildDetectorE2(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a lane area detector (E2)
const std::vector< GNEVariableSpeedSignStep > & getSteps() const
get values of variable speed signal
GNEUndoList * getUndoList() const
get the undoList object
GNECalibratorFlow::TypeOfFlow getTypeOfFlowDistribution(std::string flowID, double vehsPerHour, double period, double probability)
get a error message, if configuration of flow distribution is invalid
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
~GNEAdditionalHandler()
Destructor.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this edge
const std::string & getFileName() const
returns the current file name
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void updateGeometry()
update pre-computed geometry information
Encapsulated SAX-Attributes.
SumoXMLTag getTag() const
get tag
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.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this lane
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
static bool buildRouteProbe(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNEEdge *edge, double freq, const std::string &file, double begin)
builds a Route probe
GNEAdditionalHandler(const std::string &file, GNEViewNet *viewNet, bool undoAdditionals=true)
Constructor.
void parseAndBuildRerouter(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a rerouter.
void addStep(const GNEVariableSpeedSignStep &step)
insert a new step in variable speed signal
A lane area vehicles can halt at (netedit-version)
static bool buildDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double length, double freq, const std::string &filename, bool cont, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos)
Builds a lane Area Detector (E2)
static bool buildChargingStation(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double startPos, double endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, double chargeDelay, bool friendlyPosition)
Builds a charging Station.
const std::string getID() const
function to support debugging
bool checkAdditionalParent(SumoXMLTag currentTag)
used to check hierarchy of aditionals with parents and childs (for example, E3)
GNEViewNet * myViewNet
pointer to View's Net
GNECalibrator * myCalibratorParent
Pointer to the last inserted Calibrator.
void addCalibratorVehicleType(const GNECalibratorVehicleType &vehicleType)
add calibrator vehicleType
void parseAndBuildDetectorE3(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a multi entry exit detector (E3)
begin/end of the description of an edge
void parseAndBuildRouteProbe(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds routeProbe.
GNEDetectorE3 * myE3Parent
Pointer to the last inserted E3.
A road/street connecting two junctions (netedit-version)
void parseAndBuildCalibrator(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a mesoscopic or microscopic calibrator.
static bool buildContainerStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double startPos, double endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition)
Builds a container stop.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
trigger: the time of the step
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 bool fixE2DetectorPositionPosition(double &pos, double &length, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
void parseAndBuildVaporizer(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Builds a vaporization.
void resetLastTag()
reset last Tag and clear non-valid Additionals (For example, created E3 withouts Entry/Exit childs) ...
GNENet * getNet() const
get the net object
void deleteAdditional(GNEAdditional *additional)
delete additional element previously inserted
SumoXMLTag getTag() const
get XML Tag assigned to this object
void addEntryChild(GNEDetectorEntry *entry)
add an Entry child
Eficiency of the charge in Charging Stations.
SumoXMLTag myLastTag
last used Tag
parent of an additional element
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.
static bool buildDetectorE3(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, double freq, const std::string &filename, const double timeThreshold, double speedThreshold)
Builds a multi entry exit detector (E3)
Delay in the charge of charging stations.
static bool buildVariableSpeedSign(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNELane * > &destLanes, const std::string &file, const std::vector< GNEVariableSpeedSignStep > &steps)
Builds a VariableSpeedSign (lane speed trigger)
int getNumberOfEntryChilds() const
get number of entry childs
int getNumberOfExitChilds() const
get number of exit childs
GNEAdditional * retrieveAdditional(const std::string &idl, bool hardFail=true) const
Returns the named additional.
static bool buildBusStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double startPos, double endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition)
Builds a bus stop.
A lane area vehicles can halt at (netedit-version)
static bool fixStoppinPlacePosition(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid
void insertAdditional(GNEAdditional *additional, bool hardFail=true)
Insert a additional element previously created in GNEAdditionalHandler.
double getLaneParametricLength() const
returns the parameteric length of the lane
void parseCalibratorRoute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses route values of Calibrators.
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 occured errors.
alternative tag for e2 detector
static bool buildDetectorExit(GNEViewNet *viewNet, bool allowUndoRedo, GNEDetectorE3 *E3Parent, GNELane *lane, double pos, bool friendlyPos)
Builds a exit detector (E3)
static bool buildDetectorE1(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double freq, const std::string &filename, const std::string &vehicleTypes, bool friendlyPos)
Builds a induction loop detector (E1)
trigger: a step description
static bool buildCalibrator(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &outfile, double freq, const std::vector< GNECalibratorRoute > &calibratorRoutes, const std::vector< GNECalibratorFlow > &calibratorFlows, const std::vector< GNECalibratorVehicleType > &calibratorVehicleTypes)
builds a microscopic calibrator