SUMO - Simulation of Urban MObility
GNEAttributeCarrier.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // Abstract Base class for gui objects which carry attributes
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <algorithm>
35 
36 #include "GNEAttributeCarrier.h"
37 #include "GNEUndoList.h"
38 
39 // ===========================================================================
40 // static members
41 // ===========================================================================
42 std::map<SumoXMLTag, std::vector<std::pair <SumoXMLAttr, std::string> > > GNEAttributeCarrier::_allowedAttributes;
43 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedNetElementTags;
44 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedAdditionalTags;
45 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedShapeTags;
46 std::vector<SumoXMLTag> GNEAttributeCarrier::myBlockMovementTags;
47 std::vector<SumoXMLTag> GNEAttributeCarrier::myBlockShapeTags;
48 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNumericalIntAttrs;
49 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNumericalFloatAttrs;
50 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myTimeAttrs;
51 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myBoolAttrs;
52 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myColorAttrs;
53 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myListAttrs;
54 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myUniqueAttrs;
55 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNonEditableAttrs;
56 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myPositiveAttrs;
57 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myProbabilityAttrs;
58 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myFileAttrs;
59 std::map<SumoXMLTag, SumoXMLTag> GNEAttributeCarrier::myAllowedAdditionalWithParentTags;
60 std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > > GNEAttributeCarrier::myDiscreteChoices;
61 std::map<SumoXMLTag, std::map<SumoXMLAttr, std::string > > GNEAttributeCarrier::myAttrDefinitions;
63 
64 const std::string GNEAttributeCarrier::LOADED = "loaded";
65 const std::string GNEAttributeCarrier::GUESSED = "guessed";
66 const std::string GNEAttributeCarrier::MODIFIED = "modified";
67 const std::string GNEAttributeCarrier::APPROVED = "approved";
68 const double GNEAttributeCarrier::INVALID_POSITION = -1000000;
69 
70 #define NODEFAULTVALUE "<NODEFAULTVALUE>"
71 
72 // ===========================================================================
73 // method definitions
74 // ===========================================================================
76  myTag(tag),
77  myIcon(icon) {
78 }
79 
80 
81 template<> int
82 GNEAttributeCarrier::parse(const std::string& string) {
83  return TplConvert::_str2int(string);
84 }
85 
86 
87 template<> double
88 GNEAttributeCarrier::parse(const std::string& string) {
89  return TplConvert::_str2double(string);
90 }
91 
92 
93 template<> bool
94 GNEAttributeCarrier::parse(const std::string& string) {
95  return TplConvert::_str2Bool(string);
96 }
97 
98 
99 template<> std::string
100 GNEAttributeCarrier::parse(const std::string& string) {
101  return string;
102 }
103 
104 
105 template<> SUMOVehicleClass
106 GNEAttributeCarrier::parse(const std::string& string) {
107  if (string.size() == 0) {
108  throw EmptyData();
109  } else if (SumoVehicleClassStrings.hasString(string) == false) {
110  return SVC_IGNORING;
111  } else {
112  return SumoVehicleClassStrings.get(string);
113  }
114 }
115 
116 
117 template<> RGBColor
118 GNEAttributeCarrier::parse(const std::string& string) {
119  return RGBColor::parseColor(string);
120 }
121 
122 
123 template<> SUMOVehicleShape
124 GNEAttributeCarrier::parse(const std::string& string) {
125  if (string.size() == 0) {
126  throw EmptyData();
127  } else if ((string == "unknown") || (SumoVehicleShapeStrings.hasString(string) == false)) {
128  return SVS_UNKNOWN;
129  } else {
130  return SumoVehicleShapeStrings.get(string);
131  }
132 }
133 
134 
135 template<> std::vector<std::string>
136 GNEAttributeCarrier::parse(const std::string& string) {
137  std::vector<std::string> parsedValues;
138  SUMOSAXAttributes::parseStringVector(string, parsedValues);
139  return parsedValues;
140 }
141 
142 
143 template<> std::vector<int>
144 GNEAttributeCarrier::parse(const std::string& string) {
145  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
146  std::vector<int> parsedIntValues;
147  for (auto i : parsedValues) {
148  parsedIntValues.push_back(parse<int>(i));
149  }
150  return parsedIntValues;
151 }
152 
153 
154 template<> std::vector<double>
155 GNEAttributeCarrier::parse(const std::string& string) {
156  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
157  std::vector<double> parsedDoubleValues;
158  for (auto i : parsedValues) {
159  parsedDoubleValues.push_back(parse<double>(i));
160  }
161  return parsedDoubleValues;
162 }
163 
164 
165 template<> std::vector<bool>
166 GNEAttributeCarrier::parse(const std::string& string) {
167  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
168  std::vector<bool> parsedBoolValues;
169  for (auto i : parsedValues) {
170  parsedBoolValues.push_back(parse<bool>(i));
171  }
172  return parsedBoolValues;
173 }
174 
175 
176 std::string
178  return getAttribute(key);
179 }
180 
181 
184  return myTag;
185 }
186 
187 
188 FXIcon*
191 }
192 
193 
194 GUIIcon
196  return myIcon;
197 }
198 
199 
200 std::vector<SumoXMLAttr>
202  std::vector<SumoXMLAttr> attr;
203  for (auto i : allowedAttributes(myTag)) {
204  attr.push_back(i.first);
205  }
206  return attr;
207 }
208 
209 
210 const std::string
212  return getAttribute(SUMO_ATTR_ID);
213 }
214 
215 
216 std::string
218  if (isInt(tag, attr)) {
219  return "int";
220  } else if (isFloat(tag, attr)) {
221  return "float";
222  } else if (isTime(tag, attr)) {
223  return "time";
224  } else if (isBool(tag, attr)) {
225  return "bool";
226  } else if (isColor(tag, attr)) {
227  return "color";
228  } else if (isString(tag, attr)) {
229  return "string";
230  } else if (isList(tag, attr)) {
231  return "list";
232  } else {
233  throw ProcessError("Undeterminted type for '" + toString(tag) + "' '" + toString(attr) + "'");
234  }
235 }
236 
237 
238 bool
239 GNEAttributeCarrier::isValidID(const std::string& value) {
240  return value.find_first_of(" \t\n\r@$%^&/|\\{}*'\";:<>") == std::string::npos;
241 }
242 
243 
244 bool
245 GNEAttributeCarrier::isValidFilename(const std::string& value) {
246  // @note Only characteres that aren't permited in a file path or belong
247  // to XML sintax
248  return (value.find_first_of("\t\n\r@$%^&|\\{}*'\";:<>") == std::string::npos);
249 }
250 
251 
252 // ===========================================================================
253 // static methods
254 // ===========================================================================
255 
256 const std::vector<std::pair <SumoXMLAttr, std::string> >&
258  // define on first access
259  if (!_allowedAttributes.count(tag)) {
260  std::vector<std::pair<SumoXMLAttr, std::string> >& attrs = _allowedAttributes[tag];
261  switch (tag) {
262  case SUMO_TAG_EDGE:
263  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
264  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM, NODEFAULTVALUE));
265  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO, NODEFAULTVALUE));
266  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "13.89"));
267  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PRIORITY, "1"));
268  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NUMLANES, "1"));
269  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
270  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
271  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
272  //attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PREFER, ));
273  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, ""));
274  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, NODEFAULTVALUE));
275  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPREADTYPE, "right"));
276  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
277  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "default"));
278  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDOFFSET, "0"));
279  attrs.push_back(std::pair<SumoXMLAttr, std::string>(GNE_ATTR_SHAPE_START, "")); // virtual attribute used to define an endPoint
280  attrs.push_back(std::pair<SumoXMLAttr, std::string>(GNE_ATTR_SHAPE_END, "")); // virtual attribute from to define an endPoint
281  break;
282  case SUMO_TAG_JUNCTION:
283  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
284  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE)); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
285  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
286  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, ""));
287  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_RADIUS, "1.5"));
288  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_KEEP_CLEAR, "true"));
289  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLTYPE, ""));
290  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLID, ""));
291  break;
292  case SUMO_TAG_LANE:
293  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
294  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "13.89"));
295  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
296  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
297  //attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PREFER, ));
298  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "default"));
299  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDOFFSET, "0"));
300  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ACCELERATION, "false"));
301  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CUSTOMSHAPE, ""));
302  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_INDEX, NODEFAULTVALUE));
303  break;
304  case SUMO_TAG_POI:
305  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
306  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE)); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
307  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "red"));
308  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, ""));
309  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
310  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LAYER, "0"));
311  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "0"));
312  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HEIGHT, "0"));
313  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
314  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ANGLE, "0"));
315  break;
316  case SUMO_TAG_POLY:
317  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
318  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, NODEFAULTVALUE));
319  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "green"));
320  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILL, "false"));
321  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LAYER, "0"));
322  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
323  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
324  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ANGLE, "0"));
325  break;
326  case SUMO_TAG_CROSSING:
327  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
328  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
329  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PRIORITY, "false"));
330  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "3"));
331  break;
332  case SUMO_TAG_CONNECTION:
333  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM, NODEFAULTVALUE));
334  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO, NODEFAULTVALUE));
335  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM_LANE, NODEFAULTVALUE));
336  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO_LANE, NODEFAULTVALUE));
337  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PASS, "false"));
338  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_KEEP_CLEAR, "false"));
339  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTPOS, "0"));
340  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_UNCONTROLLED, "false"));
341  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VISIBILITY_DISTANCE, "4.5"));
342  break;
343  case SUMO_TAG_BUS_STOP:
344  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
345  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
346  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
347  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
348  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
349  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
350  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINES, ""));
351  break;
353  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
354  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
355  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
356  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
357  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
358  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
359  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINES, ""));
360  break;
362  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
363  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
364  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
365  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
366  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
367  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
368  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGINGPOWER, "22000"));
369  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EFFICIENCY, "0.95"));
370  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGEINTRANSIT, "false"));
371  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGEDELAY, "0"));
372  break;
373  case SUMO_TAG_E1DETECTOR:
374  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
375  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
376  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
377  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
378  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
379  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VTYPES, ""));
380  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
381  break;
382  case SUMO_TAG_E2DETECTOR:
383  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
384  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
385  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
386  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, "10"));
387  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
388  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
389  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONT, "false"));
390  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "1"));
391  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_SPEED_THRESHOLD, "1.39"));
392  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_JAM_DIST_THRESHOLD, "10"));
393  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
394  break;
395  case SUMO_TAG_E3DETECTOR:
396  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
397  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_X, "0"));
398  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_Y, "0"));
399  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
400  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
401  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "1"));
402  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_SPEED_THRESHOLD, "1.39"));
403  break;
404  case SUMO_TAG_DET_ENTRY:
405  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
406  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
407  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
408  break;
409  case SUMO_TAG_DET_EXIT:
410  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
411  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
412  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
413  break;
414  case SUMO_TAG_VSS:
415  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
416  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANES, ""));
417  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
418  break;
419  case SUMO_TAG_CALIBRATOR:
420  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
421  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
422  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, "0"));
423  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
424  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTEPROBE, ""));
425  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OUTPUT, ""));
426  break;
427  case SUMO_TAG_REROUTER:
428  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
429  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
430  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
431  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "1"));
432  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OFF, "false"));
433  break;
434  case SUMO_TAG_ROUTEPROBE:
435  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
436  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
437  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
438  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
439  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, "0"));
440  break;
441  case SUMO_TAG_VAPORIZER:
442  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
443  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTTIME, "0"));
444  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, "10"));
445  break;
446  case SUMO_TAG_FLOW:
447  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
448  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, NODEFAULTVALUE));
449  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTE, NODEFAULTVALUE));
450  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, NODEFAULTVALUE));
451  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, NODEFAULTVALUE));
452  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VEHSPERHOUR, "-1"));
453  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERIOD, "-1"));
454  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "-1"));
455  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NUMBER, "100"));
456  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTLANE, "first"));
457  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTPOS, "base"));
458  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTSPEED, "0"));
459  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALLANE, "current"));
460  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALPOS, "max"));
461  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALSPEED, "current"));
462  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINE, ""));
463  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERSON_NUMBER, "0"));
464  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTAINER_NUMBER, "0"));
465  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_REROUTE, "false"));
466  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTPOS_LAT, "center"));
467  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALPOS_LAT, ""));
468  break;
469  case SUMO_TAG_ROUTE:
470  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
471  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
472  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, ""));
473  break;
474  case SUMO_TAG_VTYPE:
475  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
476  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ACCEL, "2.6"));
477  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DECEL, "4.5"));
478  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SIGMA, "0.5"));
479  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TAU, "1.0"));
480  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, "5.0"));
481  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MINGAP, "2.5"));
482  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MAXSPEED, "70.0"));
483  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEEDFACTOR, "1.0"));
484  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEEDDEV, "0.0"));
485  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "1,1,0"));
486  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VCLASS, "unknown"));
487  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EMISSIONCLASS, "P_7_7"));
488  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_GUISHAPE, "unknown"));
489  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "2.0"));
490  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
491  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMPATIENCE, "0.0"));
492  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE_CHANGE_MODEL, "LC2013"));
493  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CAR_FOLLOW_MODEL, "Krauss"));
494  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERSON_CAPACITY, "4"));
495  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTAINER_CAPACITY, "0"));
496  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BOARDING_DURATION, "0.5"));
497  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LOADING_DURATION, "90.0"));
498  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LATALIGNMENT, "center"));
499  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MINGAP_LAT, "0.12"));
500  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MAXSPEED_LAT, "1.0"));
501  break;
502  case SUMO_TAG_STEP:
503  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TIME, NODEFAULTVALUE));
504  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "50.0"));
505  break;
506  default:
507  // Throw exception if tag isn't defined
508  throw ProcessError("allowed attributes for tag '" + toString(tag) + "' not defined");
509  }
510  }
511  return _allowedAttributes[tag];
512 }
513 
514 
515 std::vector<SumoXMLTag>
517  std::vector<SumoXMLTag> tags;
518  // append all net elements to tags
519  tags.insert(std::end(tags), std::begin(allowedNetElementsTags()), std::end(allowedNetElementsTags()));
520  tags.insert(std::end(tags), std::begin(allowedAdditionalTags()), std::end(allowedAdditionalTags()));
521  tags.insert(std::end(tags), std::begin(allowedShapeTags()), std::end(allowedShapeTags()));
522  return tags;
523 }
524 
525 
526 const std::vector<SumoXMLTag>&
528  // define on first access
529  if (myAllowedNetElementTags.empty()) {
535  }
537 }
538 
539 
540 const std::vector<SumoXMLTag>&
542  // define on first access
543  if (myAllowedAdditionalTags.empty()) {
557  }
559 }
560 
561 
562 const std::vector<SumoXMLTag>&
564  // define on first access
565  if (myAllowedShapeTags.empty()) {
567  myAllowedShapeTags.push_back(SUMO_TAG_POI);
568  }
569  return myAllowedShapeTags;
570 }
571 
572 
573 bool
575  // define on first access
576  if (myBlockMovementTags.empty()) {
589  }
590  return std::find(myBlockMovementTags.begin(), myBlockMovementTags.end(), tag) != myBlockMovementTags.end();
591 }
592 
593 
594 bool
596  // define on first access
597  if (myBlockShapeTags.empty()) {
598  myBlockShapeTags.push_back(SUMO_TAG_POLY);
599  }
600  return std::find(myBlockShapeTags.begin(), myBlockShapeTags.end(), tag) != myBlockShapeTags.end();
601 }
602 
603 
604 bool
606  return (isInt(tag, attr) || isFloat(tag, attr));
607 }
608 
609 
610 bool
612  // define on first access
613  if (myNumericalIntAttrs.empty()) {
614  // connection
617  // edge
620  // lane
622  // flow
627  // vehicle type
630  // POI
632  // Layer
634  }
635  return myNumericalIntAttrs[tag].count(attr) == 1;
636 }
637 
638 
639 bool
641  // define on first access
642  if (myNumericalFloatAttrs.empty()) {
643  // bus stop
646  // charging station
651  // connection
654  // container stop
657  // crossing
659  // E2
663  // E3
667  // Edge
671  // Junction
673  // Lane
676  // Rerouter
678  // Calibrator
680  // vehicle type
694  // flow
698  // step
700  // POLY
702  // POI
706  }
707  return myNumericalFloatAttrs[tag].count(attr) == 1;
708 }
709 
710 
711 bool
713  // define on first access
714  if (myTimeAttrs.empty()) {
715  // calibrator
717  // charging station
719  // E1
721  // E2
724  // E3
727  // RouteProbe
730  // Vaporizer
733  // Vehicle type
736  // Flow
739  // step
741  }
742  return myTimeAttrs[tag].count(attr) == 1;
743 }
744 
745 
746 bool
748  // define on first access
749  if (myBoolAttrs.empty()) {
750  // bus stop
752  // container stop
754  // charging station
757  // lane
759  // connection
762  // crossing
764  // E1
766  // E2
769  // Entry
771  // Exit
773  // junction
775  // rerouter
777  // flow
779  // Poly
781  }
782  return myBoolAttrs[tag].count(attr) == 1;
783 }
784 
785 
786 bool
788  // define on first access
789  if (myColorAttrs.empty()) {
790  // POI
792  // Poly
794  // Route
796  // Color
798  }
799  return myColorAttrs[tag].count(attr) == 1;
800 }
801 
802 
803 bool
805  return (!isNumerical(tag, attr) && !isBool(tag, attr) && !isTime(tag, attr));
806 }
807 
808 
809 bool
811  // define on first access
812  if (myListAttrs.empty()) {
813  // bus stop
815  // container stop
817  // crossing
819  // rerouter
821  // variable speed signal
823  // route
825  // POLY
827  }
828  return myListAttrs[tag].count(attr) == 1;
829 }
830 
831 
832 bool
834  // ID is an atribute that always is unique
835  if (attr == SUMO_ATTR_ID) {
836  return true;
837  } else {
838  // define on first access
839  if (myUniqueAttrs.empty()) {
840  // connection
844  // edge
847  // busstop
851  // calibrator
853  // charging station
857  // connection
859  // container stop
863  // crossing
865  // det entry
868  // det exit
871  // E1
875  // E2
879  // E3
883  // Edge
885  // Junction
889  // POI
891  // Rerouter
894  // Routeprobe
897  // Vaporizer
900  // VSS
902  // POI
905  // POLY
907  }
908  return myUniqueAttrs[tag].count(attr) == 1;
909  }
910 }
911 
912 
913 bool
915  if (discreteChoices(tag, attr).size() > 0) {
916  return true;
917  } else {
918  return false;
919  }
920 }
921 
922 
923 bool
925  // define on first access
926  if (myPositiveAttrs.empty()) {
927  // edge
934  // junction
936  // lane
940  // poi
942  // crossing
944  // connection
947  // charging station
951  // E1
953  // E2
959  // entry
961  // exit
963  // calibrator
965  // flow
971  // vehicle type
986  // POI
989  }
990  return myPositiveAttrs[tag].count(attr) == 1;
991 }
992 
993 
994 bool
996  // define on first access
997  if (myProbabilityAttrs.empty()) {
998  // charging station
1000  // rerouter
1002  // flow
1004  }
1005  return myProbabilityAttrs[tag].count(attr) == 1;
1006 }
1007 
1008 
1009 bool
1011  // define on first access
1012  if (myFileAttrs.empty()) {
1013  // E1
1015  // E2
1017  // E3
1019  // calibrator
1021  // rerouter
1023  // routeprobe
1025  // Variable Speed Signal
1027  // POI
1029  // POLY
1031  }
1032  return myFileAttrs[tag].count(attr) == 1;
1033 }
1034 
1035 
1036 bool
1038  // define on first access
1039  if (myNonEditableAttrs.empty()) {
1040  // connection
1045  // crossing
1047  // lane
1049  }
1050  return myNonEditableAttrs[tag].count(attr) == 1;
1051 }
1052 
1053 
1054 bool
1056  for (auto i : allowedAttributes(tag)) {
1057  if (i.first == attr) {
1058  return true;
1059  }
1060  }
1061  return false;
1062 }
1063 
1064 
1065 bool
1067  for (auto i : allowedAttributes(tag)) {
1068  if (i.first == attr) {
1069  return (i.second != NODEFAULTVALUE);
1070  }
1071  }
1072  throw ProcessError("Attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' not defined");
1073 }
1074 
1075 
1076 const std::vector<std::string>&
1078  // define on first access
1079  if (myDiscreteChoices.empty()) {
1080  std::vector<std::string> choices;
1081  // Get type of nodes
1083  for (auto it : choices) {
1085  // junction
1087  }
1088  }
1089  // Get types of traffic lights
1091  for (auto it : choices) {
1092  if (it != toString(TLTYPE_INVALID)) {
1093  // junction
1095  }
1096  }
1097  // get type of lane spread functions
1099  for (auto it : choices) {
1100  // edge
1102  }
1103  // get vehicle types
1104  choices = SumoVehicleClassStrings.getStrings();
1105  for (auto it : choices) {
1106  // edge
1109  // lane
1112  // vehicle type
1114  }
1115  // get vehicle shapes
1116  choices = SumoVehicleShapeStrings.getStrings();
1117  for (auto it : choices) {
1118  // vehicle type
1120  }
1121  // lat alignments of vehicle types
1127  myDiscreteChoices[SUMO_TAG_VTYPE][SUMO_ATTR_LATALIGNMENT].push_back("arbitrary");
1128  }
1129  return myDiscreteChoices[tag][attr];
1130 }
1131 
1132 
1133 bool
1135  return (attr == SUMO_ATTR_ALLOW || attr == SUMO_ATTR_DISALLOW);
1136 }
1137 
1138 
1139 std::string
1141  // define on first access
1142  if (myAttrDefinitions.empty()) {
1143  // Edge
1144  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ID] = "The id of the edge (must be unique).";
1145  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_FROM] = "The name of a node within the nodes-file the edge shall start at.";
1146  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_TO] = "The name of a node within the nodes-file the edge shall end at.";
1147  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SPEED] = "The maximum speed allowed on the edge in m/s.";
1148  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_PRIORITY] = "The priority of the edge.";
1149  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_NUMLANES] = "The number of lanes of the edge.";
1150  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_TYPE] = "The name of a type within the SUMO edge type file";
1151  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ALLOW] = "Explicitly allows the given vehicle classes (not given will be not allowed).";
1152  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_DISALLOW] = "Explicitly disallows the given vehicle classes (not given will be allowed).";
1153  //myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_PREFER] = "";
1154  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SHAPE] = "If the shape is given it should start and end with the positions of the from-node and to-node.";
1155  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_LENGTH] = "The length of the edge in meter";
1156  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SPREADTYPE] = "Lane width for all lanes of this edge in meters (used for visualization).";
1157  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_NAME] = "street name (need not be unique, used for visualization).";
1158  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_WIDTH] = "Lane width for all lanes of this edge in meters (used for visualization).";
1159  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ENDOFFSET] = "Move the stop line back from the intersection by the given amount.";
1160  // Junction
1161  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_ID] = "The name of the node (Must be unique).";
1162  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_POSITION] = "The x-y-z position of the node on the plane in meters.";
1163  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TYPE] = "An optional type for the node.";
1164  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_SHAPE] = "A custom shape for that node.";
1165  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_RADIUS] = "Optional turning radius (for all corners) for that node in meters.";
1166  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_KEEP_CLEAR] = "Whether the junction-blocking-heuristic should be activated at this node.";
1167  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TLTYPE] = "An optional type for the traffic light algorithm.";
1168  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TLID] = "An optional id for the traffic light program.";
1169  // Lane
1170  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ID] = "ID of lane (Automatic)";
1171  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_SPEED] = "Speed in meters per second";
1172  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ALLOW] = "Explicitly allows the given vehicle classes (not given will be not allowed).";
1173  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_DISALLOW] = "Explicitly disallows the given vehicle classes (not given will be allowed).";
1174  //myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_PREFER] = "";
1175  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_WIDTH] = "Width in meters (used for visualization).";
1176  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ENDOFFSET] = "Move the stop line back from the intersection by the given amount.";
1177  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_INDEX] = "The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one).";
1178  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_CUSTOMSHAPE] = "If the shape is given it overrides the computation based on edge shape.";
1179  // POI
1180  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_ID] = "The id (a unique name) of the POI";
1181  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_COLOR] = "The color with which the poi shall be displayed";
1182  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_LANE] = "The name of the lane the poi is located at; the lane must be a part of the loaded network";
1183  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_POSITION] = "The position on the named lane or in the net in meters at which the poi is located at";
1184  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_TYPE] = "A typename for the poi";
1185  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_LAYER] = "The layer of the poi for drawing and selecting";
1186  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_IMGFILE] = "A bitmap to use for rendering this poi";
1187  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_WIDTH] = "Width of rendered image in meters";
1188  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_HEIGHT] = "Height of rendered image in meters";
1189  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_ANGLE] = "Angle of rendered image in degree";
1190  // Polygon
1191  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_ID] = "The id (a unique name) of the polygon";
1192  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_COLOR] = "The RGBA color with which the polygon shall be displayed";
1193  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_SHAPE] = "The shape of the polygon";
1194  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_FILL] = "An information whether the polygon shall be filled";
1195  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_LAYER] = "The layer in which the polygon lies";
1196  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_TYPE] = "A typename for the polygon";
1197  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_IMGFILE] = "A bitmap to use for rendering this polygon";
1198  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_ANGLE] = "Angle of rendered image in degree";
1199  // Crossing
1200  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_ID] = "ID (Automatic)";
1201  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_PRIORITY] = "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections).";
1202  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_WIDTH] = "The width of the crossings.";
1203  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_EDGES] = "The (road) edges which are crossed.";
1204  // Connection
1205  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_FROM] = "The name of the edge the vehicles leave ";
1206  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TO] = "The name of the edge the vehicles may reach when leaving 'from'";
1207  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_FROM_LANE] = "the lane index of the incoming lane (numbers starting with 0)";
1208  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TO_LANE] = "the lane index of the outgoing lane (numbers starting with 0)";
1209  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_PASS] = "if set, vehicles which pass this (lane-2-lane) connection) will not wait";
1210  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_KEEP_CLEAR] = "if set to false, vehicles which pass this (lane-2-lane) connection) will not worry about blocking the intersection.";
1211  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_CONTPOS] = "If set to a more than 0 value, an internal junction will be built at this position (in m) from the start of the internal lane for this connection.";
1212  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_UNCONTROLLED] = "If set to true, This connection will not be TLS-controlled despite its node being controlled.";
1213  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_VISIBILITY_DISTANCE] = "sets the distance to the connection at which all relevant foes are visible.";
1214  // Bus Stop
1215  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_ID] = "ID (Must be unique)";
1216  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_LANE] = "The name of the lane the bus stop shall be located at";
1217  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_STARTPOS] = "The begin position on the lane (the lower position on the lane) in meters";
1218  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_ENDPOS] = "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m";
1219  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_NAME] = "Name of busStop";
1220  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_LINES] = "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes";
1221  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1222  // container Stop
1223  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_ID] = "ID (Must be unique)";
1224  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_LANE] = "The name of the lane the container stop shall be located at";
1225  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_STARTPOS] = "The begin position on the lane (the lower position on the lane) in meters";
1226  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_ENDPOS] = "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m";
1228  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_LINES] = "meant to be the names of the bus lines that stop at this container stop. This is only used for visualization purposes";
1229  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1230  // Charging Station
1231  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_ID] = "ID (Must be unique)";
1232  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_LANE] = "Lane of the charging station location";
1233  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_STARTPOS] = "Begin position in the specified lane";
1234  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_ENDPOS] = "End position in the specified lane";
1237  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_EFFICIENCY] = "Charging efficiency [0,1]";
1238  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_CHARGEINTRANSIT] = "Enable or disable charge in transit, i.e. vehicle must or must not to stop for charging";
1239  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_CHARGEDELAY] = "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins";
1240  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1241  // E1
1242  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1243  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_LANE] = "The id of the lane the detector shall be laid on. The lane must be a part of the network used";
1244  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters. The position must be a value between -1*lane's length and the lane's length";
1245  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1246  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1247  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_VTYPES] = "Space separated list of vehicle type ids to consider";
1248  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1249  // E2
1250  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1251  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_LANE] = "The id of the lane the detector shall be laid on. The lane must be a part of the network used";
1252  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1253  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_LENGTH] = "The length of the detector in meters";
1254  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1255  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1256  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_CONT] = "Holds the information whether detectors longer than a lane shall be cut off or continued (set it to true for the second case); default: false";
1257  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_HALTING_TIME_THRESHOLD] = "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting; in s, default: 1s";
1258  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_HALTING_SPEED_THRESHOLD] = "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting; in m/s, default: 5/3.6m/s";
1259  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_JAM_DIST_THRESHOLD] = "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam; in m, default: 10m";
1260  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1261  // E3
1262  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1263  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1264  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1265  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_HALTING_TIME_THRESHOLD] = "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting; in s, default: 1s";
1266  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_HALTING_SPEED_THRESHOLD] = "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting; in m/s, default: 5/3.6m/s";
1267  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_X] = "X position in editor (Only used in netedit)";
1268  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_Y] = "Y position in editor (Only used in netedit)";
1269  // Entry
1270  myAttrDefinitions[SUMO_TAG_DET_ENTRY][SUMO_ATTR_LANE] = "The id of the lane the detector shall be laid on. The lane must be a part of the network used";
1271  myAttrDefinitions[SUMO_TAG_DET_ENTRY][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1272  myAttrDefinitions[SUMO_TAG_DET_ENTRY][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1273  // Exit
1274  myAttrDefinitions[SUMO_TAG_DET_EXIT][SUMO_ATTR_LANE] = "The id of the lane the detector shall be laid on. The lane must be a part of the network used";
1275  myAttrDefinitions[SUMO_TAG_DET_EXIT][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1276  myAttrDefinitions[SUMO_TAG_DET_EXIT][SUMO_ATTR_FRIENDLY_POS] = "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1";
1277  // Variable Speed Signal
1278  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_ID] = "ID (Must be unique)";
1279  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_LANES] = "list of lanes of Variable Speed Signal";
1280  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_FILE] = "The path to the output file";
1281  // Calibrator
1282  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1283  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_LANE] = "The id of lane in the simulation network";
1284  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_POSITION] = "The position of the calibrator on the specified lane";
1285  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_FREQUENCY] = "The aggregation interval in which to calibrate the flows. default is step-length";
1286  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_ROUTEPROBE] = "The id of the routeProbe element from which to determine the route distribution for generated vehicles";
1287  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_OUTPUT] = "The output file for writing calibrator information or NULL";
1288  // Rerouter
1289  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_ID] = "ID (Must be unique)";
1290  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_EDGES] = "An edge id or a list of edge ids where vehicles shall be rerouted";
1291  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_FILE] = "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)";
1292  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_PROB] = "The probability for vehicle rerouting (0-1), default 1";
1293  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_OFF] = "Whether the router should be inactive initially (and switched on in the gui), default:false";
1294  // route probe
1295  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_ID] = "ID (Must be unique)";
1296  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_EDGE] = "The id of an edge in the simulation network";
1297  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_FREQUENCY] = "The frequency in which to report the distribution";
1298  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_FILE] = "The file for generated output";
1299  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_BEGIN] = "The time at which to start generating output";
1300  // flow
1301  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ID] = "The name of the vehicle (Must be unique)";
1302  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_TYPE] = "The id of the vehicle type to use for this vehicle.";
1303  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ROUTE] = "The id of the route the vehicle shall drive along";
1304  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_BEGIN] = "First vehicle departure time";
1305  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_END] = "End of departure interval";
1306  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_VEHSPERHOUR] = "Number of vehicles per hour, equally spaced (not together with period or probability)";
1307  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PERIOD] = "Insert equally spaced vehicles at that period (not together with vehsPerHour or probability)";
1308  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PROB] = "Probability for emitting a vehicle each second (not together with vehsPerHour or period)";
1309  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_NUMBER] = "Total number of vehicles, equally spaced";
1310  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTLANE] = "The lane on which the vehicle shall be inserted";
1311  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTPOS] = "The position at which the vehicle shall enter the net";
1312  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTSPEED] = "The speed with which the vehicle shall enter the network";
1313  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALLANE] = "The lane at which the vehicle shall leave the network";
1314  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALPOS] = "The position at which the vehicle shall leave the network";
1315  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALSPEED] = "The speed with which the vehicle shall leave the network";
1316  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_LINE] = "A string specifying the id of a public transport line which can be used when specifying person rides";
1317  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PERSON_NUMBER] = "The number of occupied seats when the vehicle is inserted";
1318  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_CONTAINER_NUMBER] = "The number of occupied container places when the vehicle is inserted";
1319  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_REROUTE] = " Whether the vehicle should be equipped with a rerouting device";
1320  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTPOS_LAT] = "The lateral position on the departure lane at which the vehicle shall enter the net";
1321  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALPOS_LAT] = "The lateral position on the arrival lane at which the vehicle shall arrive";
1322  // route
1323  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_ID] = "The name of the route (Must be unique)";
1324  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_EDGES] = "The edges the vehicle shall drive along, given as their ids, separated using spaces";
1325  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_COLOR] = "This route's color";
1326  // vehicle type
1327  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_ID] = "The name of the vehicle type (Must be unique)";
1328  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_ACCEL] = "The acceleration ability of vehicles of this type [m/s^2]";
1329  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_DECEL] = "The deceleration ability of vehicles of this type [m/s^2]";
1330  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SIGMA] = "Car-following model parameter";
1331  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_TAU] = "Car-following model parameter";
1332  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LENGTH] = "The vehicle's netto-length (length) [m]";
1333  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MINGAP] = "Empty space after leader [m]";
1334  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MAXSPEED] = "The vehicle's maximum velocity [m/s]";
1335  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SPEEDFACTOR] = "The vehicles expected multiplicator for lane speed limits";
1336  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SPEEDDEV] = "The deviation of the speedFactor";
1337  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_COLOR] = "This vehicle type's color";
1338  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_VCLASS] = "An abstract vehicle class";
1339  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_EMISSIONCLASS] = "An abstract emission class";
1340  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_GUISHAPE] = "How this vehicle is rendered";
1341  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_WIDTH] = "The vehicle's width [m] (only used for drawing)";
1342  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_IMGFILE] = "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)";
1343  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_IMPATIENCE] = "Willingess of drivers to impede vehicles with higher priority";
1344  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LANE_CHANGE_MODEL] = "The model used for changing lanes";
1345  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_CAR_FOLLOW_MODEL] = "The model used for car following";
1346  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_PERSON_CAPACITY] = "The number of persons (excluding an autonomous driver) the vehicle can transport";
1347  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_CONTAINER_CAPACITY] = "The number of containers the vehicle can transport";
1348  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_BOARDING_DURATION] = "The time required by a person to board the vehicle";
1349  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LOADING_DURATION] = "The time required to load a container onto the vehicle";
1350  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LATALIGNMENT] = "The preferred lateral alignment when using the sublane-model";
1351  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MINGAP_LAT] = "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model";
1352  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MAXSPEED_LAT] = "The maximum lateral speed when using the sublane-model";
1353  }
1354  return myAttrDefinitions[tag][attr];
1355 }
1356 
1357 
1358 int
1360  if (myMaxNumAttribute == 0) {
1361  for (auto i : allowedNetElementsTags()) {
1363  }
1364  for (auto i : allowedAdditionalTags()) {
1366  }
1367  for (auto i : allowedShapeTags()) {
1369  }
1370  }
1371  return myMaxNumAttribute;
1372 }
1373 
1374 
1375 template<> int
1377  for (auto i : allowedAttributes(tag)) {
1378  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1379  return parse<int>(i.second);
1380  }
1381  }
1382  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1383  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1384 }
1385 
1386 
1387 template<> double
1389  for (auto i : allowedAttributes(tag)) {
1390  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1391  return parse<double>(i.second);
1392  }
1393  }
1394  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1395  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1396 }
1397 
1398 
1399 template<> bool
1401  for (auto i : allowedAttributes(tag)) {
1402  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1403  return parse<bool>(i.second);
1404  }
1405  }
1406  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1407  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1408 }
1409 
1410 
1411 template<> std::string
1413  for (auto i : allowedAttributes(tag)) {
1414  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1415  return (i.second);
1416  }
1417  }
1418  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1419  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1420 }
1421 
1422 
1423 template<> SUMOVehicleClass
1425  for (auto i : allowedAttributes(tag)) {
1426  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1427  return parse<SUMOVehicleClass>(i.second);
1428  }
1429  }
1430  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1431  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1432 }
1433 
1434 
1435 template<> SUMOVehicleShape
1437  for (auto i : allowedAttributes(tag)) {
1438  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1439  return parse<SUMOVehicleShape>(i.second);
1440  }
1441  }
1442  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1443  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1444 }
1445 
1446 
1447 template<> RGBColor
1449  for (auto i : allowedAttributes(tag)) {
1450  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1451  return parse<RGBColor>(i.second);
1452  }
1453  }
1454  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1455  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1456 }
1457 
1458 
1459 template<> std::vector<int>
1461  for (auto i : allowedAttributes(tag)) {
1462  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1463  return parse<std::vector<int> >(i.second);
1464  }
1465  }
1466  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1467  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1468 }
1469 
1470 
1471 template<> std::vector<double>
1473  for (auto i : allowedAttributes(tag)) {
1474  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1475  return parse<std::vector<double> >(i.second);
1476  }
1477  }
1478  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1479  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1480 }
1481 
1482 
1483 template<> std::vector<bool>
1485  for (auto i : allowedAttributes(tag)) {
1486  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1487  return parse<std::vector<bool> >(i.second);
1488  }
1489  }
1490  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1491  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1492 }
1493 
1494 
1495 template<> std::vector<std::string>
1497  for (auto i : allowedAttributes(tag)) {
1498  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1499  return parse<std::vector<std::string> >(i.second);
1500  }
1501  }
1502  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1503  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1504 }
1505 
1506 
1507 /****************************************************************************/
1508 
static bool _str2Bool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter ...
Definition: TplConvert.h:408
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myColorAttrs
map with the color attributes
The information about how to spread the lanes from the given position.
SumoXMLTag
Numbers representing SUMO-XML - element names.
static StringBijection< SumoXMLNodeType > NodeTypes
node types
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:180
a routeprobe detector
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
description of a vehicle type
Whether vehicles must keep the junction clear.
whether a given shape is user-defined
static std::string getAttributeType(SumoXMLTag tag, SumoXMLAttr attr)
get type of attribute
GNEAttributeCarrier(SumoXMLTag tag, GUIIcon icon)
Constructor.
const SumoXMLTag myTag
the xml tag to which this attribute carrier corresponds
begin/end of the description of a junction
begin/end of the description of a single lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
a flow definition (used by router)
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::string > > myAttrDefinitions
map with the definition of attributes
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:43
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
static std::vector< SumoXMLTag > myAllowedShapeTags
vector with the allowed tags of shapes
static const std::vector< SumoXMLTag > & allowedShapeTags()
get all editable for tag shape elements
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myPositiveAttrs
map with the positive attributes
A layer number.
connectio between two lanes
Allow/disallow charge in transit in Charging Stations.
static const std::vector< SumoXMLTag > & allowedNetElementsTags()
get all editable for tag net elements
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myUniqueAttrs
map with the unique attributes (i.e. attributes without default values)
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::vector< std::string > > > myDiscreteChoices
map with the values of discrete choices
foe visibility distance of a link
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myBoolAttrs
map with the boolean attributes
static const std::string LOADED
feature is still unchanged after being loaded (implies approval)
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myProbabilityAttrs
map with the probability attributes
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
GUIIcon myIcon
icon associated to this AC
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myTimeAttrs
map with the attributes of type time
weights: time range begin
link,node: the traffic light id responsible for this link
static bool isPositive(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is only Positive (i.e. cannot take negative values)
T MAX2(T a, T b)
Definition: StdDefs.h:74
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a polygon
static std::map< SumoXMLTag, std::vector< std::pair< SumoXMLAttr, std::string > > > _allowedAttributes
map with the allowed attributes and their default values
static std::vector< SumoXMLTag > myBlockShapeTags
vector with the allowed tags that can block their shapes
static bool isValidFilename(const std::string &value)
true if value is a valid file value
first coordinate of edge shape
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
begin/end of the description of a route
an e3 entry point
static double _str2double(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
Definition: TplConvert.h:364
static std::vector< SumoXMLTag > myAllowedNetElementTags
vector with the allowed tags of netElements
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
static std::vector< SumoXMLTag > allowedTags()
get all editable for tag elements of all types
std::vector< std::string > getStrings() const
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myListAttrs
map with the attributes of type list
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
static const std::string MODIFIED
feature has been manually modified (implies approval)
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
static bool isNonEditable(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is non editable
static std::vector< SumoXMLTag > myBlockMovementTags
vector with the allowed tags that can block their movement
The turning radius at an intersection in m.
static std::vector< SumoXMLTag > myAllowedAdditionalTags
vector with the allowed tags of additionals
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if an element with certain tag has a certain attribute
static bool canBlockMovement(SumoXMLTag tag)
return true if element tag can block their movement
static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
static const double INVALID_POSITION
default value for invalid positions (used by POIs and Polygons)
static bool isColor(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type color for a certain tag
an e3 exit point
not defined
static bool isFilename(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a filename
static int _str2int(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
Definition: TplConvert.h:168
static T getDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
return the default value of the attribute of an element
node: the type of traffic light
edge: the shape in xml-definition
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const std::string getID() const
function to support debugging
virtual std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNonEditableAttrs
map with the non-editable attributes
begin/end of the description of an edge
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don&#39;t have a default valu...
static int myMaxNumAttribute
maximum number of attributes of all tags
trigger: the time of the step
FXIcon * getIcon() const
get FXIcon assigned to this object
static bool isProbability(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is a probability (i.e. oly can values between [0, 1])
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
static const std::vector< SumoXMLTag > & allowedAdditionalTags()
get all editable for tag additional elements
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in allGNEAttributeCarrier.
static const std::string APPROVED
feature has been approved but not changed (i.e. after being reguessed)
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
weights: time range end
crossing between edges for pedestrians
static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr)
return definition of a certain SumoXMLAttr
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
vaporizer of vehicles
SumoXMLTag getTag() const
get XML Tag assigned to this object
A variable speed sign.
Eficiency of the charge in Charging Stations.
static const std::string GUESSED
feature has been reguessed (may still be unchanged be we can&#39;t tell (yet)
last coordinate of edge shape
Delay in the charge of charging stations.
static bool isNumerical(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical (int or float)
#define NODEFAULTVALUE
GUIIcon getGUIIcon() const
get GUI icon assigned to this object
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalIntAttrs
map with the numerical attributes of type Int
A color information.
static T parse(const std::string &string)
parses a number of type T from string
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalFloatAttrs
map with the numerical attributes of type Float
static bool canBlockShape(SumoXMLTag tag)
return true if element tag can block their shape
Fill the polygon.
vehicles ignoring classes
static std::map< SumoXMLTag, SumoXMLTag > myAllowedAdditionalWithParentTags
map with the allowed tags of additionals with parent and their parent
static bool isList(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool
begin/end of the description of a polygon
trigger: a step description
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myFileAttrs
map with the empty attributes