67 myCalibratorParent(NULL),
68 myVariableSpeedSignParent(NULL),
69 rerouterIntervalToInsertValues(NULL),
209 const std::string edgeId = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_EDGE, abort);
211 double endTime = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_END, abort);
219 }
else if (startTime > endTime) {
235 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
236 std::string edgeId = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_EDGE, abort);
238 std::string file = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_FILE, abort);
239 double begin = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_BEGIN, abort);
246 WRITE_WARNING(
"The edge '" + edgeId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
259 std::string routeID = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
260 std::vector<std::string> edgeIDs = getParsedAttribute<std::vector<std::string> >(attrs, 0, tag,
SUMO_ATTR_EDGES, abort);
261 std::string color = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_COLOR, abort);
272 std::vector<GNEEdge*> edges;
273 for (std::vector<std::string>::const_iterator i = edgeIDs.begin(); (i != edgeIDs.end()) && (abort ==
false); i++) {
276 if (retrievedEdge != NULL) {
277 edges.push_back(retrievedEdge);
298 std::string vehicleTypeID = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
299 double accel = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_ACCEL, abort);
300 double decel = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_DECEL, abort);
301 double sigma = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_SIGMA, abort);
302 double tau = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_TAU, abort);
303 double length = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_LENGTH, abort);
304 double minGap = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_MINGAP, abort);
305 double maxSpeed = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_MAXSPEED, abort);
307 double speedDev = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_SPEEDDEV, abort);
308 std::string color = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_COLOR, abort);
312 double width = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_WIDTH, abort);
313 std::string filename = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_IMGFILE, abort);
333 speedFactor, speedDev, color, vClass, emissionClass, shape, width, filename, impatience,
334 laneChangeModel, carFollowModel, personCapacity, containerCapacity, boardingDuration,
335 loadingDuration, latAlignment, minGapLat, maxSpeedLat);
347 std::string flowID = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
348 std::string vehicleType = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_TYPE, abort);
349 std::string route = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ROUTE, abort);
350 std::string color = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_COLOR, abort);
351 std::string departLane = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTLANE, abort);
352 std::string departPos = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTPOS, abort);
353 std::string departSpeed = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_DEPARTSPEED, abort);
354 std::string arrivalLane = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ARRIVALLANE, abort);
355 std::string arrivalPos = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ARRIVALPOS, abort);
357 std::string line = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_LINE, abort);
360 bool reroute = getParsedAttribute<bool>(attrs, 0, tag,
SUMO_ATTR_REROUTE, abort);
363 double begin = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_BEGIN, abort);
364 double end = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_END, abort);
366 double period = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_PERIOD, abort);
367 double probability = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_PROB, abort);
368 int number = getParsedAttribute<int>(attrs, 0, tag,
SUMO_ATTR_NUMBER, abort);
392 arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute,
393 departPosLat, arrivalPosLat, begin, end, vehsPerHour, period, probability, number);
405 double time = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_TIME, abort);
406 double speed = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_SPEED, abort);
414 "'; Already exist another " +
toString(step.
getTag()) +
" with the same " +
toString(SUMO_ATTR_TIME) +
".");
426 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
427 std::string file = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort);
428 std::vector<std::string> lanesID = getParsedAttribute<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_LANES, abort);
429 double posx = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_X, abort);
430 double posy = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_Y, abort);
435 std::vector<GNEVariableSpeedSignStep> steps;
437 std::vector<GNELane*> lanes;
438 for (std::vector<std::string>::iterator i = lanesID.begin(); (i < lanesID.end()) && (abort ==
false); i++) {
441 lanes.push_back(lane);
460 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
461 std::vector<std::string> edgesID = getParsedAttribute<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_EDGES, abort);
462 std::string file = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort);
463 double probability = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_PROB, abort);
464 bool off = getParsedAttribute<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_OFF, abort);
465 double posx = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_X, abort);
466 double posy = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_Y, abort);
472 std::vector<GNEEdge*> edges;
473 for (
int i = 0; i < (int)edgesID.size(); i++) {
476 edges.push_back(edge);
493 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
494 std::string laneId = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
495 double startPos = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_STARTPOS, abort);
496 double endPos = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_ENDPOS, abort);
497 std::vector<std::string> lines = getParsedAttribute<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_LINES, abort,
false);
504 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
519 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
520 std::string laneId = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
521 double startPos = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_STARTPOS, abort);
522 double endPos = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_ENDPOS, abort);
523 std::vector<std::string> lines = getParsedAttribute<std::vector<std::string> >(attrs,
id.c_str(), tag,
SUMO_ATTR_LINES, abort,
false);
530 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
545 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
546 std::string laneId = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
547 double startPos = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_STARTPOS, abort);
548 double endPos = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_ENDPOS, abort);
550 double efficiency = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_EFFICIENCY, abort);
552 double chargeDelay = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_CHARGEDELAY, abort);
559 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
574 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
575 std::string laneId = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
576 std::string outfile = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_OUTPUT, abort);
577 double position = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_POSITION, abort);
578 double freq = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
580 std::vector<GNECalibratorRoute> calibratorRoutes;
581 std::vector<GNECalibratorFlow> calibratorFlows;
582 std::vector<GNECalibratorVehicleType> calibratorVehicleTypes;
589 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
590 }
else if (
buildCalibrator(
myViewNet,
id, lane, position, outfile, freq, calibratorRoutes, calibratorFlows, calibratorVehicleTypes)) {
601 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
602 std::string laneId = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
603 double position = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_POSITION, abort);
604 double frequency = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
605 std::string file = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort);
613 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
627 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
628 std::string laneId = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_LANE, abort);
629 double position = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_POSITION, abort);
630 double frequency = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
631 std::string file = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort);
632 double length = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_LENGTH, abort);
636 bool cont = getParsedAttribute<bool>(attrs,
id.c_str(), tag,
SUMO_ATTR_CONT, abort);
643 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(tag) +
" '" +
id +
"' is not known.");
646 }
else if (
buildDetectorE2(
myViewNet,
id, lane, position, length, frequency, file, cont, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold)) {
657 std::string
id = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_ID, abort);
658 double frequency = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_FREQUENCY, abort);
659 std::string file = getParsedAttribute<std::string>(attrs,
id.c_str(), tag,
SUMO_ATTR_FILE, abort);
662 double posx = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_X, abort);
663 double posy = getParsedAttribute<double>(attrs,
id.c_str(), tag,
SUMO_ATTR_Y, abort);
682 std::string laneId = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_LANE, abort);
683 double position = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_POSITION, abort);
704 std::string laneId = getParsedAttribute<std::string>(attrs, 0, tag,
SUMO_ATTR_LANE, abort);
705 double position = getParsedAttribute<double>(attrs, 0, tag,
SUMO_ATTR_POSITION, abort);
731 double endPos = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ENDPOS]);
732 std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LINES]);
735 return buildBusStop(viewNet,
id, lane, startPos, endPos, lines);
745 double endPos = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ENDPOS]);
746 std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LINES]);
759 double endPos = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_ENDPOS]);
766 return buildChargingStation(viewNet,
id, lane, startPos, endPos, chargingPower, efficiency, chargeInTransit, chargeDelay);
781 return buildDetectorE1(viewNet,
id, lane, pos, freq, filename, splitByType);
792 double length = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_LENGTH]);
794 bool cont = GNEAttributeCarrier::parse<bool>(values[
SUMO_ATTR_CONT]);
800 return buildDetectorE2(viewNet,
id, lane, pos, length, freq, filename, cont, timeThreshold, speedThreshold, jamThreshold);
815 if (pos.size() == 1) {
816 return buildDetectorE3(viewNet,
id, pos[0], freq, filename, timeThreshold, speedThreshold);
851 std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_LANES]);
853 std::vector<GNEVariableSpeedSignStep> steps;
855 std::vector<GNELane*> lanes;
856 for (
int i = 0; i < (int)laneIds.size(); i++) {
860 if (pos.size() == 1) {
876 std::vector<GNECalibratorRoute> calibratorRoutes;
877 std::vector<GNECalibratorFlow> calibratorFlows;
878 std::vector<GNECalibratorVehicleType> calibratorVehicleTypes;
881 return buildCalibrator(viewNet,
id, lane, pos, outfile, freq, calibratorRoutes, calibratorFlows, calibratorVehicleTypes);
892 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> >(values[
SUMO_ATTR_EDGES]);
894 bool off = GNEAttributeCarrier::parse<bool>(values[
SUMO_ATTR_OFF]);
895 double prob = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_PROB]);
898 std::vector<GNEEdge*> edges;
899 for (
int i = 0; i < (int)edgeIds.size(); i++) {
903 if (pos.size() == 1) {
904 return buildRerouter(viewNet,
id, pos[0], edges, prob, file, off);
915 double begin = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_BEGIN]);
927 double end = GNEAttributeCarrier::parse<double>(values[
SUMO_ATTR_END]);
1003 bool cont,
const double timeThreshold,
double speedThreshold,
double jamThreshold) {
1006 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lane, viewNet, pos, length, freq, filename, cont, timeThreshold, speedThreshold, jamThreshold);
1038 }
else if (E3Parent == NULL) {
1064 }
else if (E3Parent == NULL) {
1086 const std::vector<GNECalibratorRoute>& calibratorRoutes,
const std::vector<GNECalibratorFlow>& calibratorFlows,
1087 const std::vector<GNECalibratorVehicleType>& calibratorVehicleTypes) {
1090 GNECalibrator* calibrator =
new GNECalibrator(
id, lane, viewNet, pos, freq, outfile, calibratorRoutes, calibratorFlows, calibratorVehicleTypes);
1190 WRITE_WARNING(
"The position of " + tt +
" '" + tid +
"' lies beyond the lane's '" + lane.
getID() +
"' length.");
1199 if (minLength > laneLength) {
1203 startPos += laneLength;
1206 endPos += laneLength;
1208 if (endPos < minLength || endPos > laneLength) {
1212 if (endPos < minLength) {
1215 if (endPos > laneLength) {
1216 endPos = laneLength;
1219 if (startPos < 0 || startPos > endPos - minLength) {
1226 if (startPos > endPos - minLength) {
1227 startPos = endPos - minLength;
1234 template <
typename T> T
1237 std::string parsedAttribute =
"0";
1241 std::string additionalOfWarningMessage;
1243 additionalOfWarningMessage =
toString(tag) +
" with ID '" +
toString(objectid) +
"'";
1245 additionalOfWarningMessage =
toString(tag);
1250 parsedAttribute = attrs.
get<std::string>(attribute, objectid, ok,
false);
1256 if (ok && !GNEAttributeCarrier::canParse<T>(parsedAttribute)) {
1259 std::string errorFormat;
1262 if (GNEAttributeCarrier::canParse<int>(parsedAttribute)) {
1264 int parsedIntAttribute = GNEAttributeCarrier::parse<int>(parsedAttribute);
1266 errorFormat =
"Cannot be negative; ";
1270 errorFormat =
"Cannot be parsed to int; ";
1276 if (GNEAttributeCarrier::canParse<double>(parsedAttribute)) {
1278 double parsedSumoRealAttribute = GNEAttributeCarrier::parse<double>(parsedAttribute);
1280 errorFormat =
"Cannot be negative; ";
1284 errorFormat =
"Cannot be parsed to float; ";
1290 if (GNEAttributeCarrier::canParse<double>(parsedAttribute)) {
1292 double parsedSumoRealAttribute = GNEAttributeCarrier::parse<double>(parsedAttribute);
1293 if (parsedSumoRealAttribute < 0) {
1294 errorFormat =
"Time cannot be negative; ";
1298 errorFormat =
"Cannot be parsed to time; ";
1304 errorFormat =
"Filename contains invalid characters; ";
1309 errorFormat =
"Is not a part of defined set of Vehicle Classes; ";
1313 errorFormat =
"Is not a part of defined set of Gui Vehicle Shapes; ";
1319 parsedAttribute =
toString(GNEAttributeCarrier::getDefaultValue<T>(tag, attribute));
1323 additionalOfWarningMessage +
" is invalid; " + errorFormat +
"Default value '" +
toString(parsedAttribute) +
"' will be used.");
1327 additionalOfWarningMessage +
" is invalid; " + errorFormat +
"Additional cannot be created");
1329 parsedAttribute =
"0";
1336 parsedAttribute =
toString(GNEAttributeCarrier::getDefaultValue<T>(tag, attribute));
1340 additionalOfWarningMessage +
" is missing; Default value '" +
toString(parsedAttribute) +
"' will be used.");
1344 additionalOfWarningMessage +
" is missing; Additional cannot be created");
1350 return GNEAttributeCarrier::parse<T>(parsedAttribute);
1363 if ((vehsPerHour == -1) && (period == -1) && (probability == -1)) {
1368 int vehsPerHourDefined = (vehsPerHour != -1) ? 1 : 0;
1369 int periodDefined = (period != -1) ? 1 : 0;
1370 int probabilityDefined = (probability != -1) ? 1 : 0;
1372 if ((vehsPerHourDefined + periodDefined + probabilityDefined) != 1) {
1376 }
else if (vehsPerHourDefined == 1) {
1378 }
else if (periodDefined == 1) {
1380 }
else if (probabilityDefined == 1) {
void parseVariableSpeedSignStep(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses step values of VariableSpeedSigns.
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.
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
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
static std::string getAttributeType(SumoXMLTag tag, SumoXMLAttr attr)
get type of attribute
void parseAndBuildDetectorE1(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a induction loop detector (E1)
static bool buildRouteProbe(GNEViewNet *viewNet, const std::string &id, GNEEdge *edge, double freq, const std::string &file, double begin)
builds a Route probe
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...
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
a flow definition (used by router)
void addCalibratorFlow(const GNECalibratorFlow &flow)
add calibrator flow
static bool buildVariableSpeedSign(GNEViewNet *viewNet, 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)
void parseAndBuildChargingStation(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a charging station.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
Allow/disallow charge in transit in Charging Stations.
const std::string & getFileName() const
returns the current file name
static bool buildDetectorE2(GNEViewNet *viewNet, 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)
Builds a lane Area Detector (E2)
GNEAdditionalHandler(const std::string &file, GNEViewNet *viewNet)
Constructor.
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
weights: time range begin
static bool buildAdditional(GNEViewNet *viewNet, SumoXMLTag tag, std::map< SumoXMLAttr, std::string > values)
Build additionals.
static bool isPositive(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is only Positive (i.e. cannot take negative values)
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...
static bool buildBusStop(GNEViewNet *viewNet, const std::string &id, GNELane *lane, double startPos, double endPos, const std::vector< std::string > &lines)
Builds a bus stop.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEVariableSpeedSign * myVariableSpeedSignParent
Pointer to the last inserted variableSpeedSign.
SAX-handler base for SUMO-files.
static bool buildDetectorEntry(GNEViewNet *viewNet, GNEDetectorE3 *E3Parent, GNELane *lane, double pos)
Builds a entry detector (E3)
static bool isValidFilename(const std::string &value)
true if value is a valid file value
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
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)
void parseAndBuildDetectorE2(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a lane area detector (E2)
int getNumberOfEntryChilds() const
get number of entry childs
bool checkStopPos(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
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
GNECalibratorFlow::TypeOfFlow getTypeOfFlowDistribution(std::string flowID, double vehsPerHour, double period, double probability)
get a error message, if configuration of flow distribution is invalid
bool getFriendlyPosition(const SUMOSAXAttributes &attrs, const char *objectid)
get special attribute friendly position, used in stopping places
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
GNEUndoList * getUndoList() const
get the undoList object
~GNEAdditionalHandler()
Destructor.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Encapsulated SAX-Attributes.
static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
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.
static bool buildContainerStop(GNEViewNet *viewNet, const std::string &id, GNELane *lane, double startPos, double endPos, const std::vector< std::string > &lines)
Builds a container stop.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
static bool isFilename(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a filename
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 buildVaporizer(GNEViewNet *viewNet, GNEEdge *edge, double startTime, double end)
Builds a vaporizer (lane speed trigger)
const std::string getID() const
function to support debugging
static bool buildDetectorE1(GNEViewNet *viewNet, const std::string &id, GNELane *lane, double pos, double freq, const std::string &filename, bool splitByType)
Builds a induction loop detector (E1)
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.
static bool buildChargingStation(GNEViewNet *viewNet, const std::string &id, GNELane *lane, double startPos, double endPos, double chargingPower, double efficiency, bool chargeInTransit, double chargeDelay)
Builds a charging Station.
double getLaneShapeLength() const
returns the length of the lane's shape
static bool buildDetectorE3(GNEViewNet *viewNet, const std::string &id, Position pos, double freq, const std::string &filename, const double timeThreshold, double speedThreshold)
Builds a multi entry exit detector (E3)
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)
const std::vector< GNEVariableSpeedSignStep > & getSteps() const
get values of variable speed signal
void parseAndBuildCalibrator(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a mesoscopic or microscopic calibrator.
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.
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 buildCalibrator(GNEViewNet *viewNet, 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
GNEAdditional * retrieveAdditional(const std::string &idl, bool hardFail=true) const
Returns the named additional.
static T getParsedAttribute(const SUMOSAXAttributes &attrs, const char *objectid, SumoXMLTag tag, SumoXMLAttr attribute, bool &abort, bool report=true)
get parsed attribute of XML and show warnings if there are problems
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
SumoXMLTag getTag() const
get tag
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
int getNumberOfExitChilds() const
get number of exit childs
Eficiency of the charge in Charging Stations.
SumoXMLTag myLastTag
last used Tag
parent of an additional element
Delay in the charge of charging stations.
A lane area vehicles can halt at (netedit-version)
double getPosition(const SUMOSAXAttributes &attrs, GNELane &lane, const std::string &tt, const std::string &tid)
extracts the position, checks whether it shall be mirrored and checks whether it is within 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, GNEDetectorE3 *E3Parent, GNELane *lane, double pos)
Builds a exit detector (E3)
static bool buildRerouter(GNEViewNet *viewNet, const std::string &id, Position pos, const std::vector< GNEEdge *> &edges, double prob, const std::string &file, bool off)
builds a rerouter
trigger: a step description
SumoXMLTag getTag() const
get XML Tag assigned to this object