Eclipse 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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Abstract Base class for gui objects which carry attributes
19 /****************************************************************************/
20 #include <netedit/GNENet.h>
21 #include <netedit/GNEViewNet.h>
22 #include <netedit/GNEViewParent.h>
29 
30 #include "GNEAttributeCarrier.h"
31 
32 
33 // ===========================================================================
34 // static members
35 // ===========================================================================
36 
37 std::map<SumoXMLTag, GNETagProperties> GNEAttributeCarrier::myTagProperties;
39 const std::string GNEAttributeCarrier::FEATURE_LOADED = "loaded";
40 const std::string GNEAttributeCarrier::FEATURE_GUESSED = "guessed";
41 const std::string GNEAttributeCarrier::FEATURE_MODIFIED = "modified";
42 const std::string GNEAttributeCarrier::FEATURE_APPROVED = "approved";
44 const double GNEAttributeCarrier::INVALID_POSITION(-1000000);
45 
46 
47 // ===========================================================================
48 // method definitions
49 // ===========================================================================
50 
52  myTagProperty(getTagProperties(tag)),
53  myNet(net),
54  mySelected(false) {
55 }
56 
57 
59 
60 
61 GNENet*
63  return myNet;
64 }
65 
66 
67 void
70  gSelected.select(getGUIGlObject()->getGlID());
71  // add object into list of selected objects
73  if (changeFlag) {
74  mySelected = true;
75  }
76  }
77 }
78 
79 
80 void
83  gSelected.deselect(getGUIGlObject()->getGlID());
84  // remove object of list of selected objects
86  if (changeFlag) {
87  mySelected = false;
88  }
89  }
90 }
91 
92 
93 bool
95  return mySelected;
96 }
97 
98 
99 bool
101  // get flag for network element
103  // check supermode network
104  if ((networkElement && myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) ||
107  return mySelected;
108  } else {
109  return false;
110  }
111 }
112 
113 
114 template<> int
115 GNEAttributeCarrier::parse(const std::string& string) {
116  return StringUtils::toInt(string);
117 }
118 
119 
120 template<> double
121 GNEAttributeCarrier::parse(const std::string& string) {
122  return StringUtils::toDouble(string);
123 }
124 
125 
126 template<> SUMOTime
127 GNEAttributeCarrier::parse(const std::string& string) {
128  SUMOTime time = string2time(string);
129  if (time < 0) {
130  throw TimeFormatException("SUMOTIME cannot be negative");
131  } else {
132  return time;
133  }
134 }
135 
136 
137 template<> bool
138 GNEAttributeCarrier::parse(const std::string& string) {
139  return StringUtils::toBool(string);
140 }
141 
142 
143 template<> std::string
144 GNEAttributeCarrier::parse(const std::string& string) {
145  return string;
146 }
147 
148 
149 template<> SUMOVehicleClass
150 GNEAttributeCarrier::parse(const std::string& string) {
151  if (string.size() == 0) {
152  throw EmptyData();
153  } else if (!SumoVehicleClassStrings.hasString(string)) {
154  return SVC_IGNORING;
155  } else {
156  return SumoVehicleClassStrings.get(string);
157  }
158 }
159 
160 
161 template<> RGBColor
162 GNEAttributeCarrier::parse(const std::string& string) {
163  return RGBColor::parseColor(string);
164 }
165 
166 
167 template<> Position
168 GNEAttributeCarrier::parse(const std::string& string) {
169  if (string.size() == 0) {
170  throw EmptyData();
171  } else {
172  bool ok = true;
173  PositionVector pos = GeomConvHelper::parseShapeReporting(string, "user-supplied position", 0, ok, false, false);
174  if (!ok || (pos.size() != 1)) {
175  throw NumberFormatException("(Position) " + string);
176  } else {
177  return pos[0];
178  }
179  }
180 }
181 
182 
183 template<> PositionVector
184 GNEAttributeCarrier::parse(const std::string& string) {
185  PositionVector posVector;
186  // empty string are allowed (It means empty position vector)
187  if (string.empty()) {
188  return posVector;
189  } else {
190  bool ok = true;
191  posVector = GeomConvHelper::parseShapeReporting(string, "user-supplied shape", 0, ok, false, true);
192  if (!ok) {
193  throw NumberFormatException("(Position List) " + string);
194  } else {
195  return posVector;
196  }
197  }
198 }
199 
200 
201 template<> SUMOVehicleShape
202 GNEAttributeCarrier::parse(const std::string& string) {
203  if ((string == "unknown") || (!SumoVehicleShapeStrings.hasString(string))) {
204  return SVS_UNKNOWN;
205  } else {
206  return SumoVehicleShapeStrings.get(string);
207  }
208 }
209 
210 
211 template<> std::vector<std::string>
212 GNEAttributeCarrier::parse(const std::string& string) {
213  return StringTokenizer(string).getVector();
214 }
215 
216 
217 template<> std::set<std::string>
218 GNEAttributeCarrier::parse(const std::string& string) {
219  std::vector<std::string> vectorString = StringTokenizer(string).getVector();
220  std::set<std::string> solution;
221  for (const auto& i : vectorString) {
222  solution.insert(i);
223  }
224  return solution;
225 }
226 
227 
228 template<> std::vector<int>
229 GNEAttributeCarrier::parse(const std::string& string) {
230  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
231  std::vector<int> parsedIntValues;
232  for (const auto& i : parsedValues) {
233  parsedIntValues.push_back(parse<int>(i));
234  }
235  return parsedIntValues;
236 }
237 
238 
239 template<> std::vector<double>
240 GNEAttributeCarrier::parse(const std::string& string) {
241  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
242  std::vector<double> parsedDoubleValues;
243  for (const auto& i : parsedValues) {
244  parsedDoubleValues.push_back(parse<double>(i));
245  }
246  return parsedDoubleValues;
247 }
248 
249 
250 template<> std::vector<bool>
251 GNEAttributeCarrier::parse(const std::string& string) {
252  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
253  std::vector<bool> parsedBoolValues;
254  for (const auto& i : parsedValues) {
255  parsedBoolValues.push_back(parse<bool>(i));
256  }
257  return parsedBoolValues;
258 }
259 
260 
261 template<> std::vector<GNEEdge*>
262 GNEAttributeCarrier::parse(GNENet* net, const std::string& value) {
263  // Declare string vector
264  std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
265  std::vector<GNEEdge*> parsedEdges;
266  // Iterate over edges IDs, retrieve Edges and add it into parsedEdges
267  for (const auto& i : edgeIds) {
268  GNEEdge* retrievedEdge = net->retrieveEdge(i, false);
269  if (retrievedEdge) {
270  parsedEdges.push_back(net->retrieveEdge(i));
271  } else {
272  throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_EDGES) + ". " + toString(SUMO_TAG_EDGE) + " '" + i + "' doesn't exist");
273  }
274  }
275  return parsedEdges;
276 }
277 
278 
279 template<> std::vector<GNELane*>
280 GNEAttributeCarrier::parse(GNENet* net, const std::string& value) {
281  // Declare string vector
282  std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
283  std::vector<GNELane*> parsedLanes;
284  // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes
285  for (const auto& i : laneIds) {
286  GNELane* retrievedLane = net->retrieveLane(i, false);
287  if (retrievedLane) {
288  parsedLanes.push_back(net->retrieveLane(i));
289  } else {
290  throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_LANES) + ". " + toString(SUMO_TAG_LANE) + " '" + i + "' doesn't exist");
291  }
292  }
293  return parsedLanes;
294 }
295 
296 
297 template<> std::string
298 GNEAttributeCarrier::parseIDs(const std::vector<GNEEdge*>& ACs) {
299  // obtain ID's of edges and return their join
300  std::vector<std::string> edgeIDs;
301  for (const auto& i : ACs) {
302  edgeIDs.push_back(i->getID());
303  }
304  return joinToString(edgeIDs, " ");
305 }
306 
307 
308 template<> std::string
309 GNEAttributeCarrier::parseIDs(const std::vector<GNELane*>& ACs) {
310  // obtain ID's of lanes and return their join
311  std::vector<std::string> laneIDs;
312  for (const auto& i : ACs) {
313  laneIDs.push_back(i->getID());
314  }
315  return joinToString(laneIDs, " ");
316 }
317 
318 
319 bool
320 GNEAttributeCarrier::lanesConsecutives(const std::vector<GNELane*>& lanes) {
321  // we need at least two lanes
322  if (lanes.size() > 1) {
323  // now check that lanes are consecutives (not neccesary connected)
324  int currentLane = 0;
325  while (currentLane < ((int)lanes.size() - 1)) {
326  int nextLane = -1;
327  // iterate over outgoing edges of destiny juntion of edge's lane
328  for (int i = 0; (i < (int)lanes.at(currentLane)->getParentEdge()->getParentJunctions().back()->getGNEOutgoingEdges().size()) && (nextLane == -1); i++) {
329  // iterate over lanes of outgoing edges of destiny juntion of edge's lane
330  for (int j = 0; (j < (int)lanes.at(currentLane)->getParentEdge()->getParentJunctions().back()->getGNEOutgoingEdges().at(i)->getLanes().size()) && (nextLane == -1); j++) {
331  // check if lane correspond to the next lane of "lanes"
332  if (lanes.at(currentLane)->getParentEdge()->getParentJunctions().back()->getGNEOutgoingEdges().at(i)->getLanes().at(j) == lanes.at(currentLane + 1)) {
333  nextLane = currentLane;
334  }
335  }
336  }
337  if (nextLane == -1) {
338  return false;
339  } else {
340  currentLane++;
341  }
342  }
343  return true;
344  } else {
345  return false;
346  }
347 }
348 
349 
350 template<> std::string
352  std::string result;
353  // Generate an string using the following structure: "key1=value1|key2=value2|...
354  for (const auto& parameter : getACParametersMap()) {
355  result += parameter.first + "=" + parameter.second + "|";
356  }
357  // remove the last "|"
358  if (!result.empty()) {
359  result.pop_back();
360  }
361  return result;
362 }
363 
364 
365 template<> std::vector<std::pair<std::string, std::string> >
367  std::vector<std::pair<std::string, std::string> > result;
368  // Generate a vector string using the following structure: "<key1,value1>, <key2, value2>,...
369  for (const auto& parameter : getACParametersMap()) {
370  result.push_back(std::make_pair(parameter.first, parameter.second));
371  }
372  return result;
373 }
374 
375 
376 void
377 GNEAttributeCarrier::setACParameters(const std::string& parameters, GNEUndoList* undoList) {
378  // declare map
379  std::map<std::string, std::string> parametersMap;
380  // separate value in a vector of string using | as separator
381  StringTokenizer parametersTokenizer(parameters, "|", true);
382  // iterate over all values
383  while (parametersTokenizer.hasNext()) {
384  // obtain key and value and save it in myParameters
385  const std::vector<std::string> keyValue = StringTokenizer(parametersTokenizer.next(), "=", true).getVector();
386  if (keyValue.size() == 2) {
387  parametersMap[keyValue.front()] = keyValue.back();
388  }
389  }
390  // set setACParameters map
391  setACParameters(parametersMap, undoList);
392 }
393 
394 
395 void
396 GNEAttributeCarrier::setACParameters(const std::vector<std::pair<std::string, std::string> >& parameters, GNEUndoList* undoList) {
397  // declare parametersMap
398  std::map<std::string, std::string> parametersMap;
399  // Generate an string using the following structure: "key1=value1|key2=value2|...
400  for (const auto& parameter : parameters) {
401  parametersMap[parameter.first] = parameter.second;
402  }
403  // set setACParameters map
404  setACParameters(parametersMap, undoList);
405 }
406 
407 
408 void
409 GNEAttributeCarrier::setACParameters(const std::map<std::string, std::string>& parameters, GNEUndoList* undoList) {
410  // declare result string
411  std::string paramsStr;
412  // Generate an string using the following structure: "key1=value1|key2=value2|...
413  for (const auto& parameter : parameters) {
414  paramsStr += parameter.first + "=" + parameter.second + "|";
415  }
416  // remove the last "|"
417  if (!paramsStr.empty()) {
418  paramsStr.pop_back();
419  }
420  // set parameters
421  setAttribute(GNE_ATTR_PARAMETERS, paramsStr, undoList);
422 }
423 
424 
425 void
426 GNEAttributeCarrier::addACParameters(const std::string& key, const std::string& attribute, GNEUndoList* undoList) {
427  // get parametersMap
428  std::map<std::string, std::string> parametersMap = getACParametersMap();
429  // add (or update) attribute
430  parametersMap[key] = attribute;
431  // set attribute
432  setACParameters(parametersMap, undoList);
433 }
434 
435 
436 void
437 GNEAttributeCarrier::removeACParametersKeys(const std::vector<std::string>& keepKeys, GNEUndoList* undoList) {
438  // declare parametersMap
439  std::map<std::string, std::string> newParametersMap;
440  // iterate over parameters map
441  for (const auto& parameter : getACParametersMap()) {
442  // copy to newParametersMap if key is in keepKeys
443  if (std::find(keepKeys.begin(), keepKeys.end(), parameter.first) != keepKeys.end()) {
444  newParametersMap.insert(parameter);
445  }
446  }
447  // set newParametersMap map
448  setACParameters(newParametersMap, undoList);
449 }
450 
451 
452 std::string
454  switch (key) {
455  // Crossings
458  return "No TLS";
459  // connections
460  case SUMO_ATTR_DIR: {
461  // special case for connection directions
462  std::string direction = getAttribute(key);
463  if (direction == "s") {
464  return "Straight (s)";
465  } else if (direction == "t") {
466  return "Turn (t))";
467  } else if (direction == "l") {
468  return "Left (l)";
469  } else if (direction == "r") {
470  return "Right (r)";
471  } else if (direction == "L") {
472  return "Partially left (L)";
473  } else if (direction == "R") {
474  return "Partially right (R)";
475  } else if (direction == "invalid") {
476  return "No direction (Invalid))";
477  } else {
478  return "undefined";
479  }
480  }
481  case SUMO_ATTR_STATE: {
482  // special case for connection states
483  std::string state = getAttribute(key);
484  if (state == "-") {
485  return "Dead end (-)";
486  } else if (state == "=") {
487  return "equal (=)";
488  } else if (state == "m") {
489  return "Minor link (m)";
490  } else if (state == "M") {
491  return "Major link (M)";
492  } else if (state == "O") {
493  return "TLS controller off (O)";
494  } else if (state == "o") {
495  return "TLS yellow flashing (o)";
496  } else if (state == "y") {
497  return "TLS yellow minor link (y)";
498  } else if (state == "Y") {
499  return "TLS yellow major link (Y)";
500  } else if (state == "r") {
501  return "TLS red (r)";
502  } else if (state == "g") {
503  return "TLS green minor (g)";
504  } else if (state == "G") {
505  return "TLS green major (G)";
506  } else {
507  return "undefined";
508  }
509  }
510  // flows
513  case SUMO_ATTR_PERIOD:
514  case SUMO_ATTR_PROB:
515  case SUMO_ATTR_END:
516  case SUMO_ATTR_NUMBER:
520  return "not together with number and period or probability";
521  } else {
522  return "not together with end and period or probability";
523  }
526  return "not together with number and period or probability";
527  } else {
528  return "not together with end and period or probability";
529  }
530  } else if (isAttributeEnabled(SUMO_ATTR_PERIOD)) {
532  return "not together with number and vehsPerHour or probability";
533  } else {
534  return "not together with end and vehsPerHour or probability";
535  }
536  } else if (isAttributeEnabled(SUMO_ATTR_PROB)) {
538  return "not together with number and vehsPerHour or period";
539  } else {
540  return "not together with end and vehsPerHour or period";
541  }
543  return "not together with end and number";
544  }
545  }
546  FALLTHROUGH;
547  default:
548  return getAttribute(key);
549  }
550 }
551 
552 
553 std::string
555  return getAttribute(key);
556 }
557 
558 
559 const std::string&
561  return myTagProperty.getTagStr();
562 }
563 
564 
565 const GNETagProperties&
567  return myTagProperty;
568 }
569 
570 
571 FXIcon*
573  // define on first access
574  if (myTagProperties.size() == 0) {
576  }
578 }
579 
580 // ===========================================================================
581 // static methods
582 // ===========================================================================
583 
584 const GNETagProperties&
586  if (tag == SUMO_TAG_NOTHING) {
587  return dummyTagProperty;
588  }
589  // define on first access
590  if (myTagProperties.size() == 0) {
592  }
593  // check that tag is defined
594  if (myTagProperties.count(tag) == 0) {
595  throw ProcessError("Attributes for tag '" + toString(tag) + "' not defined");
596  } else {
597  return myTagProperties.at(tag);
598  }
599 }
600 
601 
602 std::vector<SumoXMLTag>
603 GNEAttributeCarrier::allowedTags(const bool onlyDrawables) {
604  std::vector<SumoXMLTag> allTags;
605  // define on first access
606  if (myTagProperties.size() == 0) {
608  }
609  // fill all tags
610  for (const auto& i : myTagProperties) {
611  if (!onlyDrawables || i.second.isDrawable()) {
612  allTags.push_back(i.first);
613  }
614  }
615  return allTags;
616 }
617 
618 
619 std::vector<std::pair<SumoXMLTag, const std::string> >
620 GNEAttributeCarrier::getAllowedTagsByCategory(const int tagPropertyCategory, const bool onlyDrawables) {
621  std::vector<std::pair<SumoXMLTag, const std::string> > allowedTags;
622  // define on first access
623  if (myTagProperties.size() == 0) {
625  }
626  if (tagPropertyCategory & GNETagProperties::NETWORKELEMENT) {
627  // fill networkElements tags
628  for (const auto& tagProperty : myTagProperties) {
629  if (tagProperty.second.isNetworkElement() && (!onlyDrawables || tagProperty.second.isDrawable())) {
630  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
631  }
632  }
633  }
634  if (tagPropertyCategory & GNETagProperties::ADDITIONALELEMENT) {
635  // fill additional tags
636  for (const auto& tagProperty : myTagProperties) {
637  if (tagProperty.second.isAdditionalElement() && (!onlyDrawables || tagProperty.second.isDrawable())) {
638  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
639  }
640  }
641  }
642  if (tagPropertyCategory & GNETagProperties::SHAPE) {
643  // fill shape tags
644  for (const auto& tagProperty : myTagProperties) {
645  if (tagProperty.second.isShape() && (!onlyDrawables || tagProperty.second.isDrawable())) {
646  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
647  }
648  }
649  }
650  if (tagPropertyCategory & GNETagProperties::TAZELEMENT) {
651  // fill taz tags
652  for (const auto& tagProperty : myTagProperties) {
653  if (tagProperty.second.isTAZElement() && (!onlyDrawables || tagProperty.second.isDrawable())) {
654  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
655  }
656  }
657  }
658  if (tagPropertyCategory & GNETagProperties::DEMANDELEMENT) {
659  // fill demand tags
660  for (const auto& tagProperty : myTagProperties) {
661  if (tagProperty.second.isDemandElement() && (!onlyDrawables || tagProperty.second.isDrawable())) {
662  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
663  }
664  }
665  }
666  if (tagPropertyCategory & GNETagProperties::ROUTE) {
667  // fill route tags
668  for (const auto& tagProperty : myTagProperties) {
669  if (tagProperty.second.isRoute() && (!onlyDrawables || tagProperty.second.isDrawable())) {
670  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
671  }
672  }
673  }
674  if (tagPropertyCategory & GNETagProperties::VEHICLE) {
675  // fill vehicle tags (Special case)
676  allowedTags.push_back(std::make_pair(SUMO_TAG_TRIP, "trip"));
677  allowedTags.push_back(std::make_pair(SUMO_TAG_VEHICLE, "vehicle (over route)"));
678  allowedTags.push_back(std::make_pair(GNE_TAG_VEHICLE_WITHROUTE, "vehicle (embedded route)"));
679  allowedTags.push_back(std::make_pair(SUMO_TAG_FLOW, "flow (from-to)"));
680  allowedTags.push_back(std::make_pair(GNE_TAG_FLOW_ROUTE, "flow (over route)"));
681  allowedTags.push_back(std::make_pair(GNE_TAG_FLOW_WITHROUTE, "flow (embedded route)"));
682 
683  }
684  if (tagPropertyCategory & GNETagProperties::STOP) {
685  // fill stop tags
686  for (const auto& tagProperty : myTagProperties) {
687  if (tagProperty.second.isStop() && (!onlyDrawables || tagProperty.second.isDrawable())) {
688  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
689  }
690  }
691  }
692  if (tagPropertyCategory & GNETagProperties::PERSON) {
693  // fill person tags
694  for (const auto& tagProperty : myTagProperties) {
695  if (tagProperty.second.isPerson() && (!onlyDrawables || tagProperty.second.isDrawable())) {
696  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
697  }
698  }
699  }
700  if (tagPropertyCategory & GNETagProperties::PERSONPLAN) {
701  // fill person plan tags
702  for (const auto& tagProperty : myTagProperties) {
703  if (tagProperty.second.isPersonPlan() && (!onlyDrawables || tagProperty.second.isDrawable())) {
704  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
705  }
706  }
707  }
708  if (tagPropertyCategory & GNETagProperties::PERSONTRIP) {
709  // fill demand tags
710  for (const auto& tagProperty : myTagProperties) {
711  if (tagProperty.second.isPersonTrip() && (!onlyDrawables || tagProperty.second.isDrawable())) {
712  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
713  }
714  }
715  }
716  if (tagPropertyCategory & GNETagProperties::WALK) {
717  // fill demand tags
718  for (const auto& tagProperty : myTagProperties) {
719  if (tagProperty.second.isWalk() && (!onlyDrawables || tagProperty.second.isDrawable())) {
720  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
721  }
722  }
723  }
724  if (tagPropertyCategory & GNETagProperties::RIDE) {
725  // fill demand tags
726  for (const auto& tagProperty : myTagProperties) {
727  if (tagProperty.second.isRide() && (!onlyDrawables || tagProperty.second.isDrawable())) {
728  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
729  }
730  }
731  }
732  if (tagPropertyCategory & GNETagProperties::PERSONSTOP) {
733  // fill demand tags
734  for (const auto& tagProperty : myTagProperties) {
735  if (tagProperty.second.isPersonStop() && (!onlyDrawables || tagProperty.second.isDrawable())) {
736  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
737  }
738  }
739  }
740  if (tagPropertyCategory & GNETagProperties::GENERICDATA) {
741  // fill generic data tags
742  for (const auto& tagProperty : myTagProperties) {
743  if (tagProperty.second.isGenericData() && (!onlyDrawables || tagProperty.second.isDrawable())) {
744  allowedTags.push_back(std::make_pair(tagProperty.first, toString(tagProperty.first)));
745  }
746  }
747  }
748  return allowedTags;
749 }
750 
751 // ===========================================================================
752 // private
753 // ===========================================================================
754 
755 void
757  // fill all groups of ACs
759  fillAdditionals();
760  fillShapes();
761  fillTAZElements();
772  // check integrity of all Tags (function checkTagIntegrity() throw an exception if there is an inconsistency)
773  for (const auto& tagProperty : myTagProperties) {
774  tagProperty.second.checkTagIntegrity();
775  }
776 }
777 
778 
779 void
781  // declare empty GNEAttributeProperties
782  GNEAttributeProperties attrProperty;
783  // obtain Node Types except SumoXMLNodeType::DEAD_END_DEPRECATED
784  const OptionsCont& oc = OptionsCont::getOptions();
785  std::vector<std::string> nodeTypes = SUMOXMLDefinitions::NodeTypes.getStrings();
786  nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::DEAD_END_DEPRECATED)));
787  nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::DEAD_END)));
788  nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::INTERNAL)));
789  // fill networkElement ACs
790  SumoXMLTag currentTag = SUMO_TAG_JUNCTION;
791  {
792  // set values of tag
793  myTagProperties[currentTag] = GNETagProperties(currentTag,
797  // set values of attributes
798  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
800  "The id of the node");
801  myTagProperties[currentTag].addAttribute(attrProperty);
802 
804  GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::POSITION | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
805  "The x-y-z position of the node on the plane in meters");
806  myTagProperties[currentTag].addAttribute(attrProperty);
807 
808  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
810  "An optional type for the node");
811  attrProperty.setDiscreteValues(nodeTypes);
812  myTagProperties[currentTag].addAttribute(attrProperty);
813 
816  "A custom shape for that node");
817  myTagProperties[currentTag].addAttribute(attrProperty);
818 
821  "Optional turning radius (for all corners) for that node in meters",
822  "1.5");
823  myTagProperties[currentTag].addAttribute(attrProperty);
824 
827  "Whether the junction-blocking-heuristic should be activated at this node",
828  "1");
829  myTagProperties[currentTag].addAttribute(attrProperty);
830 
833  "How to compute right of way rules at this node",
835  attrProperty.setDiscreteValues(SUMOXMLDefinitions::RightOfWayValues.getStrings());
836  myTagProperties[currentTag].addAttribute(attrProperty);
837 
840  "Whether this junction is at the fringe of the network",
842  attrProperty.setDiscreteValues(SUMOXMLDefinitions::FringeTypeValues.getStrings());
843  myTagProperties[currentTag].addAttribute(attrProperty);
844 
845  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
847  "Optional name of " + toString(currentTag));
848  myTagProperties[currentTag].addAttribute(attrProperty);
849 
852  "An optional type for the traffic light algorithm");
854  myTagProperties[currentTag].addAttribute(attrProperty);
855 
858  "An optional layout for the traffic light plan");
863  myTagProperties[currentTag].addAttribute(attrProperty);
864 
865  attrProperty = GNEAttributeProperties(SUMO_ATTR_TLID,
867  "An optional id for the traffic light program");
868  myTagProperties[currentTag].addAttribute(attrProperty);
869  }
870  currentTag = SUMO_TAG_TYPE;
871  {
872  // set values of tag
873  myTagProperties[currentTag] = GNETagProperties(currentTag,
875  0,
876  GUIIcon::TYPE);
877  // set values of attributes
878  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
880  "The id of the edge");
881  myTagProperties[currentTag].addAttribute(attrProperty);
882 
885  "The number of lanes of the edge",
886  toString(oc.getInt("default.lanenumber")));
887  myTagProperties[currentTag].addAttribute(attrProperty);
888 
891  "The maximum speed allowed on the edge in m/s",
892  toString(oc.getFloat("default.speed")));
893  myTagProperties[currentTag].addAttribute(attrProperty);
894 
897  "Explicitly allows the given vehicle classes (not given will be not allowed)",
898  "all");
899  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
900  myTagProperties[currentTag].addAttribute(attrProperty);
901 
904  "Explicitly disallows the given vehicle classes (not given will be allowed)");
905  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
906  myTagProperties[currentTag].addAttribute(attrProperty);
907 
910  "The priority of the edge",
911  toString(oc.getInt("default.priority")));
912  myTagProperties[currentTag].addAttribute(attrProperty);
913 
916  "Lane width for all lanes of this edge in meters (used for visualization)",
917  "-1");
918  myTagProperties[currentTag].addAttribute(attrProperty);
919  }
920  currentTag = SUMO_TAG_LANETYPE;
921  {
922  // set values of tag
923  myTagProperties[currentTag] = GNETagProperties(currentTag,
925  0,
927  // set values of attributes
930  "The maximum speed allowed on the lane in m/s",
931  toString(oc.getFloat("default.speed")));
932  myTagProperties[currentTag].addAttribute(attrProperty);
933 
936  "Explicitly allows the given vehicle classes (not given will be not allowed)",
937  "all");
938  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
939  myTagProperties[currentTag].addAttribute(attrProperty);
940 
943  "Explicitly disallows the given vehicle classes (not given will be allowed)");
944  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
945  myTagProperties[currentTag].addAttribute(attrProperty);
946 
949  "Lane width for all lanes of this lane in meters (used for visualization)",
950  "-1");
951  myTagProperties[currentTag].addAttribute(attrProperty);
952  }
953  currentTag = SUMO_TAG_EDGE;
954  {
955  // set values of tag
956  myTagProperties[currentTag] = GNETagProperties(currentTag,
959  GUIIcon::EDGE);
960  // set values of attributes
961  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
963  "The id of the edge");
964  myTagProperties[currentTag].addAttribute(attrProperty);
965 
966  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
968  "The name of a node within the nodes-file the edge shall start at");
969  myTagProperties[currentTag].addAttribute(attrProperty);
970 
971  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
973  "The name of a node within the nodes-file the edge shall end at");
974  myTagProperties[currentTag].addAttribute(attrProperty);
975 
978  "The maximum speed allowed on the edge in m/s",
979  toString(oc.getFloat("default.speed")));
980  myTagProperties[currentTag].addAttribute(attrProperty);
981 
984  "The priority of the edge",
985  toString(oc.getInt("default.priority")));
986  myTagProperties[currentTag].addAttribute(attrProperty);
987 
990  "The number of lanes of the edge",
991  toString(oc.getInt("default.lanenumber")));
992  myTagProperties[currentTag].addAttribute(attrProperty);
993 
994  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
996  "The name of a type within the SUMO edge type file");
997  myTagProperties[currentTag].addAttribute(attrProperty);
998 
1001  "Explicitly allows the given vehicle classes (not given will be not allowed)",
1002  "all");
1003  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1004  myTagProperties[currentTag].addAttribute(attrProperty);
1005 
1008  "Explicitly disallows the given vehicle classes (not given will be allowed)");
1009  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1010  myTagProperties[currentTag].addAttribute(attrProperty);
1011 
1012  attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE,
1014  "If the shape is given it should start and end with the positions of the from-node and to-node");
1015  myTagProperties[currentTag].addAttribute(attrProperty);
1016 
1019  "The length of the edge in meter");
1020  myTagProperties[currentTag].addAttribute(attrProperty);
1021 
1024  "Lane width for all lanes of this edge in meters (used for visualization)",
1025  "right");
1027  myTagProperties[currentTag].addAttribute(attrProperty);
1028 
1029  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1031  "street name (need not be unique, used for visualization)");
1032  myTagProperties[currentTag].addAttribute(attrProperty);
1033 
1034  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
1036  "Lane width for all lanes of this edge in meters (used for visualization)",
1037  "-1");
1038  myTagProperties[currentTag].addAttribute(attrProperty);
1039 
1042  "Move the stop line back from the intersection by the given amount",
1043  "0");
1044  myTagProperties[currentTag].addAttribute(attrProperty);
1045 
1048  "Custom position in which shape start (by default position of junction from)");
1049  myTagProperties[currentTag].addAttribute(attrProperty);
1050 
1053  "Custom position in which shape end (by default position of junction from)");
1054  myTagProperties[currentTag].addAttribute(attrProperty);
1055 
1056  attrProperty = GNEAttributeProperties(GNE_ATTR_BIDIR,
1057  GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, // virtual attribute to check of this edge is part of a bidirectional railway (cannot be edited)
1058  "Show if edge is bidireccional",
1059  "0");
1060  myTagProperties[currentTag].addAttribute(attrProperty);
1061 
1064  "0");
1065  myTagProperties[currentTag].addAttribute(attrProperty);
1066 
1067  }
1068  currentTag = SUMO_TAG_LANE;
1069  {
1070  // set values of tag
1071  myTagProperties[currentTag] = GNETagProperties(currentTag,
1074  GUIIcon::LANE);
1075  // set values of attributes
1076  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1078  "ID of lane (Automatic, non editable)");
1079  myTagProperties[currentTag].addAttribute(attrProperty);
1080 
1081  attrProperty = GNEAttributeProperties(SUMO_ATTR_INDEX,
1083  "The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one)");
1084  myTagProperties[currentTag].addAttribute(attrProperty);
1085 
1086  attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED,
1088  "Speed in meters per second",
1089  "13.89");
1090  myTagProperties[currentTag].addAttribute(attrProperty);
1091 
1092  attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW,
1094  "Explicitly allows the given vehicle classes (not given will be not allowed)",
1095  "all");
1096  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1097  myTagProperties[currentTag].addAttribute(attrProperty);
1098 
1101  "Explicitly disallows the given vehicle classes (not given will be allowed)");
1102  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1103  myTagProperties[currentTag].addAttribute(attrProperty);
1104 
1105  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
1107  "Width in meters (used for visualization)",
1108  "-1");
1109  myTagProperties[currentTag].addAttribute(attrProperty);
1110 
1113  "Move the stop line back from the intersection by the given amount",
1114  "0");
1115  myTagProperties[currentTag].addAttribute(attrProperty);
1116 
1119  "Enable or disable lane as acceleration lane",
1120  "0");
1121  myTagProperties[currentTag].addAttribute(attrProperty);
1122 
1125  "If the shape is given it overrides the computation based on edge shape");
1126  myTagProperties[currentTag].addAttribute(attrProperty);
1127 
1130  "If given, this defines the opposite direction lane");
1131  myTagProperties[currentTag].addAttribute(attrProperty);
1132  }
1133  currentTag = SUMO_TAG_CROSSING;
1134  {
1135  // set values of tag
1136  myTagProperties[currentTag] = GNETagProperties(currentTag,
1140  // set values of attributes
1141  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1143  "The ID of Crossing");
1144  myTagProperties[currentTag].addAttribute(attrProperty);
1145 
1146  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES,
1148  "The (road) edges which are crossed");
1149  myTagProperties[currentTag].addAttribute(attrProperty);
1150 
1153  "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections)",
1154  "0");
1155  myTagProperties[currentTag].addAttribute(attrProperty);
1156 
1157  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
1159  "The width of the crossings",
1160  toString(OptionsCont::getOptions().getFloat("default.crossing-width")));
1161  myTagProperties[currentTag].addAttribute(attrProperty);
1162 
1165  "sets the tls-index for this crossing",
1166  "-1");
1167  myTagProperties[currentTag].addAttribute(attrProperty);
1168 
1171  "sets the opposite-direction tls-index for this crossing",
1172  "-1");
1173  myTagProperties[currentTag].addAttribute(attrProperty);
1174 
1177  "Overrids default shape of pedestrian crossing");
1178  myTagProperties[currentTag].addAttribute(attrProperty);
1179  }
1180  currentTag = SUMO_TAG_CONNECTION;
1181  {
1182  // set values of tag
1183  myTagProperties[currentTag] = GNETagProperties(currentTag,
1187  // set values of attributes
1188  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
1190  "The name of the edge the vehicles leave");
1191  myTagProperties[currentTag].addAttribute(attrProperty);
1192 
1193  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
1195  "The name of the edge the vehicles may reach when leaving 'from'");
1196  myTagProperties[currentTag].addAttribute(attrProperty);
1197 
1200  "the lane index of the incoming lane (numbers starting with 0)");
1201  myTagProperties[currentTag].addAttribute(attrProperty);
1202 
1205  "the lane index of the outgoing lane (numbers starting with 0)");
1206  myTagProperties[currentTag].addAttribute(attrProperty);
1207 
1208  attrProperty = GNEAttributeProperties(SUMO_ATTR_PASS,
1210  "if set, vehicles which pass this (lane-2-lane) connection) will not wait",
1211  "0");
1212  myTagProperties[currentTag].addAttribute(attrProperty);
1213 
1216  "if set to false, vehicles which pass this (lane-2-lane) connection) will not worry about blocking the intersection",
1217  "0");
1218  myTagProperties[currentTag].addAttribute(attrProperty);
1219 
1222  "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",
1224  myTagProperties[currentTag].addAttribute(attrProperty);
1225 
1228  "If set to true, This connection will not be TLS-controlled despite its node being controlled",
1229  "0");
1230  myTagProperties[currentTag].addAttribute(attrProperty);
1231 
1234  "Vision distance between vehicles",
1236  myTagProperties[currentTag].addAttribute(attrProperty);
1237 
1240  "sets index of this connection within the controlling trafficlight",
1241  "-1");
1242  myTagProperties[currentTag].addAttribute(attrProperty);
1243 
1246  "sets index for the internal junction of this connection within the controlling trafficlight",
1247  "-1");
1248  myTagProperties[currentTag].addAttribute(attrProperty);
1249 
1250  attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW,
1252  "Explicitly allows the given vehicle classes (not given will be not allowed)",
1253  "all");
1254  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1255  myTagProperties[currentTag].addAttribute(attrProperty);
1256 
1259  "Explicitly disallows the given vehicle classes (not given will be allowed)");
1260  attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1261  myTagProperties[currentTag].addAttribute(attrProperty);
1262 
1263  attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED,
1265  "sets custom speed limit for the connection",
1267  myTagProperties[currentTag].addAttribute(attrProperty);
1268 
1271  "sets custom length for the connection",
1273  myTagProperties[currentTag].addAttribute(attrProperty);
1274 
1277  "sets custom shape for the connection");
1278  myTagProperties[currentTag].addAttribute(attrProperty);
1279 
1280  attrProperty = GNEAttributeProperties(SUMO_ATTR_DIR,
1282  "turning direction for this connection (computed)");
1283  myTagProperties[currentTag].addAttribute(attrProperty);
1284 
1285  attrProperty = GNEAttributeProperties(SUMO_ATTR_STATE,
1287  "link state for this connection (computed)");
1288  myTagProperties[currentTag].addAttribute(attrProperty);
1289  }
1290  currentTag = GNE_TAG_INTERNAL_LANE;
1291  {
1292  // set values of tag
1293  myTagProperties[currentTag] = GNETagProperties(currentTag,
1297  // internal lanes don't have attributes
1298  }
1299 }
1300 
1301 
1302 void
1304  // declare empty GNEAttributeProperties
1305  GNEAttributeProperties attrProperty;
1306  // fill additional elements
1307  SumoXMLTag currentTag = SUMO_TAG_BUS_STOP;
1308  {
1309  // set values of tag
1310  myTagProperties[currentTag] = GNETagProperties(currentTag,
1314  // set values of attributes
1315  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1317  "The id of bus stop");
1318  myTagProperties[currentTag].addAttribute(attrProperty);
1319 
1320  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1322  "The name of the lane the bus stop shall be located at");
1323  myTagProperties[currentTag].addAttribute(attrProperty);
1324 
1327  "The begin position on the lane (the lower position on the lane) in meters");
1328 
1329  myTagProperties[currentTag].addAttribute(attrProperty);
1332  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
1333  myTagProperties[currentTag].addAttribute(attrProperty);
1334 
1335  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1337  "Name of " + toString(currentTag));
1338  myTagProperties[currentTag].addAttribute(attrProperty);
1339 
1342  "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",
1343  "0");
1344  myTagProperties[currentTag].addAttribute(attrProperty);
1345 
1346  attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES,
1348  "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes");
1349  myTagProperties[currentTag].addAttribute(attrProperty);
1350 
1353  "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes",
1354  "-1");
1355  myTagProperties[currentTag].addAttribute(attrProperty);
1356 
1359  "Optional space definition for vehicles that park at this stop",
1360  "0.00");
1361  myTagProperties[currentTag].addAttribute(attrProperty);
1362 
1363  }
1364  currentTag = SUMO_TAG_ACCESS;
1365  {
1366  // set values of tag
1367  myTagProperties[currentTag] = GNETagProperties(currentTag,
1371  // set values of attributes
1372  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1374  "The name of the lane the stop access shall be located at");
1375  myTagProperties[currentTag].addAttribute(attrProperty);
1376 
1379  "The position on the lane (the lower position on the lane) in meters",
1380  "0");
1381  myTagProperties[currentTag].addAttribute(attrProperty);
1382 
1385  "The walking length of the access in meters");
1386  myTagProperties[currentTag].addAttribute(attrProperty);
1387 
1390  "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",
1391  "0");
1392  myTagProperties[currentTag].addAttribute(attrProperty);
1393 
1394  }
1395  currentTag = SUMO_TAG_CONTAINER_STOP;
1396  {
1397  // set values of tag
1398  myTagProperties[currentTag] = GNETagProperties(currentTag,
1402  // set values of attributes
1403  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1405  "The id of container stop");
1406  myTagProperties[currentTag].addAttribute(attrProperty);
1407 
1408  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1410  "The name of the lane the container stop shall be located at");
1411  myTagProperties[currentTag].addAttribute(attrProperty);
1412 
1415  "The begin position on the lane (the lower position on the lane) in meters");
1416  myTagProperties[currentTag].addAttribute(attrProperty);
1417 
1420  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
1421  myTagProperties[currentTag].addAttribute(attrProperty);
1422 
1423  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1425  "Name of " + toString(currentTag));
1426  myTagProperties[currentTag].addAttribute(attrProperty);
1427 
1430  "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",
1431  "0");
1432  myTagProperties[currentTag].addAttribute(attrProperty);
1433 
1434  attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES,
1436  "meant to be the names of the bus lines that stop at this container stop. This is only used for visualization purposes");
1437  myTagProperties[currentTag].addAttribute(attrProperty);
1438  }
1439  currentTag = SUMO_TAG_CHARGING_STATION;
1440  {
1441  // set values of tag
1442  myTagProperties[currentTag] = GNETagProperties(currentTag,
1446  // set values of attributes
1447  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1449  "The id of charging station");
1450  myTagProperties[currentTag].addAttribute(attrProperty);
1451 
1452  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1454  "Lane of the charging station location");
1455  myTagProperties[currentTag].addAttribute(attrProperty);
1456 
1459  "Begin position in the specified lane");
1460  myTagProperties[currentTag].addAttribute(attrProperty);
1461 
1464  "End position in the specified lane");
1465  myTagProperties[currentTag].addAttribute(attrProperty);
1466 
1467  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1469  "Name of " + toString(currentTag));
1470  myTagProperties[currentTag].addAttribute(attrProperty);
1471 
1474  "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",
1475  "0");
1476  myTagProperties[currentTag].addAttribute(attrProperty);
1477 
1480  "Charging power in W",
1481  "22000.00");
1482  myTagProperties[currentTag].addAttribute(attrProperty);
1483 
1486  "Charging efficiency [0,1]",
1487  "0.95");
1488  attrProperty.setRange(0, 1);
1489  myTagProperties[currentTag].addAttribute(attrProperty);
1490 
1493  "Enable or disable charge in transit, i.e. vehicle must or must not to stop for charging",
1494  "0");
1495  myTagProperties[currentTag].addAttribute(attrProperty);
1496 
1499  "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins",
1500  "0.00");
1501  myTagProperties[currentTag].addAttribute(attrProperty);
1502  }
1503  currentTag = SUMO_TAG_PARKING_AREA;
1504  {
1505  // set values of tag
1506  myTagProperties[currentTag] = GNETagProperties(currentTag,
1510  // set values of attributes
1511  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1513  "The id of ParkingArea");
1514  myTagProperties[currentTag].addAttribute(attrProperty);
1515 
1516  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1518  "The name of the lane the Parking Area shall be located at");
1519  myTagProperties[currentTag].addAttribute(attrProperty);
1520 
1523  "The begin position on the lane (the lower position on the lane) in meters");
1524  myTagProperties[currentTag].addAttribute(attrProperty);
1525 
1528  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
1529  myTagProperties[currentTag].addAttribute(attrProperty);
1530 
1531  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1533  "Name of " + toString(currentTag));
1534  myTagProperties[currentTag].addAttribute(attrProperty);
1535 
1538  " The number of parking spaces for road-side parking",
1539  "0");
1540  myTagProperties[currentTag].addAttribute(attrProperty);
1541 
1544  "If set, vehicles will park on the road lane and thereby reducing capacity",
1545  "0");
1546  myTagProperties[currentTag].addAttribute(attrProperty);
1547 
1550  "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",
1551  "0");
1552  myTagProperties[currentTag].addAttribute(attrProperty);
1553 
1554  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
1556  "The width of the road-side parking spaces",
1557  "3.20");
1558  myTagProperties[currentTag].addAttribute(attrProperty);
1559 
1562  "The length of the road-side parking spaces. By default (endPos - startPos) / roadsideCapacity");
1563  myTagProperties[currentTag].addAttribute(attrProperty);
1564 
1565  attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE,
1567  "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise",
1568  "0.00");
1569  myTagProperties[currentTag].addAttribute(attrProperty);
1570 
1571  }
1572  currentTag = SUMO_TAG_PARKING_SPACE;
1573  {
1574  // set values of tag
1575  myTagProperties[currentTag] = GNETagProperties(currentTag,
1579  // set values of attributes
1581  GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::POSITION | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1582  "The x-y-z position of the parking vehicle on the plane");
1583  myTagProperties[currentTag].addAttribute(attrProperty);
1584 
1585  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
1587  "The width of the road-side parking spaces",
1588  "3.20");
1589  myTagProperties[currentTag].addAttribute(attrProperty);
1590 
1593  "The length of the road-side parking spaces",
1594  "5.00");
1595  myTagProperties[currentTag].addAttribute(attrProperty);
1596 
1597  attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE,
1599  "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise",
1600  "0.00");
1601  myTagProperties[currentTag].addAttribute(attrProperty);
1602 
1603  }
1604  currentTag = SUMO_TAG_E1DETECTOR;
1605  {
1606  // set values of tag
1607  myTagProperties[currentTag] = GNETagProperties(currentTag,
1610  GUIIcon::E1);
1611  // set values of attributes
1612  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1614  "The id of E1");
1615  myTagProperties[currentTag].addAttribute(attrProperty);
1616 
1617  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1619  "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
1620  myTagProperties[currentTag].addAttribute(attrProperty);
1621 
1624  "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");
1625  myTagProperties[currentTag].addAttribute(attrProperty);
1626 
1629  "The aggregation period the values the detector collects shall be summed up",
1630  "900.00");
1631  myTagProperties[currentTag].addAttribute(attrProperty);
1632 
1633  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1635  "Name of " + toString(currentTag));
1636  myTagProperties[currentTag].addAttribute(attrProperty);
1637 
1638  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
1640  "The path to the output file");
1641  myTagProperties[currentTag].addAttribute(attrProperty);
1642 
1645  "Space separated list of vehicle type ids to consider");
1646  myTagProperties[currentTag].addAttribute(attrProperty);
1647 
1650  "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",
1651  "0");
1652  myTagProperties[currentTag].addAttribute(attrProperty);
1653  }
1654  currentTag = SUMO_TAG_E2DETECTOR;
1655  {
1656  // set values of tag
1657  myTagProperties[currentTag] = GNETagProperties(currentTag,
1660  GUIIcon::E2);
1661  // set "file" as deprecated attribute
1662  myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT);
1663  // set values of attributes
1664  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1666  "The id of E2");
1667  myTagProperties[currentTag].addAttribute(attrProperty);
1668 
1669  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1671  "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
1672  myTagProperties[currentTag].addAttribute(attrProperty);
1673 
1676  "The position on the lane the detector shall be laid on in meters");
1677  myTagProperties[currentTag].addAttribute(attrProperty);
1678 
1681  "The length of the detector in meters",
1682  "10.00");
1683  myTagProperties[currentTag].addAttribute(attrProperty);
1684 
1687  "The aggregation period the values the detector collects shall be summed up");
1688  myTagProperties[currentTag].addAttribute(attrProperty);
1689 
1690  attrProperty = GNEAttributeProperties(SUMO_ATTR_TLID,
1692  "The traffic light that triggers aggregation when switching");
1693  myTagProperties[currentTag].addAttribute(attrProperty);
1694 
1695  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1697  "Name of " + toString(currentTag));
1698  myTagProperties[currentTag].addAttribute(attrProperty);
1699 
1700  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
1702  "The path to the output file");
1703  myTagProperties[currentTag].addAttribute(attrProperty);
1704 
1707  "Space separated list of vehicle type ids to consider");
1708  myTagProperties[currentTag].addAttribute(attrProperty);
1709 
1712  "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)",
1713  "1.00");
1714  myTagProperties[currentTag].addAttribute(attrProperty);
1715 
1718  "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
1719  "1.39");
1720  myTagProperties[currentTag].addAttribute(attrProperty);
1721 
1724  "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m",
1725  "10.00");
1726  myTagProperties[currentTag].addAttribute(attrProperty);
1727 
1730  "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",
1731  "0");
1732  myTagProperties[currentTag].addAttribute(attrProperty);
1733  }
1734  currentTag = SUMO_TAG_E2DETECTOR_MULTILANE;
1735  {
1736  // set values of tag
1737  myTagProperties[currentTag] = GNETagProperties(currentTag,
1741  // set "file" as deprecated attribute
1742  myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT);
1743  // set values of attributes
1744  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1746  "The id of Multilane E2");
1747  myTagProperties[currentTag].addAttribute(attrProperty);
1748 
1749  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANES,
1751  "The list of secuencial lane ids in which the detector shall be laid on");
1752  myTagProperties[currentTag].addAttribute(attrProperty);
1753 
1756  "The position on the lane the detector shall be laid on in meters");
1757  myTagProperties[currentTag].addAttribute(attrProperty);
1758 
1761  "The end position on the lane the detector shall be laid on in meters");
1762  myTagProperties[currentTag].addAttribute(attrProperty);
1763 
1766  "The aggregation period the values the detector collects shall be summed up");
1767  myTagProperties[currentTag].addAttribute(attrProperty);
1768 
1769  attrProperty = GNEAttributeProperties(SUMO_ATTR_TLID,
1771  "The traffic light that triggers aggregation when switching");
1772  myTagProperties[currentTag].addAttribute(attrProperty);
1773 
1774  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1776  "Name of " + toString(currentTag));
1777  myTagProperties[currentTag].addAttribute(attrProperty);
1778 
1779  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
1781  "The path to the output file");
1782  myTagProperties[currentTag].addAttribute(attrProperty);
1783 
1786  "Space separated list of vehicle type ids to consider");
1787  myTagProperties[currentTag].addAttribute(attrProperty);
1788 
1791  "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)",
1792  "1.00");
1793  myTagProperties[currentTag].addAttribute(attrProperty);
1794 
1797  "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
1798  "1.39");
1799  myTagProperties[currentTag].addAttribute(attrProperty);
1800 
1803  "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m",
1804  "10.00");
1805  myTagProperties[currentTag].addAttribute(attrProperty);
1806 
1809  "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",
1810  "0");
1811  myTagProperties[currentTag].addAttribute(attrProperty);
1812 
1813  }
1814  currentTag = SUMO_TAG_E3DETECTOR;
1815  {
1816  // set values of tag
1817  myTagProperties[currentTag] = GNETagProperties(currentTag,
1820  GUIIcon::E3);
1821  // set values of attributes
1822  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1824  "The id of E3");
1825  myTagProperties[currentTag].addAttribute(attrProperty);
1826 
1829  "X-Y position of detector in editor (Only used in NETEDIT)",
1830  "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1831  myTagProperties[currentTag].addAttribute(attrProperty);
1832 
1835  "The aggregation period the values the detector collects shall be summed up",
1836  "900.00");
1837  myTagProperties[currentTag].addAttribute(attrProperty);
1838 
1839  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1841  "Name of " + toString(currentTag));
1842  myTagProperties[currentTag].addAttribute(attrProperty);
1843 
1844  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
1846  "The path to the output file");
1847  myTagProperties[currentTag].addAttribute(attrProperty);
1848 
1851  "Space separated list of vehicle type ids to consider");
1852  myTagProperties[currentTag].addAttribute(attrProperty);
1853 
1856  "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting) in s",
1857  "1.00");
1858  myTagProperties[currentTag].addAttribute(attrProperty);
1859 
1862  "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
1863  "1.39");
1864  myTagProperties[currentTag].addAttribute(attrProperty);
1865  }
1866  currentTag = SUMO_TAG_DET_ENTRY;
1867  {
1868  // set values of tag
1869  myTagProperties[currentTag] = GNETagProperties(currentTag,
1873  // set values of attributes
1874  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1876  "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
1877  myTagProperties[currentTag].addAttribute(attrProperty);
1878 
1881  "The position on the lane the detector shall be laid on in meters");
1882  myTagProperties[currentTag].addAttribute(attrProperty);
1883 
1886  "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",
1887  "0");
1888  myTagProperties[currentTag].addAttribute(attrProperty);
1889 
1890  }
1891  currentTag = SUMO_TAG_DET_EXIT;
1892  {
1893  // set values of tag
1894  myTagProperties[currentTag] = GNETagProperties(currentTag,
1898  // set values of attributes
1899  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1901  "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
1902  myTagProperties[currentTag].addAttribute(attrProperty);
1903 
1906  "The position on the lane the detector shall be laid on in meters");
1907  myTagProperties[currentTag].addAttribute(attrProperty);
1908 
1911  "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",
1912  "0");
1913  myTagProperties[currentTag].addAttribute(attrProperty);
1914 
1915  }
1916  currentTag = SUMO_TAG_INSTANT_INDUCTION_LOOP;
1917  {
1918  // set values of tag
1919  myTagProperties[currentTag] = GNETagProperties(currentTag,
1923  // set values of attributes
1924  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1926  "The id of Instant Induction Loop (E1Instant)");
1927  myTagProperties[currentTag].addAttribute(attrProperty);
1928 
1929  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
1931  "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
1932  myTagProperties[currentTag].addAttribute(attrProperty);
1933 
1936  "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");
1937  myTagProperties[currentTag].addAttribute(attrProperty);
1938 
1939  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1941  "Name of " + toString(currentTag));
1942  myTagProperties[currentTag].addAttribute(attrProperty);
1943 
1944  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
1946  "The path to the output file");
1947  myTagProperties[currentTag].addAttribute(attrProperty);
1948 
1951  "Space separated list of vehicle type ids to consider");
1952  myTagProperties[currentTag].addAttribute(attrProperty);
1953 
1956  "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",
1957  "0");
1958  myTagProperties[currentTag].addAttribute(attrProperty);
1959 
1960  }
1961  currentTag = SUMO_TAG_VSS;
1962  {
1963  // set values of tag
1964  myTagProperties[currentTag] = GNETagProperties(currentTag,
1968  // set "file" as deprecated attribute
1969  myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_FILE);
1970  // set values of attributes
1971  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
1973  "The id of Variable Speed Signal");
1974  myTagProperties[currentTag].addAttribute(attrProperty);
1975 
1978  "X-Y position of detector in editor (Only used in NETEDIT)",
1979  "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1980  myTagProperties[currentTag].addAttribute(attrProperty);
1981 
1982  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANES,
1984  "list of lanes of Variable Speed Sign");
1985  myTagProperties[currentTag].addAttribute(attrProperty);
1986 
1987  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
1989  "Name of " + toString(currentTag));
1990  myTagProperties[currentTag].addAttribute(attrProperty);
1991  }
1992  currentTag = GNE_TAG_VSS_SYMBOL;
1993  {
1994  // set values of tag
1995  myTagProperties[currentTag] = GNETagProperties(currentTag,
1999  }
2000  currentTag = SUMO_TAG_STEP;
2001  {
2002  // set values of tag
2003  myTagProperties[currentTag] = GNETagProperties(currentTag,
2007  // set values of attributes
2008  attrProperty = GNEAttributeProperties(SUMO_ATTR_TIME,
2010  "Time");
2011  myTagProperties[currentTag].addAttribute(attrProperty);
2012 
2013  attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED,
2015  "Speed",
2016  "13.89");
2017  myTagProperties[currentTag].addAttribute(attrProperty);
2018  }
2019  currentTag = SUMO_TAG_CALIBRATOR;
2020  {
2021  // set values of tag
2022  myTagProperties[currentTag] = GNETagProperties(currentTag,
2026  // set values of attributes
2027  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2029  "The id of Calibrator");
2030  myTagProperties[currentTag].addAttribute(attrProperty);
2031 
2032  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
2034  "The id of edge in the simulation network");
2035  myTagProperties[currentTag].addAttribute(attrProperty);
2036 
2039  "The position of the calibrator on the specified lane",
2040  "0");
2041  myTagProperties[currentTag].addAttribute(attrProperty);
2042 
2045  "The aggregation interval in which to calibrate the flows. Default is step-length",
2046  "1.00");
2047  myTagProperties[currentTag].addAttribute(attrProperty);
2048 
2049  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
2051  "Name of " + toString(currentTag));
2052  myTagProperties[currentTag].addAttribute(attrProperty);
2053 
2056  "The id of the routeProbe element from which to determine the route distribution for generated vehicles");
2057  myTagProperties[currentTag].addAttribute(attrProperty);
2058 
2061  "The output file for writing calibrator information or NULL");
2062  myTagProperties[currentTag].addAttribute(attrProperty);
2063  }
2064  currentTag = SUMO_TAG_LANECALIBRATOR;
2065  {
2066  // set values of tag
2067  myTagProperties[currentTag] = GNETagProperties(currentTag,
2071  // set values of attributes
2072  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2074  "The id of Calibrator");
2075  myTagProperties[currentTag].addAttribute(attrProperty);
2076 
2077  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
2079  "The id of lane in the simulation network");
2080  myTagProperties[currentTag].addAttribute(attrProperty);
2081 
2084  "The position of the calibrator on the specified lane",
2085  "0");
2086  myTagProperties[currentTag].addAttribute(attrProperty);
2087 
2090  "The aggregation interval in which to calibrate the flows. Default is step-length",
2091  "100.00");
2092  myTagProperties[currentTag].addAttribute(attrProperty);
2093 
2094  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
2096  "Name of " + toString(currentTag));
2097  myTagProperties[currentTag].addAttribute(attrProperty);
2098 
2101  "The id of the routeProbe element from which to determine the route distribution for generated vehicles");
2102  myTagProperties[currentTag].addAttribute(attrProperty);
2103 
2106  "The output file for writing calibrator information or NULL");
2107  myTagProperties[currentTag].addAttribute(attrProperty);
2108  }
2109  currentTag = SUMO_TAG_FLOW_CALIBRATOR;
2110  {
2111  // set values of tag
2112  myTagProperties[currentTag] = GNETagProperties(currentTag,
2116  // set values of attributes
2117  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
2119  "The id of the vehicle type to use for this " + toString(currentTag),
2121  myTagProperties[currentTag].addAttribute(attrProperty);
2122 
2123  attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE,
2125  "The id of the route the vehicle shall drive along");
2126  myTagProperties[currentTag].addAttribute(attrProperty);
2127 
2128  // fill common vehicle attributes
2129  fillCommonVehicleAttributes(currentTag);
2130 
2131  attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN,
2133  "First " + toString(currentTag) + " departure time",
2134  "0.00");
2135  myTagProperties[currentTag].addAttribute(attrProperty);
2136 
2137  attrProperty = GNEAttributeProperties(SUMO_ATTR_END,
2139  "End of departure interval",
2140  "3600.00");
2141  myTagProperties[currentTag].addAttribute(attrProperty);
2142 
2145  "Number of " + toString(currentTag) + "s per hour, equally spaced");
2146  myTagProperties[currentTag].addAttribute(attrProperty);
2147 
2148  attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED,
2150  "Speed of " + toString(currentTag) + "s");
2151  myTagProperties[currentTag].addAttribute(attrProperty);
2152  }
2153  currentTag = SUMO_TAG_REROUTER;
2154  {
2155  // set values of tag
2156  myTagProperties[currentTag] = GNETagProperties(currentTag,
2160  // set values of attributes
2161  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2163  "The id of Rerouter");
2164  myTagProperties[currentTag].addAttribute(attrProperty);
2165 
2166  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES,
2168  "An edge id or a list of edge ids where vehicles shall be rerouted");
2169  myTagProperties[currentTag].addAttribute(attrProperty);
2170 
2173  "X,Y position in editor (Only used in NETEDIT)",
2174  "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2175  myTagProperties[currentTag].addAttribute(attrProperty);
2176 
2177  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
2179  "Name of " + toString(currentTag));
2180  myTagProperties[currentTag].addAttribute(attrProperty);
2181 
2182  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
2184  "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)");
2185  myTagProperties[currentTag].addAttribute(attrProperty);
2186 
2187  attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
2189  "The probability for vehicle rerouting (0-1)",
2190  "1.00");
2191  myTagProperties[currentTag].addAttribute(attrProperty);
2192 
2195  "The waiting time threshold (in s) that must be reached to activate rerouting (default -1 which disables the threshold)",
2196  "0.00");
2197  myTagProperties[currentTag].addAttribute(attrProperty);
2198 
2201  "The list of vehicle types that shall be affected by this rerouter (empty to affect all types)");
2202  myTagProperties[currentTag].addAttribute(attrProperty);
2203 
2204  attrProperty = GNEAttributeProperties(SUMO_ATTR_OFF,
2206  "Whether the router should be inactive initially (and switched on in the gui)",
2207  "0");
2208  myTagProperties[currentTag].addAttribute(attrProperty);
2209  }
2210  currentTag = GNE_TAG_REROUTER_SYMBOL;
2211  {
2212  // set values of tag
2213  myTagProperties[currentTag] = GNETagProperties(currentTag,
2217  }
2218  currentTag = SUMO_TAG_INTERVAL;
2219  {
2220  // set values of tag
2221  myTagProperties[currentTag] = GNETagProperties(currentTag,
2225  // set values of attributes
2226  attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN,
2228  "Begin",
2229  "0");
2230  myTagProperties[currentTag].addAttribute(attrProperty);
2231 
2232  attrProperty = GNEAttributeProperties(SUMO_ATTR_END,
2234  "End",
2235  "3600.00");
2236  myTagProperties[currentTag].addAttribute(attrProperty);
2237  }
2238  currentTag = SUMO_TAG_CLOSING_REROUTE;
2239  {
2240  // set values of tag
2241  myTagProperties[currentTag] = GNETagProperties(currentTag,
2245  // set values of attributes
2246  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
2248  "Edge ID");
2249  attrProperty.setSynonym(SUMO_ATTR_ID);
2250  myTagProperties[currentTag].addAttribute(attrProperty);
2251 
2252  attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW,
2254  "allowed vehicles");
2255  myTagProperties[currentTag].addAttribute(attrProperty);
2256 
2259  "disallowed vehicles");
2260  myTagProperties[currentTag].addAttribute(attrProperty);
2261  }
2262  currentTag = SUMO_TAG_CLOSING_LANE_REROUTE;
2263  {
2264  // set values of tag
2265  myTagProperties[currentTag] = GNETagProperties(currentTag,
2269  // set values of attributes
2270  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
2272  "Lane ID");
2273  attrProperty.setSynonym(SUMO_ATTR_ID);
2274  myTagProperties[currentTag].addAttribute(attrProperty);
2275 
2276  attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW,
2278  "allowed vehicles");
2279  myTagProperties[currentTag].addAttribute(attrProperty);
2280 
2283  "disallowed vehicles");
2284  myTagProperties[currentTag].addAttribute(attrProperty);
2285  }
2286  currentTag = SUMO_TAG_DEST_PROB_REROUTE;
2287  {
2288  // set values of tag
2289  myTagProperties[currentTag] = GNETagProperties(currentTag,
2293  // set values of attributes
2294  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
2296  "Edge ID");
2297  attrProperty.setSynonym(SUMO_ATTR_ID);
2298  myTagProperties[currentTag].addAttribute(attrProperty);
2299 
2300  attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
2302  "SUMO Probability",
2303  "1.00");
2304  myTagProperties[currentTag].addAttribute(attrProperty);
2305  }
2306  currentTag = SUMO_TAG_PARKING_ZONE_REROUTE;
2307  {
2308  // set values of tag
2309  myTagProperties[currentTag] = GNETagProperties(currentTag,
2313  // set values of attributes
2316  "ParkingArea ID");
2317  attrProperty.setSynonym(SUMO_ATTR_ID);
2318  myTagProperties[currentTag].addAttribute(attrProperty);
2319 
2320  attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
2322  "SUMO Probability",
2323  "1.00");
2324  myTagProperties[currentTag].addAttribute(attrProperty);
2325 
2328  "Enable or disable visibility for parking area reroutes",
2329  "1");
2330  myTagProperties[currentTag].addAttribute(attrProperty);
2331  }
2332  currentTag = SUMO_TAG_ROUTE_PROB_REROUTE;
2333  {
2334  // set values of tag
2335  myTagProperties[currentTag] = GNETagProperties(currentTag,
2339  // set values of attributes
2340  attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE,
2342  "Route");
2343  attrProperty.setSynonym(SUMO_ATTR_ID);
2344  myTagProperties[currentTag].addAttribute(attrProperty);
2345 
2346  attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
2348  "SUMO Probability",
2349  "1.00");
2350  myTagProperties[currentTag].addAttribute(attrProperty);
2351  }
2352  currentTag = SUMO_TAG_ROUTEPROBE;
2353  {
2354  // set values of tag
2355  myTagProperties[currentTag] = GNETagProperties(currentTag,
2359  // set values of attributes
2360  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2362  "The id of RouteProbe");
2363  myTagProperties[currentTag].addAttribute(attrProperty);
2364 
2365  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
2367  "The id of an edge in the simulation network");
2368  myTagProperties[currentTag].addAttribute(attrProperty);
2369 
2372  "The frequency in which to report the distribution",
2373  "3600");
2374  myTagProperties[currentTag].addAttribute(attrProperty);
2375 
2376  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
2378  "Name of " + toString(currentTag));
2379  myTagProperties[currentTag].addAttribute(attrProperty);
2380 
2381  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE,
2383  "The file for generated output");
2384  myTagProperties[currentTag].addAttribute(attrProperty);
2385 
2386  attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN,
2388  "The time at which to start generating output",
2389  "0");
2390  myTagProperties[currentTag].addAttribute(attrProperty);
2391  }
2392  currentTag = SUMO_TAG_VAPORIZER;
2393  {
2394  // set values of tag
2395  myTagProperties[currentTag] = GNETagProperties(currentTag,
2399  // set values of attributes
2400  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2402  "Edge in which vaporizer is placed");
2403  myTagProperties[currentTag].addAttribute(attrProperty);
2404 
2405  attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN,
2407  "Start Time",
2408  "0");
2409  myTagProperties[currentTag].addAttribute(attrProperty);
2410 
2411  attrProperty = GNEAttributeProperties(SUMO_ATTR_END,
2413  "End Time",
2414  "3600.00");
2415  myTagProperties[currentTag].addAttribute(attrProperty);
2416 
2417  attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME,
2419  "Name of " + toString(currentTag));
2420  myTagProperties[currentTag].addAttribute(attrProperty);
2421  }
2422 }
2423 
2424 
2425 void
2427  // declare empty GNEAttributeProperties
2428  GNEAttributeProperties attrProperty;
2429  // fill shape ACs
2430  SumoXMLTag currentTag = SUMO_TAG_POLY;
2431  {
2432  // set values of tag
2433  myTagProperties[currentTag] = GNETagProperties(currentTag,
2436  GUIIcon::LOCATEPOLY /* temporal */);
2437  // set values of attributes
2438  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2440  "The id of the polygon");
2441  myTagProperties[currentTag].addAttribute(attrProperty);
2442 
2443  attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE,
2445  "The shape of the polygon");
2446  myTagProperties[currentTag].addAttribute(attrProperty);
2447 
2448  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2450  "The RGBA color with which the polygon shall be displayed",
2451  "red");
2452  myTagProperties[currentTag].addAttribute(attrProperty);
2453 
2454  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILL,
2456  "An information whether the polygon shall be filled",
2457  "0");
2458  myTagProperties[currentTag].addAttribute(attrProperty);
2459 
2462  "The default line width for drawing an unfilled polygon",
2463  "1");
2464  myTagProperties[currentTag].addAttribute(attrProperty);
2465 
2466  attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER,
2468  "The layer in which the polygon lies",
2470  myTagProperties[currentTag].addAttribute(attrProperty);
2471 
2472  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
2474  "A typename for the polygon",
2476  myTagProperties[currentTag].addAttribute(attrProperty);
2477 
2480  "A bitmap to use for rendering this polygon",
2482  myTagProperties[currentTag].addAttribute(attrProperty);
2483 
2486  "Enable or disable use image file as a relative path",
2488  myTagProperties[currentTag].addAttribute(attrProperty);
2489 
2490  attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE,
2492  "Angle of rendered image in degree",
2494  myTagProperties[currentTag].addAttribute(attrProperty);
2495  }
2496  currentTag = SUMO_TAG_POI;
2497  {
2498  // set values of tag
2499  myTagProperties[currentTag] = GNETagProperties(currentTag,
2502  GUIIcon::LOCATEPOI /* temporal */);
2503  // set values of attributes
2504  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2506  "The id of the " + toString(currentTag));
2507  myTagProperties[currentTag].addAttribute(attrProperty);
2508 
2510  GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2511  "The position in view");
2512  myTagProperties[currentTag].addAttribute(attrProperty);
2513 
2514  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2516  "The color with which the " + toString(currentTag) + " shall be displayed",
2517  "red");
2518  myTagProperties[currentTag].addAttribute(attrProperty);
2519 
2520  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
2522  "A typename for the " + toString(currentTag),
2524  myTagProperties[currentTag].addAttribute(attrProperty);
2525 
2526  attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER,
2528  "The layer of the " + toString(currentTag) + " for drawing and selecting",
2530  myTagProperties[currentTag].addAttribute(attrProperty);
2531 
2532  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
2534  "Width of rendered image in meters",
2536  myTagProperties[currentTag].addAttribute(attrProperty);
2537 
2540  "Height of rendered image in meters",
2542  myTagProperties[currentTag].addAttribute(attrProperty);
2543 
2546  "A bitmap to use for rendering this " + toString(currentTag),
2548  myTagProperties[currentTag].addAttribute(attrProperty);
2549 
2552  "Enable or disable use image file as a relative path",
2554  myTagProperties[currentTag].addAttribute(attrProperty);
2555 
2556  attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE,
2558  "Angle of rendered image in degree",
2560  myTagProperties[currentTag].addAttribute(attrProperty);
2561  }
2562  currentTag = SUMO_TAG_POILANE;
2563  {
2564  // set values of tag
2565  myTagProperties[currentTag] = GNETagProperties(currentTag,
2568  GUIIcon::LOCATEPOI /* temporal */);
2569  // set values of attributes
2570  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2572  "The id of the " + toString(currentTag));
2573  myTagProperties[currentTag].addAttribute(attrProperty);
2574 
2575  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
2577  "The name of the lane at which the " + toString(currentTag) + " is located at");
2578  myTagProperties[currentTag].addAttribute(attrProperty);
2579 
2582  "The position on the named lane or in the net in meters at which the " + toString(currentTag) + " is located at");
2583  myTagProperties[currentTag].addAttribute(attrProperty);
2584 
2587  "The lateral offset on the named lane at which the " + toString(currentTag) + " is located at",
2588  "0.00");
2589  myTagProperties[currentTag].addAttribute(attrProperty);
2590 
2591  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2593  "The color with which the " + toString(currentTag) + " shall be displayed",
2594  "red");
2595  myTagProperties[currentTag].addAttribute(attrProperty);
2596 
2597  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
2599  "A typename for the " + toString(currentTag),
2601  myTagProperties[currentTag].addAttribute(attrProperty);
2602 
2603  attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER,
2605  "The layer of the " + toString(currentTag) + " for drawing and selecting",
2607  myTagProperties[currentTag].addAttribute(attrProperty);
2608 
2609  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
2611  "Width of rendered image in meters",
2613  myTagProperties[currentTag].addAttribute(attrProperty);
2614 
2617  "Height of rendered image in meters",
2619  myTagProperties[currentTag].addAttribute(attrProperty);
2620 
2623  "A bitmap to use for rendering this " + toString(currentTag),
2625  myTagProperties[currentTag].addAttribute(attrProperty);
2626 
2629  "Enable or disable use image file as a relative path",
2631  myTagProperties[currentTag].addAttribute(attrProperty);
2632 
2633  attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE,
2635  "Angle of rendered image in degree",
2637  myTagProperties[currentTag].addAttribute(attrProperty);
2638  }
2639 }
2640 
2641 
2642 void
2644  // declare empty GNEAttributeProperties
2645  GNEAttributeProperties attrProperty;
2646  // fill TAZ ACs
2647  SumoXMLTag currentTag = SUMO_TAG_TAZ;
2648  {
2649  // set values of tag
2650  myTagProperties[currentTag] = GNETagProperties(currentTag,
2653  GUIIcon::TAZ);
2654  // set values of attributes
2655  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2657  "The id of the TAZ");
2658  myTagProperties[currentTag].addAttribute(attrProperty);
2659 
2660  attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE,
2662  "The shape of the TAZ");
2663  myTagProperties[currentTag].addAttribute(attrProperty);
2664 
2665  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2667  "The RGBA color with which the TAZ shall be displayed",
2668  "red");
2669  myTagProperties[currentTag].addAttribute(attrProperty);
2670 
2671  attrProperty = GNEAttributeProperties(SUMO_ATTR_FILL,
2673  "An information whether the TAZ shall be filled (Only in NETEDIT)",
2674  "0");
2675  myTagProperties[currentTag].addAttribute(attrProperty);
2676  }
2677  currentTag = SUMO_TAG_TAZSOURCE;
2678  {
2679  // set values of tag
2680  myTagProperties[currentTag] = GNETagProperties(currentTag,
2684  // set values of attributes
2685  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
2687  "The id of edge in the simulation network");
2688  attrProperty.setSynonym(SUMO_ATTR_ID);
2689  myTagProperties[currentTag].addAttribute(attrProperty);
2690 
2693  "Depart weight associated to this Edge",
2694  "1");
2695  myTagProperties[currentTag].addAttribute(attrProperty);
2696  }
2697  currentTag = SUMO_TAG_TAZSINK;
2698  {
2699  // set values of tag
2700  myTagProperties[currentTag] = GNETagProperties(currentTag,
2704  // set values of attributes
2705  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
2707  "The id of edge in the simulation network");
2708  attrProperty.setSynonym(SUMO_ATTR_ID);
2709  myTagProperties[currentTag].addAttribute(attrProperty);
2710 
2713  "Arrival weight associated to this Edget",
2714  "1");
2715  myTagProperties[currentTag].addAttribute(attrProperty);
2716  }
2717 }
2718 
2719 
2720 void
2722  // first VClass separate between vehicles and persons
2723  std::vector<std::string> vClassesVehicles, vClassesPersons;
2724  auto vClasses = SumoVehicleClassStrings.getStrings();
2725  for (const auto& i : vClasses) {
2726  if (i == SumoVehicleClassStrings.getString(SVC_PEDESTRIAN)) {
2727  vClassesPersons.push_back(i);
2728  } else {
2729  vClassesVehicles.push_back(i);
2730  }
2731  }
2732  // declare empty GNEAttributeProperties
2733  GNEAttributeProperties attrProperty;
2734 
2735  // fill demand elements
2736  SumoXMLTag currentTag = SUMO_TAG_ROUTE;
2737  {
2738  // set values of tag
2739  myTagProperties[currentTag] = GNETagProperties(currentTag,
2742  GUIIcon::ROUTE);
2743 
2744  // set values of attributes
2745  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2747  "The id of Route");
2748  myTagProperties[currentTag].addAttribute(attrProperty);
2749 
2750  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES,
2752  "The edges the vehicle shall drive along, given as their ids, separated using spaces");
2753  myTagProperties[currentTag].addAttribute(attrProperty);
2754 
2755  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2757  "This route's color",
2758  "yellow");
2759  myTagProperties[currentTag].addAttribute(attrProperty);
2760  }
2761  currentTag = GNE_TAG_ROUTE_EMBEDDED;
2762  {
2763  // set values of tag
2764  myTagProperties[currentTag] = GNETagProperties(currentTag,
2768 
2769  // set values of attributes
2770  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES,
2772  "The edges the vehicle shall drive along, given as their ids, separated using spaces");
2773  myTagProperties[currentTag].addAttribute(attrProperty);
2774 
2775  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2777  "This route's color",
2778  "yellow");
2779  myTagProperties[currentTag].addAttribute(attrProperty);
2780  }
2781  currentTag = SUMO_TAG_VTYPE;
2782  {
2783  // set values of tag
2784  myTagProperties[currentTag] = GNETagProperties(currentTag,
2786  GUIIcon::VTYPE);
2787 
2788  // set values of attributes
2789  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2791  "The id of VehicleType");
2792  myTagProperties[currentTag].addAttribute(attrProperty);
2793 
2796  "An abstract vehicle class",
2797  "passenger");
2798  attrProperty.setDiscreteValues(vClassesVehicles);
2799  myTagProperties[currentTag].addAttribute(attrProperty);
2800 
2801  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2803  "This vehicle type's color",
2804  "");
2805  myTagProperties[currentTag].addAttribute(attrProperty);
2806 
2809  "The vehicle's netto-length (length) [m]");
2810  myTagProperties[currentTag].addAttribute(attrProperty);
2811 
2814  "Empty space after leader [m]");
2815  myTagProperties[currentTag].addAttribute(attrProperty);
2816 
2819  "The vehicle's maximum velocity [m/s]");
2820  myTagProperties[currentTag].addAttribute(attrProperty);
2821 
2824  "The vehicles expected multiplicator for lane speed limits");
2825  myTagProperties[currentTag].addAttribute(attrProperty);
2826 
2829  "The deviation of the speedFactor");
2830  myTagProperties[currentTag].addAttribute(attrProperty);
2831 
2834  "An abstract emission class");
2836  myTagProperties[currentTag].addAttribute(attrProperty);
2837 
2840  "How this vehicle is rendered");
2841  attrProperty.setDiscreteValues(SumoVehicleShapeStrings.getStrings());
2842  myTagProperties[currentTag].addAttribute(attrProperty);
2843 
2844  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
2846  "The vehicle's width [m] (only used for drawing)",
2847  "1.8");
2848  myTagProperties[currentTag].addAttribute(attrProperty);
2849 
2852  "The vehicle's height [m] (only used for drawing)",
2853  "1.5");
2854  myTagProperties[currentTag].addAttribute(attrProperty);
2855 
2858  "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)");
2859  myTagProperties[currentTag].addAttribute(attrProperty);
2860 
2863  "The model used for changing lanes",
2864  "default");
2865  attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneChangeModels.getStrings());
2866  myTagProperties[currentTag].addAttribute(attrProperty);
2867 
2870  "The model used for car following",
2871  "Krauss");
2872  attrProperty.setDiscreteValues(SUMOXMLDefinitions::CarFollowModels.getStrings());
2873  myTagProperties[currentTag].addAttribute(attrProperty);
2874 
2877  "The number of persons (excluding an autonomous driver) the vehicle can transport");
2878  myTagProperties[currentTag].addAttribute(attrProperty);
2879 
2882  "The number of containers the vehicle can transport");
2883  myTagProperties[currentTag].addAttribute(attrProperty);
2884 
2887  "The time required by a person to board the vehicle",
2888  "0.50");
2889  myTagProperties[currentTag].addAttribute(attrProperty);
2890 
2893  "The time required to load a container onto the vehicle",
2894  "90.00");
2895  myTagProperties[currentTag].addAttribute(attrProperty);
2896 
2899  "The preferred lateral alignment when using the sublane-model",
2900  "center");
2901  attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());
2902  myTagProperties[currentTag].addAttribute(attrProperty);
2903 
2906  "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model",
2907  "0.12");
2908  myTagProperties[currentTag].addAttribute(attrProperty);
2909 
2912  "The maximum lateral speed when using the sublane-model",
2913  "1.00");
2914  myTagProperties[currentTag].addAttribute(attrProperty);
2915 
2918  "The interval length for which vehicle performs its decision logic (acceleration and lane-changing)",
2919  toString(OptionsCont::getOptions().getFloat("default.action-step-length")));
2920  myTagProperties[currentTag].addAttribute(attrProperty);
2921 
2922  attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
2924  "The probability when being added to a distribution without an explicit probability",
2926  myTagProperties[currentTag].addAttribute(attrProperty);
2927 
2930  "3D model file for this class",
2931  "");
2932  myTagProperties[currentTag].addAttribute(attrProperty);
2933 
2936  "Carriage lengths");
2937  myTagProperties[currentTag].addAttribute(attrProperty);
2938 
2941  "Locomotive lengths");
2942  myTagProperties[currentTag].addAttribute(attrProperty);
2943 
2946  "GAP between carriages",
2947  "1");
2948  myTagProperties[currentTag].addAttribute(attrProperty);
2949 
2950  // fill VType Car Following Model Values (implemented in a separated function to improve code legibility)
2951  fillCarFollowingModelAttributes(currentTag);
2952 
2953  // fill VType Junction Model Parameters (implemented in a separated function to improve code legibility)
2954  fillJunctionModelAttributes(currentTag);
2955 
2956  // fill VType Lane Change Model Parameters (implemented in a separated function to improve code legibility)
2957  fillLaneChangingModelAttributes(currentTag);
2958  }
2959  currentTag = SUMO_TAG_PTYPE;
2960  {
2961  // set values of tag
2962  myTagProperties[currentTag] = GNETagProperties(currentTag,
2966 
2967  // set values of attributes
2968  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
2970  "The id of PersonType");
2971  myTagProperties[currentTag].addAttribute(attrProperty);
2972 
2975  "An abstract person class",
2976  "pedestrian");
2977  attrProperty.setDiscreteValues(vClassesPersons);
2978  myTagProperties[currentTag].addAttribute(attrProperty);
2979 
2980  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
2982  "This person type's color",
2983  "");
2984  myTagProperties[currentTag].addAttribute(attrProperty);
2985 
2986  attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH,
2988  "The person's width [m] (only used for drawing)");
2989  myTagProperties[currentTag].addAttribute(attrProperty);
2990 
2993  "The person's netto-length (length) [m]");
2994  myTagProperties[currentTag].addAttribute(attrProperty);
2995 
2998  "Empty space after leader [m]");
2999  myTagProperties[currentTag].addAttribute(attrProperty);
3000 
3003  "The person's maximum velocity [m/s]");
3004  myTagProperties[currentTag].addAttribute(attrProperty);
3005 
3008  "This value causes persons to violate a red light if the duration of the red phase is lower than the given threshold.",
3009  "-1");
3010  myTagProperties[currentTag].addAttribute(attrProperty);
3011 
3014  "Image file for rendering persons of this type (should be grayscale to allow functional coloring)");
3015  myTagProperties[currentTag].addAttribute(attrProperty);
3016  }
3017 }
3018 
3019 
3020 void
3022  // declare empty GNEAttributeProperties
3023  GNEAttributeProperties attrProperty;
3024  // fill vehicle ACs
3025  SumoXMLTag currentTag = SUMO_TAG_VEHICLE;
3026  {
3027  // set values of tag
3028  myTagProperties[currentTag] = GNETagProperties(currentTag,
3032  // set values of attributes
3033  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
3035  "The name of the " + toString(currentTag));
3036  myTagProperties[currentTag].addAttribute(attrProperty);
3037 
3038  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
3040  "The id of the vehicle type to use for this " + toString(currentTag),
3042  myTagProperties[currentTag].addAttribute(attrProperty);
3043 
3044  attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE,
3046  "The id of the route the " + toString(currentTag) + " shall drive along");
3047  myTagProperties[currentTag].addAttribute(attrProperty);
3048 
3049  // add common attributes
3050  fillCommonVehicleAttributes(currentTag);
3051 
3054  "The time step at which the " + toString(currentTag) + " shall enter the network",
3055  "0");
3056  myTagProperties[currentTag].addAttribute(attrProperty);
3057  }
3058  currentTag = GNE_TAG_VEHICLE_WITHROUTE;
3059  {
3060  // set values of tag
3061  myTagProperties[currentTag] = GNETagProperties(currentTag,
3065  // set values of attributes
3066  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
3068  "The name of the " + toString(SUMO_TAG_VEHICLE));
3069  myTagProperties[currentTag].addAttribute(attrProperty);
3070 
3071  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
3073  "The id of the vehicle type to use for this " + toString(SUMO_TAG_VEHICLE),
3075  myTagProperties[currentTag].addAttribute(attrProperty);
3076 
3077  // add common attributes
3078  fillCommonVehicleAttributes(currentTag);
3079 
3082  "The time step at which the " + toString(SUMO_TAG_VEHICLE) + " shall enter the network",
3083  "0");
3084  myTagProperties[currentTag].addAttribute(attrProperty);
3085  }
3086  currentTag = GNE_TAG_FLOW_ROUTE;
3087  {
3088  // set values of tag
3089  myTagProperties[currentTag] = GNETagProperties(currentTag,
3093  // set values of attributes
3094  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
3096  "The name of the " + toString(currentTag));
3097  myTagProperties[currentTag].addAttribute(attrProperty);
3098 
3099  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
3101  "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag),
3103  myTagProperties[currentTag].addAttribute(attrProperty);
3104 
3105  attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE,
3107  "The id of the route the " + toString(currentTag) + " shall drive along");
3108  myTagProperties[currentTag].addAttribute(attrProperty);
3109 
3110  // add common attributes
3111  fillCommonVehicleAttributes(currentTag);
3112 
3113  // add flow attributes
3114  fillCommonFlowAttributes(currentTag, true);
3115  }
3116  currentTag = GNE_TAG_FLOW_WITHROUTE;
3117  {
3118  // set values of tag
3119  myTagProperties[currentTag] = GNETagProperties(currentTag,
3123  // set values of attributes
3124  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
3126  "The name of the " + toString(SUMO_TAG_FLOW));
3127  myTagProperties[currentTag].addAttribute(attrProperty);
3128 
3129  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
3131  "The id of the " + toString(currentTag) + " type to use for this " + toString(SUMO_TAG_FLOW),
3133  myTagProperties[currentTag].addAttribute(attrProperty);
3134 
3135  // add common attributes
3136  fillCommonVehicleAttributes(currentTag);
3137 
3138  // add flow attributes
3139  fillCommonFlowAttributes(currentTag, true);
3140  }
3141  currentTag = SUMO_TAG_TRIP;
3142  {
3143  // set values of tag
3144  myTagProperties[currentTag] = GNETagProperties(currentTag,
3147  GUIIcon::TRIP);
3148  // set values of attributes
3149  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
3151  "The name of " + toString(currentTag) + "s that will be generated using this trip definition");
3152  myTagProperties[currentTag].addAttribute(attrProperty);
3153 
3154  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
3156  "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag),
3158  myTagProperties[currentTag].addAttribute(attrProperty);
3159 
3160  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
3162  "The name of the edge the " + toString(currentTag) + " starts at");
3163  myTagProperties[currentTag].addAttribute(attrProperty);
3164 
3165  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
3167  "The name of the edge the " + toString(currentTag) + " ends at");
3168  myTagProperties[currentTag].addAttribute(attrProperty);
3169 
3170  attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA,
3172  "List of intermediate edge ids which shall be part of the " + toString(currentTag));
3173  myTagProperties[currentTag].addAttribute(attrProperty);
3174 
3175  // add common attributes
3176  fillCommonVehicleAttributes(currentTag);
3177 
3180  "The departure time of the (first) " + toString(currentTag) + " which is generated using this " + toString(currentTag) + " definition",
3181  "0");
3182  myTagProperties[currentTag].addAttribute(attrProperty);
3183  }
3184  currentTag = SUMO_TAG_FLOW;
3185  {
3186  // set values of tag
3187  myTagProperties[currentTag] = GNETagProperties(currentTag,
3190  GUIIcon::FLOW);
3191  // set values of attributes
3192  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
3194  "The name of the " + toString(currentTag));
3195  myTagProperties[currentTag].addAttribute(attrProperty);
3196 
3197  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
3199  "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag),
3201  myTagProperties[currentTag].addAttribute(attrProperty);
3202 
3203  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
3205  "The name of the edge the " + toString(currentTag) + " starts at");
3206  myTagProperties[currentTag].addAttribute(attrProperty);
3207 
3208  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
3210  "The name of the edge the " + toString(currentTag) + " ends at");
3211  myTagProperties[currentTag].addAttribute(attrProperty);
3212 
3213  attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA,
3215  "List of intermediate edge ids which shall be part of the " + toString(currentTag));
3216  myTagProperties[currentTag].addAttribute(attrProperty);
3217 
3218  // add common attributes
3219  fillCommonVehicleAttributes(currentTag);
3220 
3221  // add flow attributes
3222  fillCommonFlowAttributes(currentTag, true);
3223  }
3224  /* currently disabled. See #5259
3225  currentTag = SUMO_TAG_TRIP_TAZ;
3226  {
3227  // set values of tag
3228  myTagProperties[currentTag] = GNETagProperties(currentTag,
3229  GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE,
3230  GNETagProperties::DRAWABLE,
3231  GUIIcon::TRIP);
3232  }
3233  */
3234 }
3235 
3236 
3237 void
3239  // declare empty GNEAttributeProperties
3240  GNEAttributeProperties attrProperty;
3241  // fill stops ACs
3242  SumoXMLTag currentTag = SUMO_TAG_STOP_LANE;
3243  {
3244  // set values of tag
3245  myTagProperties[currentTag] = GNETagProperties(currentTag,
3249  // set values of attributes
3250  attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE,
3252  "The name of the lane the stop shall be located at");
3253  myTagProperties[currentTag].addAttribute(attrProperty);
3254 
3257  "The begin position on the lane (the lower position on the lane) in meters",
3258  "0");
3259  myTagProperties[currentTag].addAttribute(attrProperty);
3260 
3263  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m",
3264  "0");
3265  myTagProperties[currentTag].addAttribute(attrProperty);
3266 
3269  "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",
3270  "0");
3271  myTagProperties[currentTag].addAttribute(attrProperty);
3272 
3273  // fill common stop attributes
3274  fillCommonStopAttributes(currentTag, true);
3275  }
3276  currentTag = SUMO_TAG_STOP_BUSSTOP;
3277  {
3278  // set values of tag
3279  myTagProperties[currentTag] = GNETagProperties(currentTag,
3283  // set values of attributes
3286  "BusStop associated with this stop");
3287  myTagProperties[currentTag].addAttribute(attrProperty);
3288 
3289  // fill common stop attributes
3290  fillCommonStopAttributes(currentTag, true);
3291  }
3292  currentTag = SUMO_TAG_STOP_CONTAINERSTOP;
3293  {
3294  // set values of tag
3295  myTagProperties[currentTag] = GNETagProperties(currentTag,
3299  // set values of attributes
3302  "ContainerStop associated with this stop");
3303  myTagProperties[currentTag].addAttribute(attrProperty);
3304 
3305  // fill common stop attributes
3306  fillCommonStopAttributes(currentTag, true);
3307  }
3308  currentTag = SUMO_TAG_STOP_CHARGINGSTATION;
3309  {
3310  // set values of tag
3311  myTagProperties[currentTag] = GNETagProperties(currentTag,
3315  // set values of attributes
3318  "ChargingStation associated with this stop");
3319  myTagProperties[currentTag].addAttribute(attrProperty);
3320 
3321  // fill common stop attributes
3322  fillCommonStopAttributes(currentTag, true);
3323  }
3324  currentTag = SUMO_TAG_STOP_PARKINGAREA;
3325  {
3326  // set values of tag
3327  myTagProperties[currentTag] = GNETagProperties(currentTag,
3331  // set values of attributes
3334  "ParkingArea associated with this stop");
3335  myTagProperties[currentTag].addAttribute(attrProperty);
3336 
3337  // fill common stop attributes (no parking)
3338  fillCommonStopAttributes(currentTag, false);
3339  }
3340 }
3341 
3342 
3343 void
3345  // declare empty GNEAttributeProperties
3346  GNEAttributeProperties attrProperty;
3347  // fill vehicle ACs
3348  SumoXMLTag currentTag = SUMO_TAG_PERSON;
3349  {
3350  // set values of tag
3351  myTagProperties[currentTag] = GNETagProperties(currentTag,
3354  GUIIcon::PERSON);
3355 
3356  // add flow attributes
3357  fillCommonPersonAttributes(currentTag);
3358 
3359  // set specific attribute depart (note: Persons doesn't support triggered and containerTriggered values)
3362  "The time step at which the " + toString(currentTag) + " shall enter the network",
3363  "0");
3364  myTagProperties[currentTag].addAttribute(attrProperty);
3365 
3366  }
3367  currentTag = SUMO_TAG_PERSONFLOW;
3368  {
3369  // set values of tag
3370  myTagProperties[currentTag] = GNETagProperties(currentTag,
3374 
3375  // add flow attributes
3376  fillCommonPersonAttributes(currentTag);
3377 
3378  // add flow attributes
3379  fillCommonFlowAttributes(currentTag, false);
3380  }
3381 }
3382 
3383 
3384 void
3386  // declare empty GNEAttributeProperties
3387  GNEAttributeProperties attrProperty;
3388  // fill person trips
3390  {
3391  // set values of tag
3392  myTagProperties[currentTag] = GNETagProperties(currentTag,
3396  // fill attributes
3397  fillPersonPlanEdgeEdge(currentTag);
3398  fillPersonTripAttributes(currentTag);
3399  }
3400  currentTag = GNE_TAG_PERSONTRIP_EDGE_BUSSTOP;
3401  {
3402  // set values of tag
3403  myTagProperties[currentTag] = GNETagProperties(currentTag,
3407  // fill attributes
3408  fillPersonPlanEdgeBusStop(currentTag);
3409  fillPersonTripAttributes(currentTag);
3410  }
3411  currentTag = GNE_TAG_PERSONTRIP_EDGE_STOP;
3412  {
3413  // set values of tag
3414  myTagProperties[currentTag] = GNETagProperties(currentTag,
3418  // fill attributes
3419  fillPersonPlanEdgeStop(currentTag);
3420  fillPersonTripAttributes(currentTag);
3421  }
3422  currentTag = GNE_TAG_PERSONTRIP_BUSSTOP_EDGE;
3423  {
3424  // set values of tag
3425  myTagProperties[currentTag] = GNETagProperties(currentTag,
3429  // fill attributes
3430  fillPersonPlanBusStopEdge(currentTag);
3431  fillPersonTripAttributes(currentTag);
3432  }
3434  {
3435  // set values of tag
3436  myTagProperties[currentTag] = GNETagProperties(currentTag,
3440  // fill attributes
3441  fillPersonPlanBusStopBusStop(currentTag);
3442  fillPersonTripAttributes(currentTag);
3443  }
3444  currentTag = GNE_TAG_PERSONTRIP_BUSSTOP_STOP;
3445  {
3446  // set values of tag
3447  myTagProperties[currentTag] = GNETagProperties(currentTag,
3451  // fill attributes
3452  fillPersonPlanBusStopStop(currentTag);
3453  fillPersonTripAttributes(currentTag);
3454  }
3455  currentTag = GNE_TAG_PERSONTRIP_STOP_EDGE;
3456  {
3457  // set values of tag
3458  myTagProperties[currentTag] = GNETagProperties(currentTag,
3462  // fill attributes
3463  fillPersonPlanStopEdge(currentTag);
3464  fillPersonTripAttributes(currentTag);
3465  }
3466  currentTag = GNE_TAG_PERSONTRIP_STOP_BUSSTOP;
3467  {
3468  // set values of tag
3469  myTagProperties[currentTag] = GNETagProperties(currentTag,
3473  // fill attributes
3474  fillPersonPlanStopBusStop(currentTag);
3475  fillPersonTripAttributes(currentTag);
3476  }
3477  currentTag = GNE_TAG_PERSONTRIP_STOP_STOP;
3478  {
3479  // set values of tag
3480  myTagProperties[currentTag] = GNETagProperties(currentTag,
3484  // fill attributes
3485  fillPersonPlanStopStop(currentTag);
3486  fillPersonTripAttributes(currentTag);
3487  }
3488 }
3489 
3490 
3491 void
3493  // declare empty GNEAttributeProperties
3494  GNEAttributeProperties attrProperty;
3495  // fill walks
3496  SumoXMLTag currentTag = GNE_TAG_WALK_EDGES;
3497  {
3498  // set values of tag
3499  myTagProperties[currentTag] = GNETagProperties(currentTag,
3503  // edges
3504  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES,
3506  "id of the edges to walk");
3507  myTagProperties[currentTag].addAttribute(attrProperty);
3508  // arrival pos
3511  "Arrival position on the destination edge",
3512  "-1");
3513  myTagProperties[currentTag].addAttribute(attrProperty);
3514  }
3515  currentTag = GNE_TAG_WALK_ROUTE;
3516  {
3517  // set values of tag
3518  myTagProperties[currentTag] = GNETagProperties(currentTag,
3522  // route
3523  attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE,
3525  "The id of the route to walk");
3526  myTagProperties[currentTag].addAttribute(attrProperty);
3527  // arrival pos
3530  "Arrival position on the destination edge",
3531  "-1");
3532  myTagProperties[currentTag].addAttribute(attrProperty);
3533  }
3534  currentTag = GNE_TAG_WALK_EDGE_EDGE;
3535  {
3536  // set values of tag
3537  myTagProperties[currentTag] = GNETagProperties(currentTag,
3541  // fill attributes
3542  fillPersonPlanEdgeEdge(currentTag);
3543  }
3544  currentTag = GNE_TAG_WALK_EDGE_BUSSTOP;
3545  {
3546  // set values of tag
3547  myTagProperties[currentTag] = GNETagProperties(currentTag,
3551  // fill attributes
3552  fillPersonPlanEdgeBusStop(currentTag);
3553  }
3554  currentTag = GNE_TAG_WALK_BUSSTOP_EDGE;
3555  {
3556  // set values of tag
3557  myTagProperties[currentTag] = GNETagProperties(currentTag,
3561  // fill attributes
3562  fillPersonPlanBusStopEdge(currentTag);
3563  }
3564  currentTag = GNE_TAG_WALK_BUSSTOP_BUSSTOP;
3565  {
3566  // set values of tag
3567  myTagProperties[currentTag] = GNETagProperties(currentTag,
3571  // fill attributes
3572  fillPersonPlanBusStopBusStop(currentTag);
3573  }
3574 }
3575 
3576 
3577 void
3579  // declare empty GNEAttributeProperties
3580  GNEAttributeProperties attrProperty;
3581  // fill rides
3582  SumoXMLTag currentTag = GNE_TAG_RIDE_EDGE_EDGE;
3583  {
3584  // set values of tag
3585  myTagProperties[currentTag] = GNETagProperties(currentTag,
3589  // fill attributes
3590  fillPersonPlanEdgeEdge(currentTag);
3591  fillRideAttributes(currentTag);
3592  }
3593  currentTag = GNE_TAG_RIDE_EDGE_BUSSTOP;
3594  {
3595  // set values of tag
3596  myTagProperties[currentTag] = GNETagProperties(currentTag,
3600  // fill attributes
3601  fillPersonPlanEdgeBusStop(currentTag);
3602  fillRideAttributes(currentTag);
3603  }
3604  currentTag = GNE_TAG_RIDE_BUSSTOP_EDGE;
3605  {
3606  // set values of tag
3607  myTagProperties[currentTag] = GNETagProperties(currentTag,
3611  // fill attributes
3612  fillPersonPlanBusStopEdge(currentTag);
3613  fillRideAttributes(currentTag);
3614  }
3615  currentTag = GNE_TAG_RIDE_BUSSTOP_BUSSTOP;
3616  {
3617  // set values of tag
3618  myTagProperties[currentTag] = GNETagProperties(currentTag,
3622  // fill attributes
3623  fillPersonPlanBusStopBusStop(currentTag);
3624  fillRideAttributes(currentTag);
3625  }
3626 }
3627 
3628 
3629 void
3631  // declare empty GNEAttributeProperties
3632  GNEAttributeProperties attrProperty;
3633  // from edge
3634  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
3636  "The name of the edge the " + toString(currentTag) + " starts at");
3637  myTagProperties[currentTag].addAttribute(attrProperty);
3638  // to edge
3639  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
3641  "The name of the edge the " + toString(currentTag) + " ends at");
3642  myTagProperties[currentTag].addAttribute(attrProperty);
3643  // arrival position
3646  "arrival position on the destination edge",
3647  "-1");
3648  myTagProperties[currentTag].addAttribute(attrProperty);
3649 }
3650 
3651 
3652 void
3654  // declare empty GNEAttributeProperties
3655  GNEAttributeProperties attrProperty;
3656  // from edge
3657  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
3659  "The name of the edge the " + toString(currentTag) + " starts at");
3660  myTagProperties[currentTag].addAttribute(attrProperty);
3661  // to busStop
3664  "Id of the destination " + toString(SUMO_TAG_BUS_STOP));
3665  myTagProperties[currentTag].addAttribute(attrProperty);
3666 }
3667 
3668 
3669 void
3671  // declare empty GNEAttributeProperties
3672  GNEAttributeProperties attrProperty;
3673  // from edge
3674  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
3676  "The name of the edge the " + toString(currentTag) + " starts at");
3677  myTagProperties[currentTag].addAttribute(attrProperty);
3678  // to stop
3681  "Destination " + toString(SUMO_TAG_STOP));
3682  myTagProperties[currentTag].addAttribute(attrProperty);
3683 }
3684 
3685 
3686 void
3688  // declare empty GNEAttributeProperties
3689  GNEAttributeProperties attrProperty;
3690  // from busStop
3693  "Id of the origin " + toString(SUMO_TAG_BUS_STOP));
3694  myTagProperties[currentTag].addAttribute(attrProperty);
3695  // to edge
3696  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
3698  "The name of the edge the " + toString(currentTag) + " ends at");
3699  myTagProperties[currentTag].addAttribute(attrProperty);
3700  // arrival position
3703  "arrival position on the destination edge",
3704  "-1");
3705  myTagProperties[currentTag].addAttribute(attrProperty);
3706 }
3707 
3708 
3709 void
3711  // declare empty GNEAttributeProperties
3712  GNEAttributeProperties attrProperty;
3713  // from busStop
3716  "Id of the origin " + toString(SUMO_TAG_BUS_STOP));
3717  myTagProperties[currentTag].addAttribute(attrProperty);
3718  // to busStop
3721  "Id of the destination " + toString(SUMO_TAG_BUS_STOP));
3722  myTagProperties[currentTag].addAttribute(attrProperty);
3723 }
3724 
3725 
3726 void
3728  // declare empty GNEAttributeProperties
3729  GNEAttributeProperties attrProperty;
3730  // from busStop
3733  "Id of the origin " + toString(SUMO_TAG_BUS_STOP));
3734  myTagProperties[currentTag].addAttribute(attrProperty);
3735  // to stop
3738  "Destination " + toString(SUMO_TAG_STOP));
3739  myTagProperties[currentTag].addAttribute(attrProperty);
3740 }
3741 
3742 
3743 void
3745  // declare empty GNEAttributeProperties
3746  GNEAttributeProperties attrProperty;
3747  // from busStop
3750  "Origin " + toString(SUMO_TAG_STOP));
3751  myTagProperties[currentTag].addAttribute(attrProperty);
3752  // to edge
3753  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
3755  "The name of the edge the " + toString(currentTag) + " ends at");
3756  myTagProperties[currentTag].addAttribute(attrProperty);
3757  // arrival position
3760  "arrival position on the destination edge",
3761  "-1");
3762  myTagProperties[currentTag].addAttribute(attrProperty);
3763 }
3764 
3765 
3766 void
3768  // declare empty GNEAttributeProperties
3769  GNEAttributeProperties attrProperty;
3770  // from busStop
3773  "Origin " + toString(SUMO_TAG_STOP));
3774  myTagProperties[currentTag].addAttribute(attrProperty);
3775  // to busStop
3778  "Id of the destination " + toString(SUMO_TAG_BUS_STOP));
3779  myTagProperties[currentTag].addAttribute(attrProperty);
3780 }
3781 
3782 
3783 void
3785  // declare empty GNEAttributeProperties
3786  GNEAttributeProperties attrProperty;
3787  // from busStop
3790  "Origin " + toString(SUMO_TAG_STOP));
3791  myTagProperties[currentTag].addAttribute(attrProperty);
3792  // to stop
3795  "Destination " + toString(SUMO_TAG_STOP));
3796  myTagProperties[currentTag].addAttribute(attrProperty);
3797 }
3798 
3799 
3800 void
3802  // declare empty GNEAttributeProperties
3803  GNEAttributeProperties attrProperty;
3804  // vTypes
3807  "List of possible vehicle types to take");
3808  myTagProperties[currentTag].addAttribute(attrProperty);
3809  // modes
3810  attrProperty = GNEAttributeProperties(SUMO_ATTR_MODES,
3812  "List of possible traffic modes. Walking is always possible regardless of this value");
3813  myTagProperties[currentTag].addAttribute(attrProperty);
3814 }
3815 
3816 
3817 void
3819  // declare empty GNEAttributeProperties
3820  GNEAttributeProperties attrProperty;
3821  // lines
3822  attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES,
3824  "list of vehicle alternatives to take for the " + toString(currentTag),
3825  "ANY");
3826  myTagProperties[currentTag].addAttribute(attrProperty);
3827 }
3828 
3829 
3830 void
3832  // declare empty GNEAttributeProperties
3833  GNEAttributeProperties attrProperty;
3834  // fill vehicle ACs
3835  SumoXMLTag currentTag = GNE_TAG_PERSONSTOP_EDGE;
3836  {
3837  // set values of tag
3838  myTagProperties[currentTag] = GNETagProperties(currentTag,
3843 
3844  // set values of attributes
3845  attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE,
3847  "The name of the edge the stop shall be located at");
3848  myTagProperties[currentTag].addAttribute(attrProperty);
3849 
3850  // fill common stop attributes
3851  fillCommonStopAttributes(currentTag, true);
3852  }
3853  currentTag = GNE_TAG_PERSONSTOP_BUSSTOP;
3854  {
3855  // set values of tag
3856  myTagProperties[currentTag] = GNETagProperties(currentTag,
3861 
3862  // set values of attributes
3865  "BusStop associated with this stop");
3866  myTagProperties[currentTag].addAttribute(attrProperty);
3867 
3868  // fill common stop attributes
3869  fillCommonStopAttributes(currentTag, true);
3870  }
3871 }
3872 
3873 
3874 void
3876  // declare empty GNEAttributeProperties
3877  GNEAttributeProperties attrProperty;
3878  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
3880  "This " + toString(currentTag) + "'s color",
3881  "yellow");
3882  myTagProperties[currentTag].addAttribute(attrProperty);
3883 
3886  "The lane on which the " + toString(currentTag) + " shall be inserted",
3887  "first");
3888  myTagProperties[currentTag].addAttribute(attrProperty);
3889 
3892  "The position at which the " + toString(currentTag) + " shall enter the net",
3893  "base");
3894  myTagProperties[currentTag].addAttribute(attrProperty);
3895 
3897  GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */,
3898  "The speed with which the " + toString(currentTag) + " shall enter the network",
3899  "0");
3900  myTagProperties[currentTag].addAttribute(attrProperty);
3901 
3904  "The lane at which the " + toString(currentTag) + " shall leave the network",
3905  "current");
3906  myTagProperties[currentTag].addAttribute(attrProperty);
3907 
3910  "The position at which the " + toString(currentTag) + " shall leave the network",
3911  "max");
3912  myTagProperties[currentTag].addAttribute(attrProperty);
3913 
3915  GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */,
3916  "The speed with which the " + toString(currentTag) + " shall leave the network",
3917  "current");
3918  myTagProperties[currentTag].addAttribute(attrProperty);
3919 
3920  attrProperty = GNEAttributeProperties(SUMO_ATTR_LINE,
3922  "A string specifying the id of a public transport line which can be used when specifying person rides");
3923  myTagProperties[currentTag].addAttribute(attrProperty);
3924 
3927  "The number of occupied seats when the " + toString(currentTag) + " is inserted",
3928  "0");
3929  myTagProperties[currentTag].addAttribute(attrProperty);
3930 
3933  "The number of occupied container places when the " + toString(currentTag) + " is inserted",
3934  "0");
3935  myTagProperties[currentTag].addAttribute(attrProperty);
3936 
3939  "The lateral position on the departure lane at which the " + toString(currentTag) + " shall enter the net",
3940  "center");
3941  myTagProperties[currentTag].addAttribute(attrProperty);
3942 
3945  "The lateral position on the arrival lane at which the " + toString(currentTag) + " shall arrive",
3946  "center");
3947  myTagProperties[currentTag].addAttribute(attrProperty);
3948 }
3949 
3950 
3951 void
3952 GNEAttributeCarrier::fillCommonFlowAttributes(SumoXMLTag currentTag, const bool forVehicles) {
3953  // declare empty GNEAttributeProperties
3954  GNEAttributeProperties attrProperty;
3955 
3956  attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN,
3958  "First " + toString(currentTag) + " departure time",
3959  "0.00");
3960  myTagProperties[currentTag].addAttribute(attrProperty);
3961 
3962  attrProperty = GNEAttributeProperties(SUMO_ATTR_END,
3964  "End of departure interval",
3965  "3600.00");
3966  myTagProperties[currentTag].addAttribute(attrProperty);
3967 
3970  "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)",
3971  "1800");
3972  myTagProperties[currentTag].addAttribute(attrProperty);
3973 
3976  "Number of " + toString(currentTag) + "s per hour, equally spaced (not together with period or probability)",
3977  "1800");
3978  myTagProperties[currentTag].addAttribute(attrProperty);
3979 
3982  "Insert equally spaced " + toString(currentTag) + "s at that period (not together with vehsPerHour or probability)",
3983  "2");
3984  myTagProperties[currentTag].addAttribute(attrProperty);
3985 
3986  attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
3988  "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)",
3989  "0.5");
3990  myTagProperties[currentTag].addAttribute(attrProperty);
3991 }
3992 
3993 
3994 void
3996  // declare empty GNEAttributeProperties
3997  GNEAttributeProperties attrProperty;
3998 
3999  attrProperty = GNEAttributeProperties(SUMO_ATTR_ACCEL,
4001  "The acceleration ability of vehicles of this type [m/s^2]",
4002  "2.60");
4003  myTagProperties[currentTag].addAttribute(attrProperty);
4004 
4005  attrProperty = GNEAttributeProperties(SUMO_ATTR_DECEL,
4007  "The deceleration ability of vehicles of this type [m/s^2]",
4008  "4.50");
4009  myTagProperties[currentTag].addAttribute(attrProperty);
4010 
4013  "The apparent deceleration of the vehicle as used by the standard model [m/s^2]",
4014  "4.50");
4015  myTagProperties[currentTag].addAttribute(attrProperty);
4016 
4019  "The maximal physically possible deceleration for the vehicle [m/s^2]",
4020  "4.50");
4021  myTagProperties[currentTag].addAttribute(attrProperty);
4022 
4023  attrProperty = GNEAttributeProperties(SUMO_ATTR_SIGMA,
4025  "Car-following model parameter",
4026  "0.50");
4027  attrProperty.setRange(0, 1);
4028  myTagProperties[currentTag].addAttribute(attrProperty);
4029 
4030  attrProperty = GNEAttributeProperties(SUMO_ATTR_TAU,
4032  "Car-following model parameter",
4033  "1.00");
4034  myTagProperties[currentTag].addAttribute(attrProperty);
4035 
4036  attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP1,
4038  "SKRAUSSX parameter 1",
4039  "");
4040  myTagProperties[currentTag].addAttribute(attrProperty);
4041 
4042  attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP2,
4044  "SKRAUSSX parameter 2",
4045  "");
4046  myTagProperties[currentTag].addAttribute(attrProperty);
4047 
4048  attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP3,
4050  "SKRAUSSX parameter 3",
4051  "");
4052  myTagProperties[currentTag].addAttribute(attrProperty);
4053 
4054  attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP4,
4056  "SKRAUSSX parameter 4",
4057  "");
4058  myTagProperties[currentTag].addAttribute(attrProperty);
4059 
4060  attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP5,
4062  "SKRAUSSX parameter 5",
4063  "");
4064  myTagProperties[currentTag].addAttribute(attrProperty);
4065 
4068  "Peter Wagner 2009 parameter",
4069  "");
4070  myTagProperties[currentTag].addAttribute(attrProperty);
4071 
4074  "Peter Wagner 2009 parameter",
4075  "");
4076  myTagProperties[currentTag].addAttribute(attrProperty);
4077 
4080  "IDMM parameter",
4081  "");
4082  myTagProperties[currentTag].addAttribute(attrProperty);
4083 
4086  "IDMM parameter",
4087  "");
4088  myTagProperties[currentTag].addAttribute(attrProperty);
4089 
4092  "Wiedemann parameter",
4093  "");
4094  myTagProperties[currentTag].addAttribute(attrProperty);
4095 
4098  "Wiedemann parameter",
4099  "");
4100  myTagProperties[currentTag].addAttribute(attrProperty);
4101 
4104  "MinGap factor parameter",
4105  "");
4106  myTagProperties[currentTag].addAttribute(attrProperty);
4107 
4108  attrProperty = GNEAttributeProperties(SUMO_ATTR_K,
4110  "K parameter",
4111  "");
4112  myTagProperties[currentTag].addAttribute(attrProperty);
4113 
4114 
4117  "Kerner Phi parameter",
4118  "");
4119  myTagProperties[currentTag].addAttribute(attrProperty);
4120 
4123  "IDM Delta parameter",
4124  "");
4125  myTagProperties[currentTag].addAttribute(attrProperty);
4126 
4129  "IDM Stepping parameter",
4130  "");
4131  myTagProperties[currentTag].addAttribute(attrProperty);
4132 
4135  "Train Types",
4136  "NGT400");
4137  attrProperty.setDiscreteValues(SUMOXMLDefinitions::TrainTypes.getStrings());
4138  myTagProperties[currentTag].addAttribute(attrProperty);
4139 }
4140 
4141 
4142 void
4144  // declare empty GNEAttributeProperties
4145  GNEAttributeProperties attrProperty;
4148  "Minimum distance to pedestrians that are walking towards the conflict point with the ego vehicle.",
4149  "10");
4150  myTagProperties[currentTag].addAttribute(attrProperty);
4151 
4154  "The accumulated waiting time after which a vehicle will drive onto an intersection even though this might cause jamming.",
4155  "-1");
4156  myTagProperties[currentTag].addAttribute(attrProperty);
4157 
4160  "This value causes vehicles to violate a yellow light if the duration of the yellow phase is lower than the given threshold.",
4161  "-1");
4162  myTagProperties[currentTag].addAttribute(attrProperty);
4163 
4166  "This value causes vehicles to violate a red light if the duration of the red phase is lower than the given threshold.",
4167  "-1");
4168  myTagProperties[currentTag].addAttribute(attrProperty);
4169 
4172  "This value causes vehicles affected by jmDriveAfterRedTime to slow down when violating a red light.",
4173  "0.0");
4174  myTagProperties[currentTag].addAttribute(attrProperty);
4175 
4178  "This value causes vehicles to ignore foe vehicles that have right-of-way with the given probability.",
4179  "0.0");
4180  myTagProperties[currentTag].addAttribute(attrProperty);
4181 
4184  "This value is used in conjunction with jmIgnoreFoeProb. Only vehicles with a speed below or equal to the given value may be ignored.",
4185  "0.0");
4186  myTagProperties[currentTag].addAttribute(attrProperty);
4187 
4190  "This value configures driving imperfection (dawdling) while passing a minor link.",
4191  "0.0");
4192  myTagProperties[currentTag].addAttribute(attrProperty);
4193 
4196  "This value defines the minimum time gap when passing ahead of a prioritized vehicle. ",
4197  "1");
4198  myTagProperties[currentTag].addAttribute(attrProperty);
4199 
4202  "Willingess of drivers to impede vehicles with higher priority",
4203  "0.0");
4204  myTagProperties[currentTag].addAttribute(attrProperty);
4205 }
4206 
4207 
4208 void
4210  // declare empty GNEAttributeProperties
4211  GNEAttributeProperties attrProperty;
4212 
4215  "The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing.",
4216  "1.0");
4217  myTagProperties[currentTag].addAttribute(attrProperty);
4218 
4221  "The willingness for performing cooperative lane changing. Lower values result in reduced cooperation.",
4222  "1.0");
4223  myTagProperties[currentTag].addAttribute(attrProperty);
4224 
4227  "The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing.",
4228  "1.0");
4229  myTagProperties[currentTag].addAttribute(attrProperty);
4230 
4233  "The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing.",
4234  "1.0");
4235  myTagProperties[currentTag].addAttribute(attrProperty);
4236 
4239  "The eagerness for using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment.",
4240  "1.0");
4241  myTagProperties[currentTag].addAttribute(attrProperty);
4242 
4245  "The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing.",
4246  "1.0");
4247  myTagProperties[currentTag].addAttribute(attrProperty);
4248 
4251  "Willingness to encroach laterally on other drivers.",
4252  "0.00");
4253  myTagProperties[currentTag].addAttribute(attrProperty);
4254 
4257  "Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy)",
4258  "0.00");
4259  myTagProperties[currentTag].addAttribute(attrProperty);
4260 
4263  "Willingness to accept lower front and rear gaps on the target lane.",
4264  "1.0");
4265  myTagProperties[currentTag].addAttribute(attrProperty);
4266 
4269  "Dynamic factor for modifying lcAssertive and lcPushy.",
4270  "0.00");
4271  myTagProperties[currentTag].addAttribute(attrProperty);
4272 
4275  "Time to reach maximum impatience (of 1). Impatience grows whenever a lane-change manoeuvre is blocked.",
4276  "infinity");
4277  myTagProperties[currentTag].addAttribute(attrProperty);
4278 
4281  "Maximum lateral acceleration per second.",
4282  "1.0");
4283  myTagProperties[currentTag].addAttribute(attrProperty);
4284 
4287  "Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead).",
4288  "2.0");
4289  myTagProperties[currentTag].addAttribute(attrProperty);
4290 
4293  "Factor for configuring the treshold asymmetry when changing to the left or to the right for speed gain.",
4294  "0.1");
4295  myTagProperties[currentTag].addAttribute(attrProperty);
4296 
4299  "Upper bound on lateral speed when standing.",
4300  "0.00");
4301  myTagProperties[currentTag].addAttribute(attrProperty);
4302 
4305  "Upper bound on lateral speed while moving computed as lcMaxSpeedLatStanding + lcMaxSpeedLatFactor * getSpeed()",
4306  "1.00");
4307  myTagProperties[currentTag].addAttribute(attrProperty);
4308 
4311  "Distance to an upcoming turn on the vehicles route, below which the alignment should be dynamically adapted to match the turn direction.",
4312  "0.00");
4313  myTagProperties[currentTag].addAttribute(attrProperty);
4314 
4317  "The probability for violating rules gainst overtaking on the right.",
4318  "0.00");
4319  myTagProperties[currentTag].addAttribute(attrProperty);
4320 
4321  /*
4322  attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_EXPERIMENTAL1,
4323  GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED,
4324  "XXXXX",
4325  "0.00");
4326  myTagProperties[currentTag].addAttribute(attrProperty);
4327  */
4328 }
4329 
4330 
4331 void
4333  // declare empty GNEAttributeProperties
4334  GNEAttributeProperties attrProperty;
4335 
4336  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
4338  "The name of the " + toString(currentTag));
4339  myTagProperties[currentTag].addAttribute(attrProperty);
4340 
4341  attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE,
4343  "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag) +
4345  myTagProperties[currentTag].addAttribute(attrProperty);
4346 
4347  attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR,
4349  "This " + toString(currentTag) + "'s color",
4350  "yellow");
4351  myTagProperties[currentTag].addAttribute(attrProperty);
4352 
4355  "The position at which the " + toString(currentTag) + " shall enter the net",
4356  "base");
4357  myTagProperties[currentTag].addAttribute(attrProperty);
4358 }
4359 
4360 
4361 void
4363  // declare empty GNEAttributeProperties
4364  GNEAttributeProperties attrProperty;
4365 
4368  "Minimum duration for stopping",
4369  "60");
4370  myTagProperties[currentTag].addAttribute(attrProperty);
4371 
4372  attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL,
4374  "The time step at which the route continues",
4375  "0");
4376  myTagProperties[currentTag].addAttribute(attrProperty);
4377 
4380  "If set to a non-negative time value, then the stop duration can be extended at most by the extension value in seconds",
4381  "0");
4382  myTagProperties[currentTag].addAttribute(attrProperty);
4383 
4386  "Whether a person may end the stop",
4387  "0");
4388  myTagProperties[currentTag].addAttribute(attrProperty);
4389 
4392  "List of persons that must board the vehicle before it may continue");
4393  myTagProperties[currentTag].addAttribute(attrProperty);
4394 
4397  "Whether a container may end the stop",
4398  "0");
4399  myTagProperties[currentTag].addAttribute(attrProperty);
4400 
4403  "List of containers that must be loaded onto the vehicle before it may continue");
4404  myTagProperties[currentTag].addAttribute(attrProperty);
4405 
4406  if (parking) {
4409  "whether the vehicle stops on the road or beside ",
4410  "0");
4411  myTagProperties[currentTag].addAttribute(attrProperty);
4412  }
4413 
4416  "Activity displayed for stopped person in GUI and output files ",
4417  "waiting");
4418  myTagProperties[currentTag].addAttribute(attrProperty);
4419 
4426 }
4427 
4428 
4429 void
4431  // declare empty GNEAttributeProperties
4432  GNEAttributeProperties attrProperty;
4433  // fill data set element
4434  SumoXMLTag currentTag = SUMO_TAG_DATASET;
4435  {
4436  // set values of tag
4437  myTagProperties[currentTag] = GNETagProperties(currentTag,
4441 
4442  // set values of attributes
4443  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
4445  "Data set ID");
4446  myTagProperties[currentTag].addAttribute(attrProperty);
4447 
4448  }
4449  // fill data interval element
4450  currentTag = SUMO_TAG_DATAINTERVAL;
4451  {
4452  // set values of tag
4453  myTagProperties[currentTag] = GNETagProperties(currentTag,
4457 
4458  // set values of attributes
4459  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
4461  "Interval ID");
4462  myTagProperties[currentTag].addAttribute(attrProperty);
4463 
4464  // set values of attributes
4465  attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN,
4467  "First " + toString(currentTag) + " departure time",
4468  "0.00");
4469  myTagProperties[currentTag].addAttribute(attrProperty);
4470 
4471  attrProperty = GNEAttributeProperties(SUMO_ATTR_END,
4473  "End of departure interval",
4474  "3600.00");
4475  myTagProperties[currentTag].addAttribute(attrProperty);
4476  }
4477  // fill edge data element
4478  currentTag = SUMO_TAG_MEANDATA_EDGE;
4479  {
4480  // set values of tag
4481  myTagProperties[currentTag] = GNETagProperties(currentTag,
4485 
4486  // set values of attributes
4487  attrProperty = GNEAttributeProperties(SUMO_ATTR_ID,
4489  "edge ID");
4490  myTagProperties[currentTag].addAttribute(attrProperty);
4491  }
4492  currentTag = SUMO_TAG_EDGEREL;
4493  {
4494  // set values of tag
4495  myTagProperties[currentTag] = GNETagProperties(currentTag,
4499 
4500  // set values of attributes
4501  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
4503  "The name of the edge the " + toString(currentTag) + " starts at");
4504  myTagProperties[currentTag].addAttribute(attrProperty);
4505 
4506  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
4508  "The name of the edge the " + toString(currentTag) + " ends at");
4509  myTagProperties[currentTag].addAttribute(attrProperty);
4510  }
4511  currentTag = SUMO_TAG_TAZREL;
4512  {
4513  // set values of tag
4514  myTagProperties[currentTag] = GNETagProperties(currentTag,
4518 
4519  // set values of attributes
4520  attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM,
4522  "The name of the TAZ the " + toString(currentTag) + " starts at");
4523  myTagProperties[currentTag].addAttribute(attrProperty);
4524 
4525  attrProperty = GNEAttributeProperties(SUMO_ATTR_TO,
4527  "The name of the TAZ the " + toString(currentTag) + " ends at");
4528  myTagProperties[currentTag].addAttribute(attrProperty);
4529  }
4530 }
4531 
4532 
4533 bool
4535  const GNEAttributeProperties& attrProperties, const SumoXMLAttr attribute,
4536  std::string& defaultValue, std::string& parsedAttribute, std::string& warningMessage) {
4537  // declare a string for details about error formats
4538  std::string errorFormat;
4539  // set extra check for ID Values
4540  if (attribute == SUMO_ATTR_ID) {
4541  if (parsedAttribute.empty()) {
4542  errorFormat = "ID cannot be empty; ";
4543  } else if (GNETagProperties.isDetector()) {
4544  // special case for detectors (because in this case empty spaces are allowed)
4545  if (SUMOXMLDefinitions::isValidDetectorID(parsedAttribute) == false) {
4546  errorFormat = "Detector ID contains invalid characters; ";
4547  }
4548  } else if (GNETagProperties.isDemandElement()) {
4549  // special case for detectors (because in this case empty spaces are allowed)
4550  if (SUMOXMLDefinitions::isValidVehicleID(parsedAttribute) == false) {
4551  errorFormat = "Demand Element ID contains invalid characters; ";
4552  }
4553  } else if (SUMOXMLDefinitions::isValidAdditionalID(parsedAttribute) == false) {
4554  errorFormat = "ID contains invalid characters; ";
4555  }
4556  }
4557  // Set extra checks for int values
4558  if (attrProperties.isInt()) {
4559  if (canParse<int>(parsedAttribute)) {
4560  // obtain int value
4561  int parsedIntAttribute = parse<int>(parsedAttribute);
4562  // check if attribute can be negative or zero
4563  if (attrProperties.isPositive() && (parsedIntAttribute < 0)) {
4564  errorFormat = "Cannot be negative; ";
4565  }
4566  } else if (canParse<double>(parsedAttribute)) {
4567  errorFormat = "Float cannot be reinterpreted as int; ";
4568  } else {
4569  errorFormat = "Cannot be parsed to int; ";
4570  }
4571  }
4572  // Set extra checks for float(double) values
4573  if (attrProperties.isFloat()) {
4574  if (canParse<double>(parsedAttribute)) {
4575  // obtain double value
4576  double parsedDoubleAttribute = parse<double>(parsedAttribute);
4577  //check if can be negative and Zero
4578  if (attrProperties.isPositive() && (parsedDoubleAttribute < 0)) {
4579  errorFormat = "Cannot be negative; ";
4580  }
4581  } else {
4582  errorFormat = "Cannot be parsed to float; ";
4583  }
4584  }
4585  // Set extra checks for bool values
4586  if (attrProperties.isBool()) {
4587  if (!canParse<bool>(parsedAttribute)) {
4588  errorFormat = "Cannot be parsed to boolean; ";
4589  }
4590  }
4591  // Set extra checks for position values
4592  if (attrProperties.isposition()) {
4593  // check if we're parsing a single position or an entire shape
4594  if (attrProperties.isList()) {
4595  // check if parsed attribute can be parsed to Position Vector
4596  if (!canParse<PositionVector>(parsedAttribute)) {
4597  errorFormat = "List of Positions aren't neither x,y nor x,y,z; ";
4598  }
4599  } else if (!canParse<Position>(parsedAttribute)) {
4600  errorFormat = "Position is neither x,y nor x,y,z; ";
4601  }
4602  }
4603  // set extra check for time(double) values
4604  if (attrProperties.isSUMOTime()) {
4605  if (!canParse<SUMOTime>(parsedAttribute)) {
4606  errorFormat = "Cannot be parsed to SUMOTime; ";
4607  }
4608  }
4609  // set extra check for probability values
4610  if (attrProperties.isProbability()) {
4611  if (canParse<double>(parsedAttribute)) {
4612  // parse to double and check if is between [0,1]
4613  double probability = parse<double>(parsedAttribute);
4614  if (probability < 0) {
4615  errorFormat = "Probability cannot be smaller than 0; ";
4616  } else if (probability > 1) {
4617  errorFormat = "Probability cannot be greather than 1; ";
4618  }
4619  } else {
4620  errorFormat = "Cannot be parsed to probability; ";
4621  }
4622  }
4623  // set extra check for range values
4624  if (attrProperties.hasAttrRange()) {
4625  if (canParse<double>(parsedAttribute)) {
4626  // parse to double and check if is in range
4627  double range = parse<double>(parsedAttribute);
4628  if (range < attrProperties.getMinimumRange()) {
4629  errorFormat = "Float cannot be smaller than " + toString(attrProperties.getMinimumRange()) + "; ";
4630  } else if (range > attrProperties.getMaximumRange()) {
4631  errorFormat = "Float cannot be greather than " + toString(attrProperties.getMaximumRange()) + "; ";
4632  }
4633  } else {
4634  errorFormat = "Cannot be parsed to float; ";
4635  }
4636  }
4637  // set extra check for discrete values
4638  if (attrProperties.isDiscrete()) {
4639  // search value in the list of discretes values of attribute properties
4640  auto finder = std::find(attrProperties.getDiscreteValues().begin(), attrProperties.getDiscreteValues().end(), parsedAttribute);
4641  // check if attribute is valid
4642  if (finder == attrProperties.getDiscreteValues().end()) {
4643  errorFormat = "value is not within the set of allowed values for attribute '" + toString(attribute) + "'";
4644  }
4645  }
4646  // set extra check for color values
4647  if (attrProperties.isColor() && !canParse<RGBColor>(parsedAttribute)) {
4648  errorFormat = "Invalid RGB format or named color; ";
4649  }
4650  // set extra check for filename values
4651  if (attrProperties.isFilename()) {
4652  if (SUMOXMLDefinitions::isValidFilename(parsedAttribute) == false) {
4653  errorFormat = "Filename contains invalid characters; ";
4654  } else if (parsedAttribute.empty() && !attrProperties.isOptional()) {
4655  errorFormat = "Filename cannot be empty; ";
4656  }
4657  }
4658  // set extra check for name values
4659  if ((attribute == SUMO_ATTR_NAME) && !SUMOXMLDefinitions::isValidAttribute(parsedAttribute)) {
4660  errorFormat = "name contains invalid characters; ";
4661  }
4662  // set extra check for SVCPermissions values
4663  if (attrProperties.isVClass()) {
4664  if (!canParseVehicleClasses(parsedAttribute)) {
4665  errorFormat = "List of VClasses isn't valid; ";
4666  parsedAttribute = defaultValue;
4667  }
4668  }
4669  // set extra check for RouteProbes
4670  if ((attribute == SUMO_ATTR_ROUTEPROBE) && !SUMOXMLDefinitions::isValidAdditionalID(parsedAttribute)) {
4671  errorFormat = "RouteProbe ID contains invalid characters; ";
4672  }
4673  // set extra check for list of edges
4674  if ((attribute == SUMO_ATTR_EDGES) && parsedAttribute.empty()) {
4675  errorFormat = "List of edges cannot be empty; ";
4676  }
4677  // set extra check for list of lanes
4678  if ((attribute == SUMO_ATTR_LANES) && parsedAttribute.empty()) {
4679  errorFormat = "List of lanes cannot be empty; ";
4680  }
4681  // set extra check for list of VTypes
4682  if ((attribute == SUMO_ATTR_VTYPES) && !parsedAttribute.empty() && !SUMOXMLDefinitions::isValidListOfTypeID(parsedAttribute)) {
4683  errorFormat = "List of vTypes contains invalid characters; ";
4684  }
4685  // set extra check for list of RouteProbe
4686  if ((attribute == SUMO_ATTR_ROUTEPROBE) && !parsedAttribute.empty() && !SUMOXMLDefinitions::isValidAdditionalID(parsedAttribute)) {
4687  errorFormat = "RouteProbe ID contains invalid characters; ";
4688  }
4689  // If attribute has an invalid format
4690  if (errorFormat.size() > 0) {
4691  // if attribute is optional and has a default value, obtain it as string. In other case, abort.
4692  if (attrProperties.isOptional()) {
4693  WRITE_DEBUG("Format of optional " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " +
4694  warningMessage + " is invalid; " + errorFormat + "Default value will be used.");
4695  // set default value defined in AttrProperties
4696  parsedAttribute = attrProperties.getDefaultValue();
4697  } else {
4698  WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " +
4699  warningMessage + " is invalid; " + errorFormat + GNETagProperties.getTagStr() + " cannot be created");
4700  // set default value (To avoid errors in parse<T>(parsedAttribute))
4701  parsedAttribute = defaultValue;
4702  // return false to abort creation of element
4703  return false;
4704  }
4705  }
4706  // return true to continue creation of element
4707  return true;
4708 }
4709 
4710 
4711 bool
4713  const GNEAttributeProperties& attrProperties, std::string& parsedAttribute, std::string& warningMessage) {
4714  // if element can mask their XYPosition, then must be extracted X Y coordiantes separeted
4715  std::string x, y, z;
4716  bool parsedOk = true;
4717  // give a default value to parsedAttribute to avoid problem parsing invalid positions
4718  parsedAttribute = "0,0";
4719  if (attrs.hasAttribute(SUMO_ATTR_X)) {
4720  x = attrs.get<std::string>(SUMO_ATTR_X, objectID.c_str(), parsedOk, false);
4721  // check that X attribute is valid
4722  if (!canParse<double>(x)) {
4723  WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_X) + "' of " +
4724  warningMessage + " is invalid; Cannot be parsed to float; " + GNETagProperties.getTagStr() + " cannot be created");
4725  // abort parsing (and creation) of element
4726  return false;
4727  }
4728  } else {
4729  WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_X) + "' of " +
4730  warningMessage + " is missing; " + GNETagProperties.getTagStr() + " cannot be created");
4731  // abort parsing (and creation) of element
4732  return false;
4733  }
4734  if (attrs.hasAttribute(SUMO_ATTR_Y)) {
4735  y = attrs.get<std::string>(SUMO_ATTR_Y, objectID.c_str(), parsedOk, false);
4736  // check that X attribute is valid
4737  if (!canParse<double>(y)) {
4738  WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Y) + "' of " +
4739  warningMessage + " is invalid; Cannot be parsed to float; " + GNETagProperties.getTagStr() + " cannot be created");
4740  // abort parsing (and creation) of element
4741  return false;
4742  }
4743  } else {
4744  WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Y) + "' of " +
4745  warningMessage + " is missing; " + GNETagProperties.getTagStr() + " cannot be created");
4746  // abort parsing (and creation) of element
4747  return false;
4748  }
4749  // Z attribute is optional
4750  if (attrs.hasAttribute(SUMO_ATTR_Z)) {
4751  z = attrs.get<std::string>(SUMO_ATTR_Z, objectID.c_str(), parsedOk, false);
4752  // check that Z attribute is valid
4753  if (!canParse<double>(z)) {
4754  WRITE_WARNING("Format of optional " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Z) + "' of " +
4755  warningMessage + " is invalid; Cannot be parsed to float; " + GNETagProperties.getTagStr() + " cannot be created");
4756  // leave Z attribute empty
4757  z.clear();
4758  }
4759  }
4760  // create Position attribute using parsed coordinates X, Y and, optionally, Z
4761  if (z.empty()) {
4762  parsedAttribute = x + "," + y;
4763  } else {
4764  parsedAttribute = x + "," + y + "," + z;
4765  }
4766  // continue creation of element
4767  return true;
4768 }
4769 
4770 
4771 /****************************************************************************/
GUISelectedStorage gSelected
A global holder of selected objects.
@ PARKINGSPACE
@ PERSONTRIP_BUSSTOP
@ CLOSINGREROUTE
@ CONTAINERSTOP
@ DATAINTERVAL
@ ROUTEPROBREROUTE
@ CHARGINGSTATION
@ WALK_BUSSTOP
@ PARKINGZONEREROUTE
@ CLOSINGLANEREROUTE
@ RIDE_BUSSTOP
@ DESTPROBREROUTE
@ PERSONTRIP_FROMTO
@ REROUTERINTERVAL
@ VARIABLESPEEDSIGN
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:286
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition: SUMOTime.cpp:45
long long int SUMOTime
Definition: SUMOTime.h:31
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_PEDESTRIAN
pedestrian
const double DEFAULT_VEH_PROB
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
@ SVS_UNKNOWN
not defined
const std::string DEFAULT_VTYPE_ID
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_WALK_BUSSTOP_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_EDGE
@ GNE_TAG_PERSONSTOP_BUSSTOP
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ GNE_TAG_RIDE_BUSSTOP_BUSSTOP
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
@ GNE_TAG_PERSONTRIP_BUSSTOP_EDGE
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_E2DETECTOR
an e2 detector
@ GNE_TAG_PERSONTRIP_STOP_EDGE
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_VTYPE
description of a vehicle type
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
@ SUMO_TAG_NOTHING
invalid tag
@ GNE_TAG_WALK_EDGES
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_LANECALIBRATOR
A calibrator placed over lane (used in netedit)
@ GNE_TAG_INTERNAL_LANE
@ SUMO_TAG_STOP
stop for vehicles
@ SUMO_TAG_STEP
trigger: a step description
@ GNE_TAG_PERSONTRIP_EDGE_STOP
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route (used in NETEDIT)
@ GNE_TAG_VSS_SYMBOL
VSS Symbol.
@ SUMO_TAG_LANETYPE
lane type
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ GNE_TAG_RIDE_BUSSTOP_EDGE
@ SUMO_TAG_CONNECTION
connectio between two lanes
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_PARKING_ZONE_REROUTE
entry for an alternative parking zone
@ GNE_TAG_RIDE_EDGE_EDGE
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_DET_ENTRY
an e3 entry point
@ GNE_TAG_PERSONSTOP_EDGE
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ GNE_TAG_PERSONTRIP_STOP_STOP
@ GNE_TAG_WALK_EDGE_EDGE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_MEANDATA_EDGE
an edge based mean data detector
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ GNE_TAG_PERSONTRIP_EDGE_BUSSTOP
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_WALK_BUSSTOP_EDGE
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
@ GNE_TAG_VEHICLE_WITHROUTE
@ GNE_TAG_RIDE_EDGE_BUSSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_STOP
@ SUMO_TAG_POILANE
begin/end of the description of a Point of interest over Lane (used by Netedit)
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
@ SUMO_TAG_DATASET
@ SUMO_TAG_E1DETECTOR
an e1 detector
@ GNE_TAG_PERSONTRIP_BUSSTOP_BUSSTOP
@ SUMO_TAG_PERSON
@ SUMO_TAG_DET_EXIT
an e3 exit point
@ SUMO_TAG_TYPE
type (edge)
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
@ GNE_TAG_REROUTER_SYMBOL
Rerouter Symbol.
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ GNE_TAG_PERSONTRIP_STOP_BUSSTOP
@ GNE_TAG_WALK_EDGE_BUSSTOP
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_E3DETECTOR
an e3 detector
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_TAG_FLOW_CALIBRATOR
a flow definition within in Calibrator (used in NETEDIT)
@ GNE_TAG_WALK_ROUTE
@ SUMO_TAG_PERSONFLOW
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_TMP4
@ SUMO_ATTR_CONTAINER_TRIGGERED
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_PARKING
@ SUMO_ATTR_EXTENSION
@ SUMO_ATTR_LCA_PUSHY
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_LINES
@ SUMO_ATTR_NUMBER
@ SUMO_ATTR_ALLOW
@ SUMO_ATTR_ARRIVALSPEED
@ SUMO_ATTR_LANE
@ GNE_ATTR_FROM_BUSSTOP
from busStop (used by personPlans)
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
@ SUMO_ATTR_ARRIVALLANE
@ SUMO_ATTR_DEPART
@ SUMO_ATTR_CONT
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
@ SUMO_ATTR_VEHSPERHOUR
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_VIA
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
@ SUMO_ATTR_LCA_ASSERTIVE
@ SUMO_ATTR_RADIUS
The turning radius at an intersection in m.
@ SUMO_ATTR_TRAIN_TYPE
@ SUMO_ATTR_FILE
@ SUMO_ATTR_CONTAINER_STOP
@ SUMO_ATTR_PARKING_AREA
@ GNE_ATTR_OPPOSITE
neighboring lane, simplified lane attr instead of child element
@ SUMO_ATTR_Y
@ SUMO_ATTR_CF_IDMM_ADAPT_TIME
@ SUMO_ATTR_FROM_LANE
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_Z
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ SUMO_ATTR_DEPARTPOS_LAT
@ SUMO_ATTR_PARKING_LENGTH
@ SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_LCA_PUSHYGAP
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_LCA_LOOKAHEADLEFT
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_MAXSPEED_LAT
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
@ SUMO_ATTR_X
@ SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_TMP3
@ SUMO_ATTR_ACTTYPE
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_TLLAYOUT
node: the layout of the traffic light program
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_LCA_IMPATIENCE
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_MINGAP
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_OFF
@ SUMO_ATTR_ROUTEPROBE
@ SUMO_ATTR_LINEWIDTH
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_FRINGE
Fringe type of node.
@ SUMO_ATTR_CONTAINER_NUMBER
@ SUMO_ATTR_EXPECTED
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
@ SUMO_ATTR_TMP2
@ SUMO_ATTR_PRIORITY
@ SUMO_ATTR_LINE
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_CF_IDM_DELTA
@ SUMO_ATTR_LCA_MAXSPEEDLATFACTOR
@ SUMO_ATTR_NUMLANES
@ SUMO_ATTR_LANES
@ SUMO_ATTR_MODES
@ SUMO_ATTR_VTYPES
@ SUMO_ATTR_CF_PWAGNER2009_TAULAST
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_DEPARTPOS
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_DECEL
@ SUMO_ATTR_LCA_MAXSPEEDLATSTANDING
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ SUMO_ATTR_WEIGHT
@ SUMO_ATTR_GUISHAPE
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ GNE_ATTR_TO_BUSSTOP
to busStop (used by personPlans)
@ SUMO_ATTR_TLTYPE
node: the type of traffic light
@ SUMO_ATTR_CHARGEINTRANSIT
Allow/disallow charge in transit in Charging Stations.
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_INDEX
@ SUMO_ATTR_FILL
Fill the polygon.
@ SUMO_ATTR_NAME
@ SUMO_ATTR_PERIOD
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_LCA_COOPERATIVE_PARAM
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ SUMO_ATTR_LCA_OPPOSITE_PARAM
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_FREQUENCY
@ SUMO_ATTR_PASS
@ SUMO_ATTR_DEPARTSPEED
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_ENDOFFSET
@ SUMO_ATTR_MINGAP_LAT
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_EMERGENCYDECEL
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_LCA_SUBLANE_PARAM
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_ROADSIDE_CAPACITY
@ SUMO_ATTR_ACCELERATION
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_LATALIGNMENT
@ GNE_ATTR_FROM_STOP
from stop (used by personPlans)
@ SUMO_ATTR_CF_IDM_STEPPING
@ SUMO_ATTR_DEPARTLANE
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
@ SUMO_ATTR_IMPATIENCE
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_VCLASS
@ SUMO_ATTR_ACCEL
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_DISTANCE
@ SUMO_ATTR_OUTPUT
@ SUMO_ATTR_JM_SIGMA_MINOR
@ SUMO_ATTR_CHARGINGPOWER
@ SUMO_ATTR_PROB
@ GNE_ATTR_BIDIR
whether an edge is part of a bidirectional railway
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_SPEEDFACTOR
@ SUMO_ATTR_ONROAD
@ SUMO_ATTR_EXPECTED_CONTAINERS
@ SUMO_ATTR_TO_LANE
@ SUMO_ATTR_UNCONTROLLED
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_PERSON_NUMBER
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_EFFICIENCY
Eficiency of the charge in Charging Stations.
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
@ SUMO_ATTR_MAXSPEED
@ SUMO_ATTR_ID
@ SUMO_ATTR_SIGMA
@ SUMO_ATTR_VISIBLE
@ SUMO_ATTR_UNTIL
@ SUMO_ATTR_RIGHT_OF_WAY
How to compute right of way.
@ SUMO_ATTR_K
@ SUMO_ATTR_TMP1
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_OSGFILE
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_LCA_ACCEL_LAT
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
@ SUMO_ATTR_TAU
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
@ SUMO_ATTR_IMGFILE
@ SUMO_ATTR_TRIGGERED
@ SUMO_ATTR_DURATION
@ SUMO_ATTR_CONTPOS
@ SUMO_ATTR_WIDTH
@ SUMO_ATTR_DIR
The abstract direction of a link.
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
@ SUMO_ATTR_POSITION
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_TMP5
@ SUMO_ATTR_STATE
The state of a link.
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
@ GNE_ATTR_TO_STOP
to stop (used by personPlans)
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations.
@ SUMO_ATTR_LCA_TIME_TO_IMPATIENCE
@ SUMO_ATTR_JM_TIMEGAP_MINOR
@ SUMO_ATTR_TIME
trigger: the time of the step
@ SUMO_ATTR_CARRIAGE_GAP
@ SUMO_ATTR_SPEEDDEV
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
@ SUMO_ATTR_RELATIVEPATH
@ SUMO_ATTR_PERSONSPERHOUR
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
#define FALLTHROUGH
Definition: StdDefs.h:34
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:250
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
static void fillPersonPlanBusStopEdge(SumoXMLTag currentTag)
fill person plan busStop -> edge
virtual std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
static void fillCommonStopAttributes(SumoXMLTag currentTag, const bool parking)
fill stop person attributes (used by stops and personStps)
GNEAttributeCarrier(const SumoXMLTag tag, GNENet *net)
Constructor.
static void fillPersonPlanBusStopStop(SumoXMLTag currentTag)
fill person plan busStop -> stop
static void fillPersonPlanBusStopBusStop(SumoXMLTag currentTag)
fill person plan busStop -> edge
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
static void fillVehicleElements()
fill vehicle elements
static void fillDemandElements()
fill demand elements
static void fillPersonPlanEdgeEdge(SumoXMLTag currentTag)
fill person plan edge -> edge
static GNETagProperties dummyTagProperty
dummy TagProperty used for reference some elements (for Example, dummyEdge)
static void fillPersonElements()
fill person elements
void setACParameters(const std::string &parameters, GNEUndoList *undoList)
set parameters (string)
static void fillDataElements()
fill Data elements
static void fillPersonPlanRides()
fill person plan rides
static void fillAdditionals()
fill additional elements
static void fillPersonPlanStopBusStop(SumoXMLTag currentTag)
fill person plan stop -> edge
static void fillLaneChangingModelAttributes(SumoXMLTag currentTag)
fill Junction Model Attributes of Vehicle/Person Types
static void fillAttributeCarriers()
fill Attribute Carriers
static const std::string FEATURE_LOADED
static void fillCommonPersonAttributes(SumoXMLTag currentTag)
fill common person attributes (used by person and personFlows)
static void fillNetworkElements()
fill network elements
static void fillPersonPlanEdgeStop(SumoXMLTag currentTag)
fill person plan edge -> stop
static void fillPersonStopElements()
fill personStop elements
static const std::string FEATURE_APPROVED
feature has been approved but not changed (i.e. after being reguessed)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
std::string getAlternativeValueForDisabledAttributes(SumoXMLAttr key) const
static const GNETagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
void removeACParametersKeys(const std::vector< std::string > &keepKeys, GNEUndoList *undoList)
remove keys
const std::string & getTagStr() const
get tag assigned to this object in string format
static void fillPersonPlanEdgeBusStop(SumoXMLTag currentTag)
fill person plan edge -> edge
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
static void fillStopElements()
fill stop elements
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
static bool parseMaskedPositionAttribute(const SUMOSAXAttributes &attrs, const std::string &objectID, const GNETagProperties &tagProperties, const GNEAttributeProperties &attrProperties, std::string &parsedAttribute, std::string &warningMessage)
parse and check masked (note: This function is only to improve legilibility)
static void fillPersonTripAttributes(SumoXMLTag currentTag)
fill specific person trip attributes
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
static void fillPersonPlanStopStop(SumoXMLTag currentTag)
fill person plan stop -> stop
static void fillCommonVehicleAttributes(SumoXMLTag currentTag)
fill common vehicle attributes (used by vehicles, trips, routeFlows and flows)
void addACParameters(const std::string &key, const std::string &attribute, GNEUndoList *undoList)
add (or update attribute) key and attribute
FXIcon * getIcon() const
get FXIcon associated to this AC
virtual const std::map< std::string, std::string > & getACParametersMap() const =0
virtual bool isAttributeEnabled(SumoXMLAttr key) const =0
static bool lanesConsecutives(const std::vector< GNELane * > &lanes)
check if lanes are consecutives
static void fillCommonFlowAttributes(SumoXMLTag currentTag, const bool forVehicles)
fill common flow attributes (used by flows, routeFlows and personFlows)
static void fillPersonPlanStopEdge(SumoXMLTag currentTag)
fill person plan stop -> edge
static std::vector< std::pair< SumoXMLTag, const std::string > > getAllowedTagsByCategory(const int tagPropertyCategory, const bool onlyDrawables)
get tags of all editable element types using TagProperty Type (NetworkEditMode::NETWORKELEMENT,...
static void fillPersonPlanWalks()
fill person plan walks
static void fillTAZElements()
fill TAZ elements
static const double INVALID_POSITION
invalid double position
static bool checkParsedAttribute(const GNETagProperties &tagProperties, const GNEAttributeProperties &attrProperties, const SumoXMLAttr attribute, std::string &defaultValue, std::string &parsedAttribute, std::string &warningMessage)
parse and check attribute (note: This function is only to improve legilibility)
GNENet * myNet
pointer to net
static void fillJunctionModelAttributes(SumoXMLTag currentTag)
fill Junction Model Attributes of Vehicle/Person Types
static void fillShapes()
fill shape elements
GNENet * getNet() const
get pointer to net
static void fillPersonPlanTrips()
fill person plan trips
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
static std::vector< SumoXMLTag > allowedTags(const bool onlyDrawables)
get tags of all editable element types
static void fillCarFollowingModelAttributes(SumoXMLTag currentTag)
fill Car Following Model of Vehicle/Person Types
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
T getACParameters() const
get parameters
static void fillRideAttributes(SumoXMLTag currentTag)
fill specific ride attributes
virtual ~GNEAttributeCarrier()
Destructor.
virtual std::string getAttribute(SumoXMLAttr key) const =0
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
static std::map< SumoXMLTag, GNETagProperties > myTagProperties
map with the tags properties
static const size_t MAXNUMBEROFATTRIBUTES
max number of attributes allowed for every tag
double getMaximumRange() const
get maximum range
bool isVClass() const
return true if atribute is a VehicleClass
bool isProbability() const
return true if atribute is a probability
bool isColor() const
return true if atribute is a color
void setDiscreteValues(const std::vector< std::string > &discreteValues)
set discrete values
bool isBool() const
return true if atribute is boolean
std::string getDescription() const
return a description of attribute
bool isFlowDefinition() const
return true if atribute is part of a flow definition
bool hasAttrRange() const
return true if Attr correspond to an element that only accept a range of values
bool isList() const
return true if atribute is a list
bool isInt() const
return true if atribute is an integer
bool isDiscrete() const
return true if atribute is discrete
bool isOptional() const
return true if atribute is optional (it will be written in XML only if his value is different of defa...
const std::string & getDefaultValue() const
get default value
double getMinimumRange() const
get minimum range
bool isFloat() const
return true if atribute is a float
void setRange(const double minimum, const double maximum)
set range
bool isSUMOTime() const
return true if atribute is a SUMOTime
bool isposition() const
return true if atribute is a position
bool isPositive() const
return true if atribute is positive
const std::vector< std::string > & getDiscreteValues() const
get discrete values
bool isFilename() const
return true if atribute is a filename
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1337
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
Definition: GNENet.cpp:1141
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2245
void addedLockedObject(const GUIGlObjectType type)
set object selected
void removeLockedObject(const GUIGlObjectType type)
set object unselected
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
bool isShape() const
return true if tag correspond to a shape
bool isTAZElement() const
return true if tag correspond to a TAZ element
bool isGenericData() const
return true if tag correspond to a generic data element
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
const GNEAttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
bool isNetworkElement() const
return true if tag correspond to a network element
bool isSelectable() const
return true if tag correspond to a selectable element
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
bool isDetector() const
return true if tag correspond to a shape (Only used to group all detectors in the XML)
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:467
GNEViewParent * getViewParent() const
get the net object
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
void deselect(GUIGlID id)
Deselects the object with the given id.
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:339
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:333
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:336
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:330
A storage for options typed value containers)
Definition: OptionsCont.h:89
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
A list of positions.
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:168
Encapsulated SAX-Attributes.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static StringBijection< SumoXMLNodeType > NodeTypes
node types
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidAdditionalID(const std::string &value)
whether the given string is a valid id for an additional object
static StringBijection< TrainType > TrainTypes
train types
static bool isValidDetectorID(const std::string &value)
whether the given string is a valid id for an detector
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
static StringBijection< FringeType > FringeTypeValues
fringe types
static const bool DEFAULT_RELATIVEPATH
Definition: Shape.h:46
static const double DEFAULT_LAYER
Definition: Shape.h:41
static const double DEFAULT_LAYER_POI
Definition: Shape.h:43
static const double DEFAULT_IMG_WIDTH
Definition: Shape.h:47
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:45
static const double DEFAULT_ANGLE
Definition: Shape.h:44
static const double DEFAULT_IMG_HEIGHT
Definition: Shape.h:48
static const std::string DEFAULT_TYPE
Definition: Shape.h:40
std::vector< std::string > getStrings() const
std::vector< std::string > getVector()
return vector of strings
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network