SUMO - Simulation of Urban MObility
GNEAttributeCarrier.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Abstract Base class for gui objects which carry attributes
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <algorithm>
35 #include <netbuild/NBEdge.h>
36 
37 #include "GNEAttributeCarrier.h"
38 #include "GNEUndoList.h"
39 #include "GNENet.h"
40 #include "GNEEdge.h"
41 #include "GNELane.h"
42 
43 // ===========================================================================
44 // static members
45 // ===========================================================================
46 std::map<SumoXMLTag, std::vector<std::pair <SumoXMLAttr, std::string> > > GNEAttributeCarrier::_allowedAttributes;
47 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedNetElementTags;
48 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedAdditionalTags;
49 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedShapeTags;
50 std::vector<SumoXMLTag> GNEAttributeCarrier::myBlockMovementTags;
51 std::vector<SumoXMLTag> GNEAttributeCarrier::myBlockShapeTags;
52 std::vector<SumoXMLTag> GNEAttributeCarrier::myDialogTags;
53 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNumericalIntAttrs;
54 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNumericalFloatAttrs;
55 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myTimeAttrs;
56 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myBoolAttrs;
57 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myColorAttrs;
58 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myListAttrs;
59 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myUniqueAttrs;
60 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNonEditableAttrs;
61 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myPositiveAttrs;
62 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myProbabilityAttrs;
63 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myFileAttrs;
64 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myVClassAttrs;
65 std::map<SumoXMLTag, SumoXMLTag> GNEAttributeCarrier::myAllowedAdditionalWithParentTags;
66 std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > > GNEAttributeCarrier::myDiscreteChoices;
67 std::map<SumoXMLTag, std::map<SumoXMLAttr, std::string > > GNEAttributeCarrier::myAttrDefinitions;
69 
70 const std::string GNEAttributeCarrier::LOADED = "loaded";
71 const std::string GNEAttributeCarrier::GUESSED = "guessed";
72 const std::string GNEAttributeCarrier::MODIFIED = "modified";
73 const std::string GNEAttributeCarrier::APPROVED = "approved";
74 const double GNEAttributeCarrier::INVALID_POSITION = -1000000;
75 
76 #define NODEFAULTVALUE "<NODEFAULTVALUE>"
77 
78 // ===========================================================================
79 // method definitions
80 // ===========================================================================
82  myTag(tag),
83  myIcon(icon) {
84 }
85 
86 
87 template<> int
88 GNEAttributeCarrier::parse(const std::string& string) {
89  return TplConvert::_str2int(string);
90 }
91 
92 
93 template<> double
94 GNEAttributeCarrier::parse(const std::string& string) {
95  return TplConvert::_str2double(string);
96 }
97 
98 
99 template<> bool
100 GNEAttributeCarrier::parse(const std::string& string) {
101  return TplConvert::_str2Bool(string);
102 }
103 
104 
105 template<> std::string
106 GNEAttributeCarrier::parse(const std::string& string) {
107  return string;
108 }
109 
110 
111 template<> SUMOVehicleClass
112 GNEAttributeCarrier::parse(const std::string& string) {
113  if (string.size() == 0) {
114  throw EmptyData();
115  } else if (SumoVehicleClassStrings.hasString(string) == false) {
116  return SVC_IGNORING;
117  } else {
118  return SumoVehicleClassStrings.get(string);
119  }
120 }
121 
122 
123 template<> RGBColor
124 GNEAttributeCarrier::parse(const std::string& string) {
125  return RGBColor::parseColor(string);
126 }
127 
128 
129 template<> SUMOVehicleShape
130 GNEAttributeCarrier::parse(const std::string& string) {
131  if (string.size() == 0) {
132  throw EmptyData();
133  } else if ((string == "unknown") || (SumoVehicleShapeStrings.hasString(string) == false)) {
134  return SVS_UNKNOWN;
135  } else {
136  return SumoVehicleShapeStrings.get(string);
137  }
138 }
139 
140 
141 template<> std::vector<std::string>
142 GNEAttributeCarrier::parse(const std::string& string) {
143  std::vector<std::string> parsedValues;
144  SUMOSAXAttributes::parseStringVector(string, parsedValues);
145  return parsedValues;
146 }
147 
148 
149 template<> std::vector<int>
150 GNEAttributeCarrier::parse(const std::string& string) {
151  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
152  std::vector<int> parsedIntValues;
153  for (auto i : parsedValues) {
154  parsedIntValues.push_back(parse<int>(i));
155  }
156  return parsedIntValues;
157 }
158 
159 
160 template<> std::vector<double>
161 GNEAttributeCarrier::parse(const std::string& string) {
162  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
163  std::vector<double> parsedDoubleValues;
164  for (auto i : parsedValues) {
165  parsedDoubleValues.push_back(parse<double>(i));
166  }
167  return parsedDoubleValues;
168 }
169 
170 
171 template<> std::vector<bool>
172 GNEAttributeCarrier::parse(const std::string& string) {
173  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
174  std::vector<bool> parsedBoolValues;
175  for (auto i : parsedValues) {
176  parsedBoolValues.push_back(parse<bool>(i));
177  }
178  return parsedBoolValues;
179 }
180 
181 
182 std::string
184  return getAttribute(key);
185 }
186 
187 
190  return myTag;
191 }
192 
193 
194 FXIcon*
197 }
198 
199 
200 GUIIcon
202  return myIcon;
203 }
204 
205 
206 const GUIGlObject*
208  const GUIGlObject* GLObject = dynamic_cast<const GUIGlObject*>(this);
209  // Make sure that casting was sucesfully
210  if (GLObject) {
211  return GLObject;
212  } else {
213  throw ProcessError("Current Attribute Carrier doesn't have a associated const GUIGlObject");
214  }
215 }
216 
217 
220  GUIGlObject* GLObject = dynamic_cast<GUIGlObject*>(this);
221  // Make sure that casting was sucesfully
222  if (GLObject) {
223  return GLObject;
224  } else {
225  throw ProcessError("Current Attribute Carrier doesn't have a associated GUIGlObject");
226  }
227 }
228 
229 
230 std::vector<SumoXMLAttr>
232  std::vector<SumoXMLAttr> attr;
233  for (auto i : allowedAttributes(myTag)) {
234  attr.push_back(i.first);
235  }
236  return attr;
237 }
238 
239 
240 const std::string
242  return getAttribute(SUMO_ATTR_ID);
243 }
244 
245 
246 std::string
248  if (isInt(tag, attr)) {
249  return "int";
250  } else if (isFloat(tag, attr)) {
251  return "float";
252  } else if (isTime(tag, attr)) {
253  return "time";
254  } else if (isBool(tag, attr)) {
255  return "bool";
256  } else if (isColor(tag, attr)) {
257  return "color";
258  } else if (isString(tag, attr)) {
259  return "string";
260  } else if (isList(tag, attr)) {
261  return "list";
262  } else {
263  throw ProcessError("Undeterminted type for '" + toString(tag) + "' '" + toString(attr) + "'");
264  }
265 }
266 
267 
268 bool
269 GNEAttributeCarrier::isValidID(const std::string& value) {
270  return value.find_first_of(" \t\n\r@$%^&/|\\{}*'\";:<>") == std::string::npos;
271 }
272 
273 
274 bool
275 GNEAttributeCarrier::isValidFilename(const std::string& value) {
276  // @note Only characteres that aren't permited in a file path or belong
277  // to XML sintax
278  return (value.find_first_of("\t\n\r@$%^&|\\{}*'\";:<>") == std::string::npos);
279 }
280 
281 
282 // ===========================================================================
283 // static methods
284 // ===========================================================================
285 
286 const std::vector<std::pair <SumoXMLAttr, std::string> >&
288  // define on first access
289  if (!_allowedAttributes.count(tag)) {
290  std::vector<std::pair<SumoXMLAttr, std::string> >& attrs = _allowedAttributes[tag];
291  switch (tag) {
292  case SUMO_TAG_EDGE:
293  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
294  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM, NODEFAULTVALUE));
295  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO, NODEFAULTVALUE));
296  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "13.89"));
297  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PRIORITY, "1"));
298  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NUMLANES, "1"));
299  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
300  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
301  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
302  //attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PREFER, ));
303  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, ""));
304  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, NODEFAULTVALUE));
305  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPREADTYPE, "right"));
306  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
307  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "default"));
308  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDOFFSET, "0"));
309  attrs.push_back(std::pair<SumoXMLAttr, std::string>(GNE_ATTR_SHAPE_START, "")); // virtual attribute used to define an endPoint
310  attrs.push_back(std::pair<SumoXMLAttr, std::string>(GNE_ATTR_SHAPE_END, "")); // virtual attribute from to define an endPoint
311  break;
312  case SUMO_TAG_JUNCTION:
313  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
314  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
315  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
316  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, ""));
317  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_RADIUS, "1.5"));
318  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_KEEP_CLEAR, "true"));
319  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLTYPE, ""));
320  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLID, ""));
321  break;
322  case SUMO_TAG_LANE:
323  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
324  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "13.89"));
325  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
326  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
327  //attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PREFER, ));
328  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "default"));
329  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDOFFSET, "0"));
330  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ACCELERATION, "false"));
331  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CUSTOMSHAPE, ""));
332  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_INDEX, NODEFAULTVALUE));
333  break;
334  case SUMO_TAG_POI:
335  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
336  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
337  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "red"));
338  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
339  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LAYER, "3")); // needed to draw it over lane
340  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "0"));
341  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HEIGHT, "0"));
342  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
343  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ANGLE, "0"));
344  break;
345  case SUMO_TAG_POILANE:
346  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
347  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
348  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
349  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION_LAT, "0"));
350  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "red"));
351  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
352  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LAYER, "3")); // needed to draw it over lane
353  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "0"));
354  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HEIGHT, "0"));
355  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
356  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ANGLE, "0"));
357  break;
358  case SUMO_TAG_POLY:
359  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
360  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, NODEFAULTVALUE));
361  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "green"));
362  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILL, "false"));
363  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LAYER, "0"));
364  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
365  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
366  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ANGLE, "0"));
367  break;
368  case SUMO_TAG_CROSSING:
369  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
370  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
371  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PRIORITY, "false"));
372  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, toString(OptionsCont::getOptions().getFloat("default.crossing-width"))));
373  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLLINKINDEX, "-1"));
374  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CUSTOMSHAPE, ""));
375  break;
376  case SUMO_TAG_CONNECTION:
377  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM, NODEFAULTVALUE));
378  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO, NODEFAULTVALUE));
379  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM_LANE, NODEFAULTVALUE));
380  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO_LANE, NODEFAULTVALUE));
381  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PASS, "false"));
382  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_KEEP_CLEAR, "false"));
383  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTPOS, toString(NBEdge::UNSPECIFIED_CONTPOS)));
384  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_UNCONTROLLED, "false"));
385  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VISIBILITY_DISTANCE, toString(NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE)));
386  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLLINKINDEX, "-1"));
387  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, toString(NBEdge::UNSPECIFIED_SPEED)));
388  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CUSTOMSHAPE, ""));
389  break;
390  case SUMO_TAG_BUS_STOP:
391  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
392  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
393  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
394  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
395  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
396  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
397  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINES, ""));
398  break;
400  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
401  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
402  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
403  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
404  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
405  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
406  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINES, ""));
407  break;
409  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
410  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
411  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
412  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
413  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
414  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
415  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGINGPOWER, "22000"));
416  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EFFICIENCY, "0.95"));
417  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGEINTRANSIT, "false"));
418  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGEDELAY, "0"));
419  break;
420  case SUMO_TAG_E1DETECTOR:
421  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
422  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
423  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
424  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
425  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
426  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VTYPES, ""));
427  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
428  break;
429  case SUMO_TAG_E2DETECTOR:
430  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
431  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
432  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
433  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, "10"));
434  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
435  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
436  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONT, "false"));
437  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "1"));
438  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_SPEED_THRESHOLD, "1.39"));
439  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_JAM_DIST_THRESHOLD, "10"));
440  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
441  break;
442  case SUMO_TAG_E3DETECTOR:
443  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
444  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_X, "0"));
445  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_Y, "0"));
446  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
447  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
448  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "1"));
449  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_SPEED_THRESHOLD, "1.39"));
450  break;
451  case SUMO_TAG_DET_ENTRY:
452  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
453  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
454  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
455  break;
456  case SUMO_TAG_DET_EXIT:
457  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
458  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
459  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FRIENDLY_POS, "false"));
460  break;
461  case SUMO_TAG_VSS:
462  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
463  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANES, ""));
464  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
465  break;
466  case SUMO_TAG_CALIBRATOR:
467  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
468  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
469  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, "0"));
470  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
471  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTEPROBE, ""));
472  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OUTPUT, ""));
473  break;
475  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
476  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
477  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, "0"));
478  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
479  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTEPROBE, ""));
480  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OUTPUT, ""));
481  break;
482  case SUMO_TAG_REROUTER:
483  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
484  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
485  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
486  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "1"));
487  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "0"));
488  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OFF, "false"));
489  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, "0,0"));
490  break;
491  case SUMO_TAG_ROUTEPROBE:
492  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
493  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
494  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
495  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
496  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, "0"));
497  break;
498  case SUMO_TAG_VAPORIZER:
499  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
500  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTTIME, "0"));
501  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, "10"));
502  break;
503  case SUMO_TAG_FLOW:
504  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
505  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, NODEFAULTVALUE));
506  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTE, NODEFAULTVALUE));
507  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "black"));
508  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, "0"));
509  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, "100"));
510  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VEHSPERHOUR, "10"));
511  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERIOD, "10"));
512  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "1"));
513  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NUMBER, "100"));
514  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTLANE, "first"));
515  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTPOS, "base"));
516  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTSPEED, "0"));
517  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALLANE, "current"));
518  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALPOS, "max"));
519  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALSPEED, "current"));
520  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINE, ""));
521  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERSON_NUMBER, "0"));
522  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTAINER_NUMBER, "0"));
523  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_REROUTE, "false"));
524  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTPOS_LAT, "center"));
525  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALPOS_LAT, ""));
526  break;
527  case SUMO_TAG_ROUTE:
528  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
529  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, ""));
530  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "black"));
531  break;
532  case SUMO_TAG_VTYPE:
533  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
534  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ACCEL, "2.6"));
535  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DECEL, "4.5"));
536  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SIGMA, "0.5"));
537  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TAU, "1.0"));
538  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, "5.0"));
539  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MINGAP, "2.5"));
540  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MAXSPEED, "70.0"));
541  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEEDFACTOR, "1.0"));
542  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEEDDEV, "0.0"));
543  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "1,1,0"));
544  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VCLASS, "passenger"));
545  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EMISSIONCLASS, "P_7_7"));
546  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_GUISHAPE, "passenger"));
547  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "2.0"));
548  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
549  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMPATIENCE, "0.0"));
550  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE_CHANGE_MODEL, "LC2013"));
551  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CAR_FOLLOW_MODEL, "Krauss"));
552  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERSON_CAPACITY, "4"));
553  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTAINER_CAPACITY, "0"));
554  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BOARDING_DURATION, "0.5"));
555  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LOADING_DURATION, "90.0"));
556  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LATALIGNMENT, "center"));
557  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MINGAP_LAT, "0.12"));
558  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MAXSPEED_LAT, "1.0"));
559  break;
560  case SUMO_TAG_STEP:
561  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TIME, NODEFAULTVALUE));
562  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "50.0"));
563  break;
564  case SUMO_TAG_INTERVAL:
565  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, "0"));
566  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, "100"));
567  break;
569  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
570  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
571  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
572  break;
574  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
575  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
576  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
577  break;
579  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
580  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "0"));
581  break;
583  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
584  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "0"));
585  break;
586  default:
587  // Throw exception if tag isn't defined
588  throw ProcessError("allowed attributes for tag '" + toString(tag) + "' not defined");
589  }
590  }
591  return _allowedAttributes[tag];
592 }
593 
594 
595 std::vector<SumoXMLTag>
597  std::vector<SumoXMLTag> tags;
598  // append all net elements to tags
599  tags.insert(std::end(tags), std::begin(allowedNetElementsTags()), std::end(allowedNetElementsTags()));
600  tags.insert(std::end(tags), std::begin(allowedAdditionalTags()), std::end(allowedAdditionalTags()));
601  tags.insert(std::end(tags), std::begin(allowedShapeTags()), std::end(allowedShapeTags()));
602  return tags;
603 }
604 
605 
606 const std::vector<SumoXMLTag>&
608  // define on first access
609  if (myAllowedNetElementTags.empty()) {
615  }
617 }
618 
619 
620 const std::vector<SumoXMLTag>&
622  // define on first access
623  if (myAllowedAdditionalTags.empty()) {
638  }
640 }
641 
642 
643 const std::vector<SumoXMLTag>&
645  // define on first access
646  if (myAllowedShapeTags.empty()) {
648  myAllowedShapeTags.push_back(SUMO_TAG_POI);
650  }
651  return myAllowedShapeTags;
652 }
653 
654 
655 bool
657  // define on first access
658  if (myBlockMovementTags.empty()) {
672  }
673  return std::find(myBlockMovementTags.begin(), myBlockMovementTags.end(), tag) != myBlockMovementTags.end();
674 }
675 
676 
677 bool
679  // define on first access
680  if (myBlockShapeTags.empty()) {
681  myBlockShapeTags.push_back(SUMO_TAG_POLY);
682  }
683  return std::find(myBlockShapeTags.begin(), myBlockShapeTags.end(), tag) != myBlockShapeTags.end();
684 }
685 
686 
687 bool
689  // define on first access
690  if (myDialogTags.empty()) {
693  myDialogTags.push_back(SUMO_TAG_REROUTER);
694  myDialogTags.push_back(SUMO_TAG_VSS);
695  }
696  return std::find(myDialogTags.begin(), myDialogTags.end(), tag) != myDialogTags.end();
697 }
698 
699 
700 bool
702  return (isInt(tag, attr) || isFloat(tag, attr));
703 }
704 
705 
706 bool
708  // define on first access
709  if (myNumericalIntAttrs.empty()) {
710  // connection
714  // edge
717  // lane
719  // crossing
721  // flow
726  // vehicle type
729  // POI
731  // POILane
733  // Layer
735  }
736  return myNumericalIntAttrs[tag].count(attr) == 1;
737 }
738 
739 
740 bool
742  // define on first access
743  if (myNumericalFloatAttrs.empty()) {
744  // bus stop
747  // charging station
752  // connection
756  // container stop
759  // crossing
761  // E1
763  // E2
768  // E3
772  // Entry
774  // Exit
776  // Edge
780  // Junction
782  // Lane
785  // Rerouter
788  // Calibrator (edge)
790  // Calibrator (lane
792  // vehicle type
806  // flow
810  // step
812  // POLY
814  // POI
818  // POILane
824  }
825  return myNumericalFloatAttrs[tag].count(attr) == 1;
826 }
827 
828 
829 bool
831  // define on first access
832  if (myTimeAttrs.empty()) {
833  // calibrator (edge)
835  // calibrator (lane)
837  // charging station
839  // E1
841  // E2
844  // E3
847  // RouteProbe
850  // Vaporizer
853  // Vehicle type
856  // Flow
859  // step
861  }
862  return myTimeAttrs[tag].count(attr) == 1;
863 }
864 
865 
866 bool
868  // define on first access
869  if (myBoolAttrs.empty()) {
870  // bus stop
872  // container stop
874  // charging station
877  // lane
879  // connection
882  // crossing
884  // E1
886  // E2
889  // Entry
891  // Exit
893  // junction
895  // rerouter
897  // flow
899  // Poly
902  // POI
904  }
905  return myBoolAttrs[tag].count(attr) == 1;
906 }
907 
908 
909 bool
911  // define on first access
912  if (myColorAttrs.empty()) {
913  // POI
915  // POILane
917  // Poly
919  // Route
921  // Color
923  }
924  return myColorAttrs[tag].count(attr) == 1;
925 }
926 
927 
928 bool
930  return (!isNumerical(tag, attr) && !isBool(tag, attr) && !isTime(tag, attr));
931 }
932 
933 
934 bool
936  // define on first access
937  if (myListAttrs.empty()) {
938  // bus stop
940  // container stop
942  // crossing
944  // rerouter
946  // variable speed signal
948  // route
950  // POLY
952  }
953  return myListAttrs[tag].count(attr) == 1;
954 }
955 
956 
957 bool
959  // ID is an atribute that always is unique
960  if (attr == SUMO_ATTR_ID) {
961  return true;
962  } else {
963  // define on first access
964  if (myUniqueAttrs.empty()) {
965  // connection
969  // edge
972  // busstop
976  // calibrator (edge)
978  // calibrator (lane)
980  // charging station
984  // connection
987  // container stop
991  // crossing
994  // det entry
997  // det exit
1000  // E1
1004  // E2
1008  // E3
1012  // Edge
1014  // Junction
1018  // Rerouter
1021  // Routeprobe
1024  // Vaporizer
1027  // VSS
1029  // POI
1032  // POILane
1035  // POLY
1038  }
1039  return myUniqueAttrs[tag].count(attr) == 1;
1040  }
1041 }
1042 
1043 
1044 bool
1046  if (discreteChoices(tag, attr).size() > 0) {
1047  return true;
1048  } else {
1049  return false;
1050  }
1051 }
1052 
1053 
1054 bool
1056  // define on first access
1057  if (myPositiveAttrs.empty()) {
1058  // edge
1065  // junction
1067  // lane
1071  // crossing
1073  // connection
1077  // charging station
1081  // E2
1086  // calibrator (edge)
1088  // calibrator (lane)
1090  // flow
1096  // vehicle type
1111  // POI
1114  // POILane
1116  }
1117  return myPositiveAttrs[tag].count(attr) == 1;
1118 }
1119 
1120 
1121 bool
1123  // define on first access
1124  if (myProbabilityAttrs.empty()) {
1125  // charging station
1127  // rerouter
1129  // flow
1131  // destiny probability reroute
1133  // route prob reroute
1135  }
1136  return myProbabilityAttrs[tag].count(attr) == 1;
1137 }
1138 
1139 
1140 bool
1142  // define on first access
1143  if (myFileAttrs.empty()) {
1144  // E1
1146  // E2
1148  // E3
1150  // calibrator (edge)
1152  // calibrator (lane)
1154  // rerouter
1156  // routeprobe
1158  // Variable Speed Signal
1160  // POI
1162  // POILane
1164  // POLY
1166  }
1167  return myFileAttrs[tag].count(attr) == 1;
1168 }
1169 
1170 
1171 bool
1173  // define on first access
1174  if (myVClassAttrs.empty()) {
1175  // Edge
1178  // Lane
1181  // Closing Reroute
1184  // Closing Lane Reroute
1187  }
1188  return myVClassAttrs[tag].count(attr) == 1;
1189 }
1190 
1191 
1192 bool
1194  // define on first access
1195  if (myNonEditableAttrs.empty()) {
1196  // connection
1201  // crossing
1203  // lane
1205  }
1206  return myNonEditableAttrs[tag].count(attr) == 1;
1207 }
1208 
1209 
1210 bool
1212  for (auto i : allowedAttributes(tag)) {
1213  if (i.first == attr) {
1214  return true;
1215  }
1216  }
1217  return false;
1218 }
1219 
1220 
1221 bool
1223  for (auto i : allowedAttributes(tag)) {
1224  if (i.first == attr) {
1225  return (i.second != NODEFAULTVALUE);
1226  }
1227  }
1228  throw ProcessError("Attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' not defined");
1229 }
1230 
1231 
1232 const std::vector<std::string>&
1234  // define on first access
1235  if (myDiscreteChoices.empty()) {
1236  std::vector<std::string> choices;
1237  // Get type of nodes
1239  for (auto it : choices) {
1241  // junction
1243  }
1244  }
1245  // Get types of traffic lights
1247  for (auto it : choices) {
1248  if (it != toString(TLTYPE_INVALID)) {
1249  // junction
1251  }
1252  }
1253  // get type of lane spread functions
1255  for (auto it : choices) {
1256  // edge
1258  }
1259  // get vehicle types
1260  choices = SumoVehicleClassStrings.getStrings();
1261  for (auto it : choices) {
1262  // edge
1265  // lane
1268  // vehicle type
1270  }
1271  // get vehicle shapes
1272  choices = SumoVehicleShapeStrings.getStrings();
1273  for (auto it : choices) {
1274  // vehicle type
1276  }
1277  // lat alignments of vehicle types
1283  myDiscreteChoices[SUMO_TAG_VTYPE][SUMO_ATTR_LATALIGNMENT].push_back("arbitrary");
1284  }
1285  return myDiscreteChoices[tag][attr];
1286 }
1287 
1288 
1289 bool
1291  return (attr == SUMO_ATTR_ALLOW || attr == SUMO_ATTR_DISALLOW);
1292 }
1293 
1294 
1295 std::string
1297  // define on first access
1298  if (myAttrDefinitions.empty()) {
1299  // Edge
1300  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ID] = "The id of the edge (must be unique).";
1301  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_FROM] = "The name of a node within the nodes-file the edge shall start at.";
1302  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_TO] = "The name of a node within the nodes-file the edge shall end at.";
1303  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SPEED] = "The maximum speed allowed on the edge in m/s.";
1304  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_PRIORITY] = "The priority of the edge.";
1305  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_NUMLANES] = "The number of lanes of the edge.";
1306  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_TYPE] = "The name of a type within the SUMO edge type file";
1307  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ALLOW] = "Explicitly allows the given vehicle classes (not given will be not allowed).";
1308  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_DISALLOW] = "Explicitly disallows the given vehicle classes (not given will be allowed).";
1309  //myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_PREFER] = "";
1310  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.";
1311  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_LENGTH] = "The length of the edge in meter";
1312  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SPREADTYPE] = "Lane width for all lanes of this edge in meters (used for visualization).";
1313  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_NAME] = "street name (need not be unique, used for visualization).";
1314  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_WIDTH] = "Lane width for all lanes of this edge in meters (used for visualization).";
1315  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ENDOFFSET] = "Move the stop line back from the intersection by the given amount.";
1316  // Junction
1317  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_ID] = "The name of the node (Must be unique).";
1318  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_POSITION] = "The x-y-z position of the node on the plane in meters.";
1319  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TYPE] = "An optional type for the node.";
1320  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_SHAPE] = "A custom shape for that node.";
1321  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_RADIUS] = "Optional turning radius (for all corners) for that node in meters.";
1322  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_KEEP_CLEAR] = "Whether the junction-blocking-heuristic should be activated at this node.";
1323  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TLTYPE] = "An optional type for the traffic light algorithm.";
1324  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TLID] = "An optional id for the traffic light program.";
1325  // Lane
1326  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ID] = "ID of lane (Automatic)";
1327  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_SPEED] = "Speed in meters per second";
1328  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ALLOW] = "Explicitly allows the given vehicle classes (not given will be not allowed).";
1329  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_DISALLOW] = "Explicitly disallows the given vehicle classes (not given will be allowed).";
1330  //myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_PREFER] = "";
1331  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_WIDTH] = "Width in meters (used for visualization).";
1332  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ENDOFFSET] = "Move the stop line back from the intersection by the given amount.";
1333  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).";
1334  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_CUSTOMSHAPE] = "If the shape is given it overrides the computation based on edge shape.";
1335  // POI
1336  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_ID] = "The id (a unique name) of the POI";
1337  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_COLOR] = "The color with which the poi shall be displayed";
1338  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_POSITION] = "The position in view";
1339  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_GEOPOSITION] = "The position in view in GEO coordinates";
1340  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_TYPE] = "A typename for the poi";
1341  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_LAYER] = "The layer of the poi for drawing and selecting";
1342  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_IMGFILE] = "A bitmap to use for rendering this poi";
1343  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_WIDTH] = "Width of rendered image in meters";
1344  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_HEIGHT] = "Height of rendered image in meters";
1345  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_ANGLE] = "Angle of rendered image in degree";
1346  // POILane
1347  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_ID] = "The id (a unique name) of the POI";
1348  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_COLOR] = "The color with which the poi shall be displayed";
1349  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_LANE] = "The name of the lane the poi is located at; the lane must be a part of the loaded network";
1350  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_POSITION] = "The position on the named lane or in the net in meters at which the poi is located at";
1351  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_POSITION_LAT] = "The lateral offset on the named lane at which the poi is located at";
1352  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_TYPE] = "A typename for the poi";
1353  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_LAYER] = "The layer of the poi for drawing and selecting";
1354  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_IMGFILE] = "A bitmap to use for rendering this poi";
1355  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_WIDTH] = "Width of rendered image in meters";
1356  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_HEIGHT] = "Height of rendered image in meters";
1357  myAttrDefinitions[SUMO_TAG_POILANE][SUMO_ATTR_ANGLE] = "Angle of rendered image in degree";
1358  // Polygon
1359  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_ID] = "The id (a unique name) of the polygon";
1360  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_COLOR] = "The RGBA color with which the polygon shall be displayed";
1361  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_SHAPE] = "The shape of the polygon";
1362  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_GEOSHAPE] = "The shape of the polygon in GEO format";
1363  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_GEO] = "Enable or disable save shape in GEO format";
1364  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_FILL] = "An information whether the polygon shall be filled";
1365  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_LAYER] = "The layer in which the polygon lies";
1366  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_TYPE] = "A typename for the polygon";
1367  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_IMGFILE] = "A bitmap to use for rendering this polygon";
1368  myAttrDefinitions[SUMO_TAG_POLY][SUMO_ATTR_ANGLE] = "Angle of rendered image in degree";
1369  // Crossing
1370  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_ID] = "ID (Automatic)";
1371  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_PRIORITY] = "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections).";
1372  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_WIDTH] = "The width of the crossings.";
1373  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_EDGES] = "The (road) edges which are crossed.";
1374  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TLLINKINDEX] = "sets the tls-index for this crossing.";
1375  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_CUSTOMSHAPE] = "Overrids default shape of pedestrian crossing.";
1376  // Connection
1377  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_FROM] = "The name of the edge the vehicles leave ";
1378  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TO] = "The name of the edge the vehicles may reach when leaving 'from'";
1379  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_FROM_LANE] = "the lane index of the incoming lane (numbers starting with 0)";
1380  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TO_LANE] = "the lane index of the outgoing lane (numbers starting with 0)";
1381  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_PASS] = "if set, vehicles which pass this (lane-2-lane) connection) will not wait";
1382  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.";
1383  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.";
1384  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_UNCONTROLLED] = "If set to true, This connection will not be TLS-controlled despite its node being controlled.";
1385  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_VISIBILITY_DISTANCE] = "sets the distance to the connection at which all relevant foes are visible.";
1386  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TLLINKINDEX] = "sets the tls-index for this connection.";
1387  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_SPEED] = "sets custom speed limit for the connection.";
1388  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_CUSTOMSHAPE] = "sets custom shape for the connection.";
1389  // Bus Stop
1390  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_ID] = "ID (Must be unique)";
1391  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_LANE] = "The name of the lane the bus stop shall be located at";
1392  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_STARTPOS] = "The begin position on the lane (the lower position on the lane) in meters";
1393  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";
1394  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_NAME] = "Name of busStop";
1395  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";
1396  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";
1397  // container Stop
1398  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_ID] = "ID (Must be unique)";
1399  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_LANE] = "The name of the lane the container stop shall be located at";
1400  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_STARTPOS] = "The begin position on the lane (the lower position on the lane) in meters";
1401  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";
1403  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";
1404  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";
1405  // Charging Station
1406  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_ID] = "ID (Must be unique)";
1407  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_LANE] = "Lane of the charging station location";
1408  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_STARTPOS] = "Begin position in the specified lane";
1409  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_ENDPOS] = "End position in the specified lane";
1412  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_EFFICIENCY] = "Charging efficiency [0,1]";
1413  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";
1414  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";
1415  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";
1416  // E1
1417  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1418  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";
1419  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";
1420  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1421  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1422  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_VTYPES] = "Space separated list of vehicle type ids to consider";
1423  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";
1424  // E2
1425  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1426  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";
1427  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1428  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_LENGTH] = "The length of the detector in meters";
1429  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1430  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1431  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";
1432  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";
1433  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";
1434  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";
1435  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";
1436  // E3
1437  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1438  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1439  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1440  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";
1441  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";
1442  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_X] = "X position in editor (Only used in netedit)";
1443  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_Y] = "Y position in editor (Only used in netedit)";
1444  // Entry
1445  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";
1446  myAttrDefinitions[SUMO_TAG_DET_ENTRY][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1447  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";
1448  // Exit
1449  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";
1450  myAttrDefinitions[SUMO_TAG_DET_EXIT][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1451  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";
1452  // Variable Speed Signal
1453  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_ID] = "ID (Must be unique)";
1454  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_LANES] = "list of lanes of Variable Speed Sign";
1455  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_FILE] = "The path to the output file";
1456  // Calibrator
1457  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1458  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_EDGE] = "The id of edge in the simulation network";
1459  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_POSITION] = "The position of the calibrator on the specified lane";
1460  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_FREQUENCY] = "The aggregation interval in which to calibrate the flows. default is step-length";
1461  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_ROUTEPROBE] = "The id of the routeProbe element from which to determine the route distribution for generated vehicles";
1462  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_OUTPUT] = "The output file for writing calibrator information or NULL";
1463  // LaneCalibrator
1464  myAttrDefinitions[SUMO_TAG_LANECALIBRATOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1465  myAttrDefinitions[SUMO_TAG_LANECALIBRATOR][SUMO_ATTR_LANE] = "The id of lane in the simulation network";
1466  myAttrDefinitions[SUMO_TAG_LANECALIBRATOR][SUMO_ATTR_POSITION] = "The position of the calibrator on the specified lane";
1467  myAttrDefinitions[SUMO_TAG_LANECALIBRATOR][SUMO_ATTR_FREQUENCY] = "The aggregation interval in which to calibrate the flows. default is step-length";
1468  myAttrDefinitions[SUMO_TAG_LANECALIBRATOR][SUMO_ATTR_ROUTEPROBE] = "The id of the routeProbe element from which to determine the route distribution for generated vehicles";
1469  myAttrDefinitions[SUMO_TAG_LANECALIBRATOR][SUMO_ATTR_OUTPUT] = "The output file for writing calibrator information or NULL";
1470  // Rerouter
1471  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_ID] = "ID (Must be unique)";
1472  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_EDGES] = "An edge id or a list of edge ids where vehicles shall be rerouted";
1473  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_FILE] = "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)";
1474  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_PROB] = "The probability for vehicle rerouting (0-1), default 1";
1475  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_HALTING_TIME_THRESHOLD] = "The waiting time threshold (in s) that must be reached to activate rerouting (default -1 which disables the threshold)";
1476  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_OFF] = "Whether the router should be inactive initially (and switched on in the gui), default:false";
1477  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_POSITION] = "X,Y position in editor (Only used in netedit)";
1478  // route probe
1479  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_ID] = "ID (Must be unique)";
1480  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_EDGE] = "The id of an edge in the simulation network";
1481  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_FREQUENCY] = "The frequency in which to report the distribution";
1482  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_FILE] = "The file for generated output";
1483  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_BEGIN] = "The time at which to start generating output";
1484  // flow
1485  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ID] = "The name of the vehicle (Must be unique)";
1486  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_TYPE] = "The id of the vehicle type to use for this vehicle.";
1487  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ROUTE] = "The id of the route the vehicle shall drive along";
1488  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_BEGIN] = "First vehicle departure time";
1489  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_END] = "End of departure interval";
1490  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_VEHSPERHOUR] = "Number of vehicles per hour, equally spaced (not together with period or probability)";
1491  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PERIOD] = "Insert equally spaced vehicles at that period (not together with vehsPerHour or probability)";
1492  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PROB] = "Probability for emitting a vehicle each second (not together with vehsPerHour or period)";
1493  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_NUMBER] = "Total number of vehicles, equally spaced";
1494  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTLANE] = "The lane on which the vehicle shall be inserted";
1495  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTPOS] = "The position at which the vehicle shall enter the net";
1496  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTSPEED] = "The speed with which the vehicle shall enter the network";
1497  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALLANE] = "The lane at which the vehicle shall leave the network";
1498  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALPOS] = "The position at which the vehicle shall leave the network";
1499  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALSPEED] = "The speed with which the vehicle shall leave the network";
1500  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";
1501  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PERSON_NUMBER] = "The number of occupied seats when the vehicle is inserted";
1502  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_CONTAINER_NUMBER] = "The number of occupied container places when the vehicle is inserted";
1503  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_REROUTE] = " Whether the vehicle should be equipped with a rerouting device";
1504  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTPOS_LAT] = "The lateral position on the departure lane at which the vehicle shall enter the net";
1505  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALPOS_LAT] = "The lateral position on the arrival lane at which the vehicle shall arrive";
1506  // route
1507  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_ID] = "The name of the route (Must be unique)";
1508  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_EDGES] = "The edges the vehicle shall drive along, given as their ids, separated using spaces";
1509  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_COLOR] = "This route's color";
1510  // vehicle type
1511  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_ID] = "The name of the vehicle type (Must be unique)";
1512  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_ACCEL] = "The acceleration ability of vehicles of this type [m/s^2]";
1513  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_DECEL] = "The deceleration ability of vehicles of this type [m/s^2]";
1514  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SIGMA] = "Car-following model parameter";
1515  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_TAU] = "Car-following model parameter";
1516  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LENGTH] = "The vehicle's netto-length (length) [m]";
1517  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MINGAP] = "Empty space after leader [m]";
1518  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MAXSPEED] = "The vehicle's maximum velocity [m/s]";
1519  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SPEEDFACTOR] = "The vehicles expected multiplicator for lane speed limits";
1520  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SPEEDDEV] = "The deviation of the speedFactor";
1521  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_COLOR] = "This vehicle type's color";
1522  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_VCLASS] = "An abstract vehicle class";
1523  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_EMISSIONCLASS] = "An abstract emission class";
1524  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_GUISHAPE] = "How this vehicle is rendered";
1525  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_WIDTH] = "The vehicle's width [m] (only used for drawing)";
1526  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_IMGFILE] = "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)";
1527  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_IMPATIENCE] = "Willingess of drivers to impede vehicles with higher priority";
1528  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LANE_CHANGE_MODEL] = "The model used for changing lanes";
1529  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_CAR_FOLLOW_MODEL] = "The model used for car following";
1530  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_PERSON_CAPACITY] = "The number of persons (excluding an autonomous driver) the vehicle can transport";
1531  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_CONTAINER_CAPACITY] = "The number of containers the vehicle can transport";
1532  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_BOARDING_DURATION] = "The time required by a person to board the vehicle";
1533  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LOADING_DURATION] = "The time required to load a container onto the vehicle";
1534  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LATALIGNMENT] = "The preferred lateral alignment when using the sublane-model";
1535  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MINGAP_LAT] = "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model";
1536  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MAXSPEED_LAT] = "The maximum lateral speed when using the sublane-model";
1537  // step
1540  // interval
1543  // closing reroute
1547  // closing lane reroute
1551  // destiny probability reroute
1554  // route probability reroute
1557  }
1558  return myAttrDefinitions[tag][attr];
1559 }
1560 
1561 
1562 int
1564  if (myMaxNumAttribute == 0) {
1565  for (auto i : allowedNetElementsTags()) {
1567  }
1568  for (auto i : allowedAdditionalTags()) {
1570  }
1571  for (auto i : allowedShapeTags()) {
1573  }
1574  }
1575  return myMaxNumAttribute;
1576 }
1577 
1578 
1579 template<> int
1581  for (auto i : allowedAttributes(tag)) {
1582  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1583  return parse<int>(i.second);
1584  }
1585  }
1586  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1587  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1588 }
1589 
1590 
1591 template<> double
1593  for (auto i : allowedAttributes(tag)) {
1594  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1595  return parse<double>(i.second);
1596  }
1597  }
1598  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1599  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1600 }
1601 
1602 
1603 template<> bool
1605  for (auto i : allowedAttributes(tag)) {
1606  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1607  return parse<bool>(i.second);
1608  }
1609  }
1610  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1611  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1612 }
1613 
1614 
1615 template<> std::string
1617  for (auto i : allowedAttributes(tag)) {
1618  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1619  return (i.second);
1620  }
1621  }
1622  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1623  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1624 }
1625 
1626 
1627 template<> SUMOVehicleClass
1629  for (auto i : allowedAttributes(tag)) {
1630  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1631  return parse<SUMOVehicleClass>(i.second);
1632  }
1633  }
1634  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1635  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1636 }
1637 
1638 
1639 template<> SUMOVehicleShape
1641  for (auto i : allowedAttributes(tag)) {
1642  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1643  return parse<SUMOVehicleShape>(i.second);
1644  }
1645  }
1646  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1647  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1648 }
1649 
1650 
1651 template<> RGBColor
1653  for (auto i : allowedAttributes(tag)) {
1654  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1655  return parse<RGBColor>(i.second);
1656  }
1657  }
1658  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1659  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1660 }
1661 
1662 
1663 template<> std::vector<int>
1665  for (auto i : allowedAttributes(tag)) {
1666  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1667  return parse<std::vector<int> >(i.second);
1668  }
1669  }
1670  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1671  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1672 }
1673 
1674 
1675 template<> std::vector<double>
1677  for (auto i : allowedAttributes(tag)) {
1678  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1679  return parse<std::vector<double> >(i.second);
1680  }
1681  }
1682  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1683  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1684 }
1685 
1686 
1687 template<> std::vector<bool>
1689  for (auto i : allowedAttributes(tag)) {
1690  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1691  return parse<std::vector<bool> >(i.second);
1692  }
1693  }
1694  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1695  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1696 }
1697 
1698 
1699 template<> std::vector<std::string>
1701  for (auto i : allowedAttributes(tag)) {
1702  if ((i.first == attr) && (i.second != NODEFAULTVALUE)) {
1703  return parse<std::vector<std::string> >(i.second);
1704  }
1705  }
1706  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1707  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1708 }
1709 
1710 
1711 bool
1712 GNEAttributeCarrier::checkGNEEdgesValid(GNENet* net, const std::string& value, bool report) {
1713  // Declare string vector
1714  std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
1715  // Iterate over edges IDs and check if edge exist
1716  for (auto i : edgeIds) {
1717  if (net->retrieveEdge(i, false) == NULL) {
1718  if (report) {
1719  WRITE_WARNING("Error parsing parameter " + toString(SUMO_ATTR_EDGES) + ". " + toString(SUMO_TAG_EDGE) + " '" + i + "' doesn't exist.");
1720  }
1721  return false;
1722  }
1723  }
1724  // all edges exist, then return true
1725  return true;
1726 }
1727 
1728 
1729 bool
1730 GNEAttributeCarrier::checkGNELanesValid(GNENet* net, const std::string& value, bool report) {
1731  // Declare string vector
1732  std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
1733  // Iterate over lanes IDs and check if lane exist
1734  for (auto i : laneIds) {
1735  if (net->retrieveLane(i, false) == NULL) {
1736  if (report) {
1737  WRITE_WARNING("Error parsing parameter " + toString(SUMO_ATTR_LANES) + ". " + toString(SUMO_TAG_LANE) + " '" + i + "' doesn't exist.");
1738  }
1739  return false;
1740  }
1741  }
1742  // all lanes exist, then return true
1743  return true;
1744 }
1745 
1746 
1747 std::vector<GNEEdge*>
1748 GNEAttributeCarrier::parseGNEEdges(GNENet* net, const std::string& value) {
1749  // Declare string vector
1750  std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
1751  std::vector<GNEEdge*> parsedEdges;
1752  // Iterate over edges IDs, retrieve Edges and add it into parsedEdges
1753  for (auto i : edgeIds) {
1754  parsedEdges.push_back(net->retrieveEdge(i));
1755  }
1756  return parsedEdges;
1757 }
1758 
1759 
1760 std::vector<GNELane*>
1761 GNEAttributeCarrier::parseGNELanes(GNENet* net, const std::string& value) {
1762  // Declare string vector
1763  std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
1764  std::vector<GNELane*> parsedLanes;
1765  // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes
1766  for (auto i : laneIds) {
1767  parsedLanes.push_back(net->retrieveLane(i));
1768  }
1769  return parsedLanes;
1770 }
1771 
1772 
1773 std::string
1774 GNEAttributeCarrier::parseGNEEdges(const std::vector<GNEEdge*>& edges) {
1775  // obtain ID's of edges and return their join
1776  std::vector<std::string> edgeIDs;
1777  for (auto i : edges) {
1778  edgeIDs.push_back(i->getID());
1779  }
1780  return joinToString(edgeIDs, " ");
1781 }
1782 
1783 
1784 std::string
1785 GNEAttributeCarrier::parseGNELanes(const std::vector<GNELane*>& lanes) {
1786  // obtain ID's of lanes and return their join
1787  std::vector<std::string> laneIDs;
1788  for (auto i : lanes) {
1789  laneIDs.push_back(i->getID());
1790  }
1791  return joinToString(laneIDs, " ");
1792 }
1793 
1794 /****************************************************************************/
1795 
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:410
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:179
a routeprobe detector
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
Definition: GNENet.cpp:902
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...
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:266
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:42
A calibrator placed over edge.
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
lane of a reroute of type closing
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)
FXIcon * getIcon() const
get FXIcon assigned to this object
T MAX2(T a, T b)
Definition: StdDefs.h:73
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
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
static std::vector< GNEEdge * > parseGNEEdges(GNENet *net, const std::string &value)
parse string into vector of GNEEdges
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in all GNEAttributeCarriers.
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
std::vector< std::string > getStrings() const
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:64
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:363
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
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:260
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 isVClass(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a list of Vehicle Classes
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:55
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 const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:263
A calibrator placed over lane (used in netedit)
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:167
static bool checkGNELanesValid(GNENet *net, const std::string &value, bool report)
check if a list of Lane IDs is valid
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
probability of route of a reroute
probability of destiny of a reroute
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
const std::string getID() const
function to support debugging
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNonEditableAttrs
map with the non-editable attributes
begin/end of the description of an edge
static std::vector< SumoXMLTag > myDialogTags
vector with the allowed tags that has a editor values
reroute of type closing
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
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myVClassAttrs
map with the Vehicle Class attributes
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 getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
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
static bool canOpenDialog(SumoXMLTag tag)
return true if element tag can open a values editor
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
an aggreagated-output interval
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)
GUIIcon getGUIIcon() const
get GUI icon assigned to this object
link: the index of the link within the traffic light
last coordinate of edge shape
Delay in the charge of charging stations.
static std::vector< GNELane * > parseGNELanes(GNENet *net, const std::string &value)
parse string into vector of GNELanes
static bool isNumerical(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical (int or float)
static bool checkGNEEdgesValid(GNENet *net, const std::string &value, bool report)
check if a list of edge IDs is valid
begin/end of the description of a Point of interest over Lane (used by Netedit)
#define NODEFAULTVALUE
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalIntAttrs
map with the numerical attributes of type Int
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1000
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.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:236
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
const GUIGlObject * getGUIGLObject() const
get const pointer to GUIGlObject vinculated with this Attribute Carrier
SumoXMLTag getTag() const
get XML Tag assigned to this object
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myFileAttrs
map with the file attributes