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 #include "GNEAttributeCarrier.h"
36 #include "GNEUndoList.h"
37 
38 // ===========================================================================
39 // static members
40 // ===========================================================================
41 std::map<SumoXMLTag, std::vector<std::pair <SumoXMLAttr, std::string> > > GNEAttributeCarrier::_allowedAttributes;
42 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedNetElementTags;
43 std::vector<SumoXMLTag> GNEAttributeCarrier::myAllowedAdditionalTags;
44 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNumericalIntAttrs;
45 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNumericalFloatAttrs;
46 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myTimeAttrs;
47 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myBoolAttrs;
48 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myListAttrs;
49 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myUniqueAttrs;
50 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myNonEditableAttrs;
51 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myPositiveAttrs;
52 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myProbabilityAttrs;
53 std::map<SumoXMLTag, std::set<SumoXMLAttr> > GNEAttributeCarrier::myFileAttrs;
54 std::map<SumoXMLTag, SumoXMLTag> GNEAttributeCarrier::myAllowedAdditionalWithParentTags;
55 std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > > GNEAttributeCarrier::myDiscreteChoices;
56 std::map<SumoXMLTag, std::map<SumoXMLAttr, std::string > > GNEAttributeCarrier::myAttrDefinitions;
58 
59 const std::string GNEAttributeCarrier::LOADED = "loaded";
60 const std::string GNEAttributeCarrier::GUESSED = "guessed";
61 const std::string GNEAttributeCarrier::MODIFIED = "modified";
62 const std::string GNEAttributeCarrier::APPROVED = "approved";
63 
64 #define NODEFAULTVALUE "<NODEFAULTVALUE>"
65 
66 // ===========================================================================
67 // method definitions
68 // ===========================================================================
70  myTag(tag),
71  myIcon(icon) {
72 }
73 
74 
75 template<> int
76 GNEAttributeCarrier::parse(const std::string& string) {
77  return TplConvert::_str2int(string);
78 }
79 
80 
81 template<> double
82 GNEAttributeCarrier::parse(const std::string& string) {
83  return TplConvert::_str2double(string);
84 }
85 
86 
87 template<> bool
88 GNEAttributeCarrier::parse(const std::string& string) {
89  return TplConvert::_str2Bool(string);
90 }
91 
92 
93 template<> std::string
94 GNEAttributeCarrier::parse(const std::string& string) {
95  return string;
96 }
97 
98 
99 template<> SUMOVehicleClass
100 GNEAttributeCarrier::parse(const std::string& string) {
101  if (string.size() == 0) {
102  throw EmptyData();
103  } else if (SumoVehicleClassStrings.hasString(string) == false) {
104  return SVC_IGNORING;
105  } else {
106  return SumoVehicleClassStrings.get(string);
107  }
108 }
109 
110 
111 template<> SUMOVehicleShape
112 GNEAttributeCarrier::parse(const std::string& string) {
113  if (string.size() == 0) {
114  throw EmptyData();
115  } else if ((string == "unknown") || (SumoVehicleShapeStrings.hasString(string) == false)) {
116  return SVS_UNKNOWN;
117  } else {
118  return SumoVehicleShapeStrings.get(string);
119  }
120 }
121 
122 
123 template<> std::vector<std::string>
124 GNEAttributeCarrier::parse(const std::string& string) {
125  std::vector<std::string> parsedValues;
126  SUMOSAXAttributes::parseStringVector(string, parsedValues);
127  return parsedValues;
128 }
129 
130 
131 template<> std::vector<int>
132 GNEAttributeCarrier::parse(const std::string& string) {
133  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
134  std::vector<int> parsedIntValues;
135  for (std::vector<std::string>::const_iterator i = parsedValues.begin(); i != parsedValues.end(); i++) {
136  parsedIntValues.push_back(parse<int>(*i));
137  }
138  return parsedIntValues;
139 }
140 
141 
142 template<> std::vector<double>
143 GNEAttributeCarrier::parse(const std::string& string) {
144  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
145  std::vector<double> parsedDoubleValues;
146  for (std::vector<std::string>::const_iterator i = parsedValues.begin(); i != parsedValues.end(); i++) {
147  parsedDoubleValues.push_back(parse<double>(*i));
148  }
149  return parsedDoubleValues;
150 }
151 
152 
153 template<> std::vector<bool>
154 GNEAttributeCarrier::parse(const std::string& string) {
155  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
156  std::vector<bool> parsedBoolValues;
157  for (std::vector<std::string>::const_iterator i = parsedValues.begin(); i != parsedValues.end(); i++) {
158  parsedBoolValues.push_back(parse<bool>(*i));
159  }
160  return parsedBoolValues;
161 }
162 
163 
164 bool
165 GNEAttributeCarrier::isValid(SumoXMLAttr key, const std::string& value) {
166  UNUSED_PARAMETER(value);
167  return std::find(getAttrs().begin(), getAttrs().end(), key) != getAttrs().end();
168 }
169 
170 
171 std::string
173  return toString(myTag);
174 }
175 
176 
179  return myTag;
180 }
181 
182 
183 FXIcon*
186 }
187 
188 
189 GUIIcon
191  return myIcon;
192 }
193 
194 
195 std::vector<SumoXMLAttr>
197  std::vector<SumoXMLAttr> attr;
198  for (std::vector<std::pair <SumoXMLAttr, std::string> >::const_iterator i = allowedAttributes(myTag).begin(); i != allowedAttributes(myTag).end(); i++) {
199  attr.push_back(i->first);
200  }
201  return attr;
202 }
203 
204 
205 const std::string
207  return getAttribute(SUMO_ATTR_ID);
208 }
209 
210 
211 std::string
213  if (isInt(tag, attr)) {
214  return "int";
215  } else if (isFloat(tag, attr)) {
216  return "float";
217  } else if (isTime(tag, attr)) {
218  return "time";
219  } else if (isBool(tag, attr)) {
220  return "bool";
221  } else if (isString(tag, attr)) {
222  return "string";
223  } else if (isList(tag, attr)) {
224  return "list";
225  } else {
226  throw ProcessError("Undeterminted type for '" + toString(tag) + "' '" + toString(attr) + "'");
227  }
228 }
229 
230 
231 bool
232 GNEAttributeCarrier::isValidID(const std::string& value) {
233  return value.find_first_of(" \t\n\r@$%^&/|\\{}*'\";:<>") == std::string::npos;
234 }
235 
236 
237 bool
238 GNEAttributeCarrier::isValidFilename(const std::string& value) {
239  // @note Only characteres that aren't permited in a file path or belong
240  // to XML sintax
241  return (value.find_first_of("\t\n\r@$%^&|\\{}*'\";:<>") == std::string::npos);
242 }
243 
244 
245 // ===========================================================================
246 // static methods
247 // ===========================================================================
248 
249 const std::vector<std::pair <SumoXMLAttr, std::string> >&
251  // define on first access
252  if (!_allowedAttributes.count(tag)) {
253  std::vector<std::pair<SumoXMLAttr, std::string> >& attrs = _allowedAttributes[tag];
254  switch (tag) {
255  case SUMO_TAG_EDGE:
256  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
257  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM, NODEFAULTVALUE));
258  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO, NODEFAULTVALUE));
259  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "13.89"));
260  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PRIORITY, "1"));
261  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NUMLANES, "1"));
262  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
263  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
264  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
265  //attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PREFER, ));
266  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, ""));
267  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, NODEFAULTVALUE));
268  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPREADTYPE, "right"));
269  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NAME, ""));
270  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "default"));
271  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDOFFSET, "0"));
272  attrs.push_back(std::pair<SumoXMLAttr, std::string>(GNE_ATTR_SHAPE_START, "")); // virtual attribute used to define an endPoint
273  attrs.push_back(std::pair<SumoXMLAttr, std::string>(GNE_ATTR_SHAPE_END, "")); // virtual attribute from to define an endPoint
274  break;
275  case SUMO_TAG_JUNCTION:
276  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
277  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
278  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
279  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SHAPE, ""));
280  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_RADIUS, "1.5"));
281  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_KEEP_CLEAR, "true"));
282  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLTYPE, ""));
283  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TLID, ""));
284  break;
285  case SUMO_TAG_LANE:
286  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
287  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "13.89"));
288  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ALLOW, "all"));
289  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DISALLOW, ""));
290  //attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PREFER, ));
291  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "default"));
292  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDOFFSET, "0"));
293  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ACCELERATION, "false"));
294  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_INDEX, NODEFAULTVALUE));
295  break;
296  case SUMO_TAG_POI:
297  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
298  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
299  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, ""));
300  break;
301  case SUMO_TAG_CROSSING:
302  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
303  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
304  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PRIORITY, "false"));
305  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "3"));
306  break;
307  case SUMO_TAG_CONNECTION:
308  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM, NODEFAULTVALUE));
309  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO, NODEFAULTVALUE));
310  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FROM_LANE, NODEFAULTVALUE));
311  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TO_LANE, NODEFAULTVALUE));
312  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PASS, "false"));
313  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_KEEP_CLEAR, "false"));
314  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTPOS, "0"));
315  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_UNCONTROLLED, "false"));
316  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VISIBILITY_DISTANCE, "4.5"));
317  break;
318  case SUMO_TAG_BUS_STOP:
319  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
320  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
321  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
322  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
323  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINES, ""));
324  break;
326  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
327  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
328  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
329  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
330  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINES, ""));
331  break;
333  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
334  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
335  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTPOS, NODEFAULTVALUE));
336  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ENDPOS, NODEFAULTVALUE));
337  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGINGPOWER, "22000"));
338  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EFFICIENCY, "0.95"));
339  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGEINTRANSIT, "false"));
340  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CHARGEDELAY, "0"));
341  break;
342  case SUMO_TAG_E1DETECTOR:
343  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
344  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
345  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
346  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
347  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
348  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPLIT_VTYPE, "false"));
349  break;
350  case SUMO_TAG_E2DETECTOR:
351  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
352  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
353  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
354  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, "10"));
355  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
356  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
357  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONT, "false"));
358  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "1"));
359  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_SPEED_THRESHOLD, "1.39"));
360  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_JAM_DIST_THRESHOLD, "10"));
361  break;
362  case SUMO_TAG_E3DETECTOR:
363  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
364  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_X, "0"));
365  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_Y, "0"));
366  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
367  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
368  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_TIME_THRESHOLD, "1"));
369  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_HALTING_SPEED_THRESHOLD, "1.39"));
370  break;
371  case SUMO_TAG_DET_ENTRY:
372  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
373  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
374  break;
375  case SUMO_TAG_DET_EXIT:
376  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
377  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, NODEFAULTVALUE));
378  break;
379  case SUMO_TAG_VSS:
380  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
381  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANES, ""));
382  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
383  break;
384  case SUMO_TAG_CALIBRATOR:
385  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
386  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE, NODEFAULTVALUE));
387  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_POSITION, "0"));
388  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
389  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTEPROBE, ""));
390  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OUTPUT, ""));
391  break;
392  case SUMO_TAG_REROUTER:
393  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
394  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
395  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
396  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "1"));
397  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_OFF, "false"));
398  break;
399  case SUMO_TAG_ROUTEPROBE:
400  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
401  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
402  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FREQUENCY, "100"));
403  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_FILE, ""));
404  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, "0"));
405  break;
406  case SUMO_TAG_VAPORIZER:
407  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGE, NODEFAULTVALUE));
408  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_STARTTIME, "0"));
409  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, "10"));
410  break;
411  case SUMO_TAG_FLOW:
412  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
413  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TYPE, NODEFAULTVALUE));
414  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ROUTE, NODEFAULTVALUE));
415  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BEGIN, NODEFAULTVALUE));
416  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_END, NODEFAULTVALUE));
417  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VEHSPERHOUR, "-1"));
418  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERIOD, "-1"));
419  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PROB, "-1"));
420  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_NUMBER, "100"));
421  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTLANE, "first"));
422  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTPOS, "base"));
423  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTSPEED, "0"));
424  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALLANE, "current"));
425  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALPOS, "max"));
426  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALSPEED, "current"));
427  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LINE, ""));
428  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERSON_NUMBER, "0"));
429  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTAINER_NUMBER, "0"));
430  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_REROUTE, "false"));
431  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DEPARTPOS_LAT, "center"));
432  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ARRIVALPOS_LAT, ""));
433  break;
434  case SUMO_TAG_ROUTE:
435  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
436  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EDGES, NODEFAULTVALUE));
437  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, ""));
438  break;
439  case SUMO_TAG_VTYPE:
440  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ID, NODEFAULTVALUE));
441  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_ACCEL, "2.6"));
442  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_DECEL, "4.5"));
443  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SIGMA, "0.5"));
444  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TAU, "1.0"));
445  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LENGTH, "5.0"));
446  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MINGAP, "2.5"));
447  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MAXSPEED, "70.0"));
448  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEEDFACTOR, "1.0"));
449  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEEDDEV, "0.0"));
450  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_COLOR, "1,1,0"));
451  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_VCLASS, "unknown"));
452  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_EMISSIONCLASS, "P_7_7"));
453  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_GUISHAPE, "unknown"));
454  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_WIDTH, "2.0"));
455  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMGFILE, ""));
456  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_IMPATIENCE, "0.0"));
457  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LANE_CHANGE_MODEL, "LC2013"));
458  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CAR_FOLLOW_MODEL, "Krauss"));
459  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_PERSON_CAPACITY, "4"));
460  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_CONTAINER_CAPACITY, "0"));
461  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_BOARDING_DURATION, "0.5"));
462  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LOADING_DURATION, "90.0"));
463  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_LATALIGNMENT, "center"));
464  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MINGAP_LAT, "0.12"));
465  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_MAXSPEED_LAT, "1.0"));
466  break;
467  case SUMO_TAG_STEP:
468  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_TIME, NODEFAULTVALUE));
469  attrs.push_back(std::pair<SumoXMLAttr, std::string>(SUMO_ATTR_SPEED, "50.0"));
470  break;
471  default:
472  // Throw exception if tag isn't defined
473  throw ProcessError("allowed attributes for tag '" + toString(tag) + "' not defined");
474  }
475  }
476  return _allowedAttributes[tag];
477 }
478 
479 
480 const std::vector<SumoXMLTag>&
482  // define on first access
483  if (myAllowedNetElementTags.empty()) {
489  }
490  if (myAllowedAdditionalTags.empty()) {
504  }
506 }
507 
508 
509 bool
511  return (isInt(tag, attr) || isFloat(tag, attr));
512 }
513 
514 
515 bool
517  // define on first access
518  if (myNumericalIntAttrs.empty()) {
519  // connection
522  // edge
525  // lane
527  // flow
532  // vehicle type
535  }
536  return myNumericalIntAttrs[tag].count(attr) == 1;
537 }
538 
539 
540 bool
542  // define on first access
543  if (myNumericalFloatAttrs.empty()) {
544  // bus stop
547  // charging station
552  // connection
555  // container stop
558  // crossing
560  // E2
564  // E3
568  // Edge
572  // Junction
574  // Lane
577  // Rerouter
579  // Calibrator
581  // vehicle type
595  // flow
599  // step
601  }
602  return myNumericalFloatAttrs[tag].count(attr) == 1;
603 }
604 
605 
606 bool
608  // define on first access
609  if (myTimeAttrs.empty()) {
610  // calibrator
612  // charging station
614  // E1
616  // E2
619  // E3
622  // RouteProbe
625  // Vaporizer
628  // Vehicle type
631  // Flow
634  // step
636  }
637  return myTimeAttrs[tag].count(attr) == 1;
638 }
639 
640 
641 bool
643  // define on first access
644  if (myBoolAttrs.empty()) {
645  // charging station
647  // lane
649  // connection
652  // crossing
654  // E1
656  // E2
658  // junction
660  // rerouter
662  // flow
664  }
665  return myBoolAttrs[tag].count(attr) == 1;
666 }
667 
668 
669 bool
671  return (!isNumerical(tag, attr) && !isBool(tag, attr) && !isTime(tag, attr));
672 }
673 
674 
675 bool
677  // define on first access
678  if (myListAttrs.empty()) {
679  // bus stop
681  // container stop
683  // crossing
685  // rerouter
687  // variable speed signal
689  // route
691  }
692  return myListAttrs[tag].count(attr) == 1;
693 }
694 
695 
696 bool
698  // ID is an atribute that always is unique
699  if (attr == SUMO_ATTR_ID) {
700  return true;
701  } else {
702  // define on first access
703  if (myUniqueAttrs.empty()) {
704  // connection
708  // edge
711  // busstop
715  // calibrator
719  // charging station
723  // connection
725  // container stop
729  // crossing
731  // det entry
734  // det exit
737  // E1
741  // E2
745  // E3
749  // Edge
751  // Junction
755  // POI
757  // Rerouter
760  // Routeprobe
763  // Vaporizer
766  // VSS
768  }
769  return myUniqueAttrs[tag].count(attr) == 1;
770  }
771 }
772 
773 
774 bool
776  if (discreteChoices(tag, attr).size() > 0) {
777  return true;
778  } else {
779  return false;
780  }
781 }
782 
783 
784 bool
786  // define on first access
787  if (myPositiveAttrs.empty()) {
788  // edge
795  // junction
797  // lane
801  // poi
803  // crossing
805  // connection
808  // busstop
811  // container stop
814  // charging station
820  // E1
822  // E2
828  // entry
830  // exit
832  // calibrator
834  // flow
840  // vehicle type
855  }
856  return myPositiveAttrs[tag].count(attr) == 1;
857 }
858 
859 
860 bool
862  // define on first access
863  if (myProbabilityAttrs.empty()) {
864  // charging station
866  // rerouter
868  // flow
870  }
871  return myProbabilityAttrs[tag].count(attr) == 1;
872 }
873 
874 
875 bool
877  // define on first access
878  if (myFileAttrs.empty()) {
879  // E1
881  // E2
883  // E3
885  // calibrator
887  // rerouter
889  // routeprobe
891  // Variable Speed Signal
893  }
894  return myFileAttrs[tag].count(attr) == 1;
895 }
896 
897 
898 bool
900  // define on first access
901  if (myNonEditableAttrs.empty()) {
902  // connection
907  // crossing
909  // lane
911  }
912  return myNonEditableAttrs[tag].count(attr) == 1;
913 }
914 
915 
916 bool
918  const std::vector<std::pair <SumoXMLAttr, std::string> >& attrs = allowedAttributes(tag);
919  for (std::vector<std::pair <SumoXMLAttr, std::string> >::const_iterator i = attrs.begin(); i != attrs.end(); i++) {
920  if (i->first == attr) {
921  return true;
922  }
923  }
924  return false;
925 }
926 
927 
928 
929 bool
931  const std::vector<std::pair <SumoXMLAttr, std::string> >& attrs = allowedAttributes(tag);
932  for (std::vector<std::pair <SumoXMLAttr, std::string> >::const_iterator i = attrs.begin(); i != attrs.end(); i++) {
933  if ((*i).first == attr) {
934  if ((*i).second != NODEFAULTVALUE) {
935  return true;
936  } else {
937  return false;
938  }
939  }
940  }
941  throw ProcessError("Attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' not defined");
942 }
943 
944 
945 const std::vector<std::string>&
947  // define on first access
948  if (myDiscreteChoices.empty()) {
949  std::vector<std::string> choices;
950  // Get type of nodes
952  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
954  // junction
956  }
957  }
958  // Get types of traffic lights
960  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
961  if (*it != toString(TLTYPE_INVALID)) {
962  // junction
964  }
965  }
966  // get type of lane spread functions
968  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
969  // edge
971  }
972  // get vehicle types
973  choices = SumoVehicleClassStrings.getStrings();
974  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
975  // edge
978  // lane
981  // vehicle type
983  }
984  // get vehicle shapes
985  choices = SumoVehicleShapeStrings.getStrings();
986  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
987  // vehicle type
989  }
990  // lat alignments of vehicle types
997  }
998  return myDiscreteChoices[tag][attr];
999 }
1000 
1001 
1002 bool
1004  return (attr == SUMO_ATTR_ALLOW || attr == SUMO_ATTR_DISALLOW);
1005 }
1006 
1007 
1008 std::string
1010  // define on first access
1011  if (myAttrDefinitions.empty()) {
1012  // Edge
1013  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ID] = "The id of the edge (must be unique).";
1014  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_FROM] = "The name of a node within the nodes-file the edge shall start at.";
1015  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_TO] = "The name of a node within the nodes-file the edge shall end at.";
1016  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SPEED] = "The maximum speed allowed on the edge in m/s.";
1017  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_PRIORITY] = "The priority of the edge.";
1018  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_NUMLANES] = "The number of lanes of the edge.";
1019  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_TYPE] = "The name of a type within the SUMO edge type file";
1020  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ALLOW] = "Explicitly allows the given vehicle classes (not given will be not allowed).";
1021  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_DISALLOW] = "Explicitly disallows the given vehicle classes (not given will be allowed).";
1022  //myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_PREFER] = "";
1023  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.";
1024  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_LENGTH] = "The length of the edge in meter";
1025  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_SPREADTYPE] = "Lane width for all lanes of this edge in meters (used for visualization).";
1026  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_NAME] = "street name (need not be unique, used for visualization).";
1027  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_WIDTH] = "Lane width for all lanes of this edge in meters (used for visualization).";
1028  myAttrDefinitions[SUMO_TAG_EDGE][SUMO_ATTR_ENDOFFSET] = "Move the stop line back from the intersection by the given amount.";
1029  // Junction
1030  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_ID] = "The name of the node (Must be unique).";
1031  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_POSITION] = "The x-y-z position of the node on the plane in meters.";
1032  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TYPE] = "An optional type for the node.";
1033  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_SHAPE] = "A custom shape for that node.";
1034  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_RADIUS] = "Optional turning radius (for all corners) for that node in meters.";
1035  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_KEEP_CLEAR] = "Whether the junction-blocking-heuristic should be activated at this node.";
1036  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TLTYPE] = "An optional type for the traffic light algorithm.";
1037  myAttrDefinitions[SUMO_TAG_JUNCTION][SUMO_ATTR_TLID] = "An optional id for the traffic light program.";
1038  // Lane
1039  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ID] = "ID of lane (Automatic)";
1040  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_SPEED] = "Speed in meters per second";
1041  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ALLOW] = "Explicitly allows the given vehicle classes (not given will be not allowed).";
1042  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_DISALLOW] = "Explicitly disallows the given vehicle classes (not given will be allowed).";
1043  //myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_PREFER] = "";
1044  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_WIDTH] = "Width in meters (used for visualization).";
1045  myAttrDefinitions[SUMO_TAG_LANE][SUMO_ATTR_ENDOFFSET] = "Move the stop line back from the intersection by the given amount.";
1046  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).";
1047  // POI
1048  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_ID] = "ID (Must be unique)";
1049  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_POSITION] = "The position of the poi along the xyz-axis in meters.";
1050  myAttrDefinitions[SUMO_TAG_POI][SUMO_ATTR_TYPE] = "A typename for the poi.";
1051  // Crossing
1052  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_ID] = "ID (Automatic)";
1053  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_PRIORITY] = "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections).";
1054  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_WIDTH] = "The width of the crossings.";
1055  myAttrDefinitions[SUMO_TAG_CROSSING][SUMO_ATTR_EDGES] = "The (road) edges which are crossed.";
1056  // Connection
1057  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_FROM] = "The name of the edge the vehicles leave ";
1058  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TO] = "The name of the edge the vehicles may reach when leaving 'from'";
1059  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_FROM_LANE] = "the lane index of the incoming lane (numbers starting with 0)";
1060  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_TO_LANE] = "the lane index of the outgoing lane (numbers starting with 0)";
1061  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_PASS] = "if set, vehicles which pass this (lane-2-lane) connection) will not wait";
1062  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.";
1063  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.";
1064  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_UNCONTROLLED] = "if set to true, This connection will not be TLS-controlled despite its node being controlled.";
1065  myAttrDefinitions[SUMO_TAG_CONNECTION][SUMO_ATTR_VISIBILITY_DISTANCE] = "sets the distance to the connection at which all relevant foes are visible.";
1066  // Bus Stop
1067  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_ID] = "ID (Must be unique)";
1068  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_LANE] = "The name of the lane the bus stop shall be located at";
1069  myAttrDefinitions[SUMO_TAG_BUS_STOP][SUMO_ATTR_STARTPOS] = "The begin position on the lane (the lower position on the lane) in meters";
1070  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";
1071  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";
1072  // container Stop
1073  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_ID] = "ID (Must be unique)";
1074  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_LANE] = "The name of the lane the container stop shall be located at";
1075  myAttrDefinitions[SUMO_TAG_CONTAINER_STOP][SUMO_ATTR_STARTPOS] = "The begin position on the lane (the lower position on the lane) in meters";
1076  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";
1077  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";
1078  // Charging Station
1079  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_ID] = "ID (Must be unique)";
1080  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_LANE] = "Lane of the charging station location";
1081  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_STARTPOS] = "Begin position in the specified lane";
1082  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_ENDPOS] = "End position in the specified lane";
1084  myAttrDefinitions[SUMO_TAG_CHARGING_STATION][SUMO_ATTR_EFFICIENCY] = "Charging efficiency [0,1]";
1085  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";
1086  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";
1087  // E1
1088  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1089  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";
1090  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";
1091  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1092  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1093  myAttrDefinitions[SUMO_TAG_E1DETECTOR][SUMO_ATTR_SPLIT_VTYPE] = "If set, the collected values will be additionally reported on per-vehicle type base, see below";
1094  // E2
1095  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1096  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";
1097  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1098  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_LENGTH] = "The length of the detector in meters";
1099  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1100  myAttrDefinitions[SUMO_TAG_E2DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1101  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";
1102  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";
1103  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";
1104  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";
1105  // E3
1106  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1107  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_FREQUENCY] = "The aggregation period the values the detector collects shall be summed up";
1108  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_FILE] = "The path to the output file";
1109  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";
1110  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";
1111  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_X] = "X position in editor (Only used in netedit)";
1112  myAttrDefinitions[SUMO_TAG_E3DETECTOR][SUMO_ATTR_Y] = "Y position in editor (Only used in netedit)";
1113  // Entry
1114  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";
1115  myAttrDefinitions[SUMO_TAG_DET_ENTRY][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1116  // Exit
1117  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";
1118  myAttrDefinitions[SUMO_TAG_DET_EXIT][SUMO_ATTR_POSITION] = "The position on the lane the detector shall be laid on in meters";
1119  // Variable Speed Signal
1120  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_ID] = "ID (Must be unique)";
1121  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_LANES] = "list of lanes of Variable Speed Signal";
1122  myAttrDefinitions[SUMO_TAG_VSS][SUMO_ATTR_FILE] = "The path to the output file";
1123  // Calibrator
1124  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_ID] = "ID (Must be unique)";
1125  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_LANE] = "The id of lane in the simulation network";
1126  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_POSITION] = "The position of the calibrator on the specified lane";
1127  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_FREQUENCY] = "The aggregation interval in which to calibrate the flows. default is step-length";
1128  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_ROUTEPROBE] = "The id of the routeProbe element from which to determine the route distribution for generated vehicles";
1129  myAttrDefinitions[SUMO_TAG_CALIBRATOR][SUMO_ATTR_OUTPUT] = "The output file for writing calibrator information or NULL";
1130  // Rerouter
1131  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_ID] = "ID (Must be unique)";
1132  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_EDGES] = "An edge id or a list of edge ids where vehicles shall be rerouted";
1133  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_FILE] = "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)";
1134  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_PROB] = "The probability for vehicle rerouting (0-1), default 1";
1135  myAttrDefinitions[SUMO_TAG_REROUTER][SUMO_ATTR_OFF] = "Whether the router should be inactive initially (and switched on in the gui), default:false";
1136  // route probe
1137  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_ID] = "ID (Must be unique)";
1138  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_EDGE] = "The id of an edge in the simulation network";
1139  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_FREQUENCY] = "The frequency in which to report the distribution";
1140  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_FILE] = "The file for generated output";
1141  myAttrDefinitions[SUMO_TAG_ROUTEPROBE][SUMO_ATTR_BEGIN] = "The time at which to start generating output";
1142  // flow
1143  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ID] = "The name of the vehicle (Must be unique)";
1144  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_TYPE] = "The id of the vehicle type to use for this vehicle.";
1145  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ROUTE] = "The id of the route the vehicle shall drive along";
1146  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_BEGIN] = "First vehicle departure time";
1147  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_END] = "End of departure interval";
1148  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_VEHSPERHOUR] = "Number of vehicles per hour, equally spaced (not together with period or probability)";
1149  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PERIOD] = "Insert equally spaced vehicles at that period (not together with vehsPerHour or probability)";
1150  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PROB] = "Probability for emitting a vehicle each second (not together with vehsPerHour or period)";
1151  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_NUMBER] = "Total number of vehicles, equally spaced";
1152  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTLANE] = "The lane on which the vehicle shall be inserted";
1153  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTPOS] = "The position at which the vehicle shall enter the net";
1154  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTSPEED] = "The speed with which the vehicle shall enter the network";
1155  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALLANE] = "The lane at which the vehicle shall leave the network";
1156  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALPOS] = "The position at which the vehicle shall leave the network";
1157  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALSPEED] = "The speed with which the vehicle shall leave the network";
1158  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";
1159  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_PERSON_NUMBER] = "The number of occupied seats when the vehicle is inserted";
1160  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_CONTAINER_NUMBER] = "The number of occupied container places when the vehicle is inserted";
1161  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_REROUTE] = " Whether the vehicle should be equipped with a rerouting device";
1162  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_DEPARTPOS_LAT] = "The lateral position on the departure lane at which the vehicle shall enter the net";
1163  myAttrDefinitions[SUMO_TAG_FLOW][SUMO_ATTR_ARRIVALPOS_LAT] = "The lateral position on the arrival lane at which the vehicle shall arrive";
1164  // route
1165  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_ID] = "The name of the route (Must be unique)";
1166  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_EDGES] = "The edges the vehicle shall drive along, given as their ids, separated using spaces";
1167  myAttrDefinitions[SUMO_TAG_ROUTE][SUMO_ATTR_COLOR] = "This route's color";
1168  // vehicle type
1169  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_ID] = "The name of the vehicle type (Must be unique)";
1170  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_ACCEL] = "The acceleration ability of vehicles of this type [m/s^2]";
1171  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_DECEL] = "The deceleration ability of vehicles of this type [m/s^2]";
1172  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SIGMA] = "Car-following model parameter";
1173  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_TAU] = "Car-following model parameter";
1174  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LENGTH] = "The vehicle's netto-length (length) [m]";
1175  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MINGAP] = "Empty space after leader [m]";
1176  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MAXSPEED] = "The vehicle's maximum velocity [m/s]";
1177  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SPEEDFACTOR] = "The vehicles expected multiplicator for lane speed limits";
1178  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_SPEEDDEV] = "The deviation of the speedFactor";
1179  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_COLOR] = "This vehicle type's color";
1180  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_VCLASS] = "An abstract vehicle class";
1181  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_EMISSIONCLASS] = "An abstract emission class";
1182  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_GUISHAPE] = "How this vehicle is rendered";
1183  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_WIDTH] = "The vehicle's width [m] (only used for drawing)";
1184  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_IMGFILE] = "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)";
1185  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_IMPATIENCE] = "Willingess of drivers to impede vehicles with higher priority";
1186  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LANE_CHANGE_MODEL] = "The model used for changing lanes";
1187  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_CAR_FOLLOW_MODEL] = "The model used for car following";
1188  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_PERSON_CAPACITY] = "The number of persons (excluding an autonomous driver) the vehicle can transport";
1189  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_CONTAINER_CAPACITY] = "The number of containers the vehicle can transport";
1190  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_BOARDING_DURATION] = "The time required by a person to board the vehicle";
1191  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LOADING_DURATION] = "The time required to load a container onto the vehicle";
1192  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_LATALIGNMENT] = "The preferred lateral alignment when using the sublane-model";
1193  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MINGAP_LAT] = "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model";
1194  myAttrDefinitions[SUMO_TAG_VTYPE][SUMO_ATTR_MAXSPEED_LAT] = "The maximum lateral speed when using the sublane-model";
1195  }
1196  return myAttrDefinitions[tag][attr];
1197 }
1198 
1199 
1200 int
1202  if (myMaxNumAttribute == 0) {
1203  // initialize both vectors
1205  for (std::vector<SumoXMLTag>::const_iterator i = myAllowedNetElementTags.begin(); i != myAllowedNetElementTags.end(); i++) {
1207  }
1208  for (std::vector<SumoXMLTag>::const_iterator i = myAllowedAdditionalTags.begin(); i != myAllowedAdditionalTags.end(); i++) {
1210  }
1211  }
1212  return myMaxNumAttribute;
1213 }
1214 
1215 
1216 template<> int
1218  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1219  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1220  return parse<int>((*i).second);
1221  }
1222  }
1223  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1224  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1225 }
1226 
1227 
1228 template<> double
1230  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1231  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1232  return parse<double>((*i).second);
1233  }
1234  }
1235  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1236  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1237 }
1238 
1239 
1240 template<> bool
1242  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1243  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1244  return parse<bool>((*i).second);
1245  }
1246  }
1247  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1248  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1249 }
1250 
1251 
1252 template<> std::string
1254  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1255  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1256  return (*i).second;
1257  }
1258  }
1259  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1260  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1261 }
1262 
1263 
1264 template<> SUMOVehicleClass
1266  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1267  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1268  return parse<SUMOVehicleClass>((*i).second);
1269  }
1270  }
1271  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1272  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1273 }
1274 
1275 
1276 
1277 template<> SUMOVehicleShape
1279  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1280  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1281  return parse<SUMOVehicleShape>((*i).second);
1282  }
1283  }
1284  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1285  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1286 }
1287 
1288 
1289 template<> std::vector<int>
1291  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1292  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1293  return parse<std::vector<int> >((*i).second);
1294  }
1295  }
1296  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1297  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1298 }
1299 
1300 
1301 template<> std::vector<double>
1303  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1304  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1305  return parse<std::vector<double> >((*i).second);
1306  }
1307  }
1308  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1309  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1310 }
1311 
1312 
1313 template<> std::vector<bool>
1315  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1316  if (((*i).first == attr) && ((*i).second != NODEFAULTVALUE)) {
1317  return parse<std::vector<bool> >((*i).second);
1318  }
1319  }
1320  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1321  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1322 }
1323 
1324 
1325 template<> std::vector<std::string>
1327  for (std::vector<std::pair<SumoXMLAttr, std::string> >::iterator i = _allowedAttributes.at(tag).begin(); i != _allowedAttributes.at(tag).end(); i++) {
1328  if ((*i).first == attr) {
1329  return parse<std::vector<std::string> >((*i).second);
1330  }
1331  }
1332  // throw exception if attribute doesn't have a default value and return a empty value to avoid warnings
1333  throw ProcessError("attribute '" + toString(attr) + "' for tag '" + toString(tag) + "' doesn't have a default value");
1334 }
1335 
1336 /****************************************************************************/
1337 
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:389
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
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.
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)
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::map< SumoXMLTag, std::set< SumoXMLAttr > > myPositiveAttrs
map with the positive attributes
connectio between two lanes
Allow/disallow charge in transit in Charging Stations.
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:70
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 bool isValidFilename(const std::string &value)
true if value is a valid file value
virtual std::string getAttribute(SumoXMLAttr key) const =0
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.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:38
begin/end of the description of a route
std::vector< std::string > getStrings() const
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:348
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 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
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 hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
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:160
virtual std::string getDescription()
how should this attribute carrier be called
static T getDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
return the default value of the attribute of an element
static const std::vector< SumoXMLTag > & allowedTags(bool net)
get all editable for tag (net or additional).
node: the type of traffic light
edge: the shape in xml-definition
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 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 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::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
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
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)
virtual bool isValid(SumoXMLAttr key, const std::string &value)
#define NODEFAULTVALUE
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
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
trigger: a step description
SumoXMLTag getTag() const
get XML Tag assigned to this object
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myFileAttrs
map with the empty attributes