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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Abstract Base class for gui objects which carry attributes
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <algorithm>
31 #include <netbuild/NBEdge.h>
34 
35 #include "GNEAttributeCarrier.h"
36 #include "GNEUndoList.h"
37 #include "GNENet.h"
38 
39 
40 // ===========================================================================
41 // static members
42 // ===========================================================================
43 
44 std::map<SumoXMLTag, GNEAttributeCarrier::TagValues> GNEAttributeCarrier::myAllowedTags;
45 
46 const std::string GNEAttributeCarrier::FEATURE_LOADED = "loaded";
47 const std::string GNEAttributeCarrier::FEATURE_GUESSED = "guessed";
48 const std::string GNEAttributeCarrier::FEATURE_MODIFIED = "modified";
49 const std::string GNEAttributeCarrier::FEATURE_APPROVED = "approved";
50 const double GNEAttributeCarrier::INVALID_POSITION = -1000000;
51 
52 
53 // ===========================================================================
54 // method definitions
55 // ===========================================================================
56 
57 // ---------------------------------------------------------------------------
58 // GNEAttributeCarrier::TagValues - methods
59 // ---------------------------------------------------------------------------
60 
62  myTagProperty(TAGPROPERTY_NETELEMENT),
63  myIcon(ICON_EMPTY),
64  myPositionListed(0),
65  myParentTag(SUMO_TAG_NOTHING),
66  myTagSynonym(SUMO_TAG_NOTHING) {
67 }
68 
69 
70 GNEAttributeCarrier::TagValues::TagValues(int tagProperty, int positionListed, GUIIcon icon, SumoXMLTag parentTag, SumoXMLTag tagSynonym) :
71  myTagProperty(tagProperty),
72  myIcon(icon),
73  myPositionListed(positionListed),
74  myParentTag(parentTag),
75  myTagSynonym(tagSynonym) {
76 }
77 
78 
79 const std::string&
81  if (myAttributeValues.count(attr) == 0) {
82  throw ProcessError("Attribute '" + toString(attr) + "' not defined");
83  } else if (!myAttributeValues.at(attr).hasDefaultValue()) {
84  throw ProcessError("attribute '" + toString(attr) + "' doesn't have a default value");
85  } else {
86  return myAttributeValues.at(attr).getDefaultValue();
87  }
88 }
89 
90 
91 int
93  return myPositionListed;
94 }
95 
96 
97 void
98 GNEAttributeCarrier::TagValues::addAttribute(SumoXMLAttr attr, int attributeProperty, const std::string& definition, const std::string& defaultValue, std::vector<std::string> discreteValues, SumoXMLAttr synonym) {
99  if (isAttributeDeprecated(attr)) {
100  throw ProcessError("Attribute '" + toString(attr) + "' is deprecated and cannot be inserted");
101  } else if (myAttributeValues.count(attr) != 0) {
102  throw ProcessError("Attribute '" + toString(attr) + "' already inserted");
103  } else {
104  myAttributeValues[attr] = AttributeValues(attributeProperty, (int)myAttributeValues.size(), definition, defaultValue, discreteValues, synonym);
105  }
106 }
107 
108 
109 void
110 GNEAttributeCarrier::TagValues::addAttribute(SumoXMLAttr attr, int attributeProperty, const std::string& definition, const std::string& defaultValue, SumoXMLAttr synonym) {
111  if (isAttributeDeprecated(attr)) {
112  throw ProcessError("Attribute '" + toString(attr) + "' is deprecated and cannot be inserted");
113  } else if (myAttributeValues.count(attr) != 0) {
114  throw ProcessError("Attribute '" + toString(attr) + "' already inserted");
115  } else {
116  myAttributeValues[attr] = AttributeValues(attributeProperty, (int)myAttributeValues.size(), definition, defaultValue, std::vector<std::string>(), synonym);
117  }
118 }
119 
120 
121 void
123  // Check that attribute wasn't already inserted
124  for (auto i : myAttributeValues) {
125  if (i.first == attr) {
126  throw ProcessError("Attribute '" + toString(attr) + "' is deprecated but was inserted in list of attributes");
127  }
128  }
129  // add it into myDeprecatedAttributes
130  myDeprecatedAttributes.push_back(attr);
131 }
132 
133 
136  if (myAttributeValues.count(attr) != 0) {
137  return myAttributeValues.at(attr);
138  } else {
139  // check if we're try to loading an synonym
140  for (auto i : myAttributeValues) {
141  if (i.second.hasAttrSynonym() && i.second.getAttrSynonym() == attr) {
142  return myAttributeValues.at(i.first);
143  }
144  }
145  // throw error if these attribute doesn't exist
146  throw ProcessError("Attribute '" + toString(attr) + "' doesn't exist");
147  }
148 }
149 
150 
151 std::map<SumoXMLAttr, GNEAttributeCarrier::AttributeValues>::const_iterator
153  return myAttributeValues.begin();
154 }
155 
156 
157 std::map<SumoXMLAttr, GNEAttributeCarrier::AttributeValues>::const_iterator
159  return myAttributeValues.end();
160 }
161 
162 
163 int
165  return (int)myAttributeValues.size();
166 }
167 
168 
169 GUIIcon
171  return myIcon;
172 }
173 
174 
177  if (hasParent()) {
178  return myParentTag;
179  } else {
180  throw ProcessError("Tag doesn't have parent");
181  }
182 }
183 
184 
187  if (hasTagSynonym()) {
188  return myTagSynonym;
189  } else {
190  throw ProcessError("Tag doesn't have synonym");
191  }
192 }
193 
194 
195 bool
197  return (myAttributeValues.count(attr) == 1);
198 }
199 
200 
201 bool
203  return (myTagProperty & TAGPROPERTY_NETELEMENT) != 0;
204 }
205 
206 
207 bool
209  return (myTagProperty & TAGPROPERTY_ADDITIONAL) != 0;
210 }
211 
212 
213 bool
215  return (myTagProperty & TAGPROPERTY_DRAWABLE) != 0;
216 }
217 
218 
219 bool
221  return (myTagProperty & TAGPROPERTY_SELECTABLE) != 0;
222 }
223 
224 
225 bool
227  return (myTagProperty & TAGPROPERTY_SHAPE) != 0;
228 }
229 
230 
231 bool
234 }
235 
236 
237 bool
239  return (myTagProperty & TAGPROPERTY_DETECTOR) != 0;
240 }
241 
242 
243 bool
246 }
247 
248 
249 bool
251  return (myTagProperty & TAGPROPERTY_BLOCKSHAPE) != 0;
252 }
253 
254 
255 bool
257  return (myTagProperty & TAGPROPERTY_CLOSESHAPE) != 0;
258 }
259 
260 
261 bool
263  return (myTagProperty & TAGPROPERTY_GEOPOSITION) != 0;
264 }
265 
266 
267 bool
269  return (myTagProperty & TAGPROPERTY_GEOSHAPE) != 0;
270 }
271 
272 
273 bool
275  return (myTagProperty & TAGPROPERTY_PARENT) != 0;
276 }
277 
278 
279 bool
281  return (myTagProperty & TAGPROPERTY_SYNONYM) != 0;
282 }
283 
284 
285 bool
287  return (myTagProperty & TAGPROPERTY_DIALOG) != 0;
288 }
289 
290 
291 bool
294 }
295 
296 
297 bool
299  return (myTagProperty & TAGPROPERTY_REPARENT) != 0;
300 }
301 
302 
303 bool
306 }
307 
308 
309 bool
312 }
313 
314 
315 bool
317  return (std::find(myDeprecatedAttributes.begin(), myDeprecatedAttributes.end(), attr) != myDeprecatedAttributes.end());
318 }
319 
320 // ---------------------------------------------------------------------------
321 // GNEAttributeCarrier::AttributeValues - methods
322 // ---------------------------------------------------------------------------
323 
325  myAttributeProperty(ATTRPROPERTY_STRING),
326  myPositionListed(0),
327  myDefinition(""),
328  myDefaultValue(""),
329  myAttrSynonym(SUMO_ATTR_NOTHING) {}
330 
331 
332 GNEAttributeCarrier::AttributeValues::AttributeValues(int attributeProperty, int positionListed, const std::string& definition, const std::string& defaultValue, const std::vector<std::string>& discreteValues, SumoXMLAttr synonym) :
333  myAttributeProperty(attributeProperty),
334  myPositionListed(positionListed),
335  myDefinition(definition),
336  myDefaultValue(defaultValue),
337  myDiscreteValues(discreteValues),
338  myAttrSynonym(synonym) {
339  // Check that color attributes always owns an default value
340  if (isColor() && myDefaultValue.empty()) {
341  throw FormatException("Color attributes must own always a default color");
342  }
343 }
344 
345 
346 int
348  return myPositionListed;
349 }
350 
351 
352 const std::string&
354  return myDefinition;
355 }
356 
357 
358 const std::string&
360  return myDefaultValue;
361 }
362 
363 
364 std::string
366  std::string pre;
367  std::string type;
368  std::string plural;
369  std::string last;
370  // pre type
371  if ((myAttributeProperty & ATTRPROPERTY_LIST) != 0) {
372  pre += "list of ";
374  plural = "es";
375  } else {
376  plural = "s";
377  }
378  }
380  pre += "positive ";
381  }
383  pre += "non editable ";
384  }
386  pre += "discrete ";
387  }
389  pre += "optional ";
390  }
392  pre += "unique ";
393  }
395  pre += "combinable ";
396  }
397  // type
398  if ((myAttributeProperty & ATTRPROPERTY_INT) != 0) {
399  type = "integer";
400  }
402  type = "float";
403  }
404  if ((myAttributeProperty & ATTRPROPERTY_BOOL) != 0) {
405  type = "boolean";
406  }
408  type = "string";
409  }
411  type = "position";
412  }
414  type = "color";
415  }
417  type = "VClass";
418  }
420  type = "filename";
421  }
423  type = "probability";
424  last = "[0, 1]";
425  }
426  if ((myAttributeProperty & ATTRPROPERTY_TIME) != 0) {
427  type = "time";
428  }
430  type = "angle";
431  last = "[0, 360]";
432  }
433  return pre + type + plural + last;
434 }
435 
436 
437 const std::vector<std::string>&
439  return myDiscreteValues;
440 }
441 
442 
445  if (hasAttrSynonym()) {
446  return myAttrSynonym;
447  } else {
448  throw ProcessError("Attr doesn't have synonym");
449  }
450 }
451 
452 
453 bool
456 }
457 
458 
459 bool
462 }
463 
464 
465 bool
467  return (myAttributeProperty & ATTRPROPERTY_INT) != 0;
468 }
469 
470 
471 bool
473  return (myAttributeProperty & ATTRPROPERTY_FLOAT) != 0;
474 }
475 
476 
477 bool
479  return (myAttributeProperty & ATTRPROPERTY_BOOL) != 0;
480 }
481 
482 
483 bool
486 }
487 
488 
489 bool
492 }
493 
494 
495 bool
498 }
499 
500 
501 bool
503  return (myAttributeProperty & ATTRPROPERTY_TIME) != 0;
504 }
505 
506 
507 bool
510 }
511 
512 
513 bool
516 }
517 
518 
519 bool
521  return (myAttributeProperty & ATTRPROPERTY_COLOR) != 0;
522 }
523 
524 
525 bool
528 }
529 
530 
531 bool
534 }
535 
536 
537 bool
540 }
541 
542 
543 bool
545  return (myAttributeProperty & ATTRPROPERTY_LIST) != 0;
546 }
547 
548 
549 bool
552 }
553 
554 
555 bool
558 }
559 
560 
561 bool
564 }
565 
566 
567 bool
570 }
571 
572 
573 bool
576 }
577 
578 // ---------------------------------------------------------------------------
579 // GNEAttributeCarrier - methods
580 // ---------------------------------------------------------------------------
581 
583  myTag(tag),
584  mySelected(false) {
585 }
586 
587 
588 template<> int
589 GNEAttributeCarrier::parse(const std::string& string) {
590  return TplConvert::_str2int(string);
591 }
592 
593 
594 template<> double
595 GNEAttributeCarrier::parse(const std::string& string) {
596  return TplConvert::_str2double(string);
597 }
598 
599 
600 template<> bool
601 GNEAttributeCarrier::parse(const std::string& string) {
602  return TplConvert::_str2Bool(string);
603 }
604 
605 
606 template<> std::string
607 GNEAttributeCarrier::parse(const std::string& string) {
608  return string;
609 }
610 
611 
612 template<> SUMOVehicleClass
613 GNEAttributeCarrier::parse(const std::string& string) {
614  if (string.size() == 0) {
615  throw EmptyData();
616  } else if (!SumoVehicleClassStrings.hasString(string)) {
617  return SVC_IGNORING;
618  } else {
619  return SumoVehicleClassStrings.get(string);
620  }
621 }
622 
623 
624 template<> RGBColor
625 GNEAttributeCarrier::parse(const std::string& string) {
626  return RGBColor::parseColor(string);
627 }
628 
629 
630 template<> Position
631 GNEAttributeCarrier::parse(const std::string& string) {
632  if (string.size() == 0) {
633  throw EmptyData();
634  } else {
635  bool ok = true;
636  PositionVector pos = GeomConvHelper::parseShapeReporting(string, "netedit-given", 0, ok, false, false);
637  if (!ok || pos.size() != 1) {
638  throw NumberFormatException();
639  } else {
640  return pos[0];
641  }
642  }
643 }
644 
645 
646 template<> SUMOVehicleShape
647 GNEAttributeCarrier::parse(const std::string& string) {
648  if ((string == "unknown") || (!SumoVehicleShapeStrings.hasString(string))) {
649  return SVS_UNKNOWN;
650  } else {
651  return SumoVehicleShapeStrings.get(string);
652  }
653 }
654 
655 
656 template<> std::vector<std::string>
657 GNEAttributeCarrier::parse(const std::string& string) {
658  return StringTokenizer(string, " ").getVector();
659 }
660 
661 
662 template<> std::vector<int>
663 GNEAttributeCarrier::parse(const std::string& string) {
664  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
665  std::vector<int> parsedIntValues;
666  for (auto i : parsedValues) {
667  parsedIntValues.push_back(parse<int>(i));
668  }
669  return parsedIntValues;
670 }
671 
672 
673 template<> std::vector<double>
674 GNEAttributeCarrier::parse(const std::string& string) {
675  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
676  std::vector<double> parsedDoubleValues;
677  for (auto i : parsedValues) {
678  parsedDoubleValues.push_back(parse<double>(i));
679  }
680  return parsedDoubleValues;
681 }
682 
683 
684 template<> std::vector<bool>
685 GNEAttributeCarrier::parse(const std::string& string) {
686  std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
687  std::vector<bool> parsedBoolValues;
688  for (auto i : parsedValues) {
689  parsedBoolValues.push_back(parse<bool>(i));
690  }
691  return parsedBoolValues;
692 }
693 
694 
695 template<> std::vector<GNEEdge*>
696 GNEAttributeCarrier::parse(GNENet* net, const std::string& value) {
697  // Declare string vector
698  std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
699  std::vector<GNEEdge*> parsedEdges;
700  // Iterate over edges IDs, retrieve Edges and add it into parsedEdges
701  for (auto i : edgeIds) {
702  GNEEdge* retrievedEdge = net->retrieveEdge(i, false);
703  if (retrievedEdge) {
704  parsedEdges.push_back(net->retrieveEdge(i));
705  } else {
706  throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_EDGES) + ". " + toString(SUMO_TAG_EDGE) + " '" + i + "' doesn't exist.");
707  }
708  }
709  return parsedEdges;
710 }
711 
712 
713 template<> std::vector<GNELane*>
714 GNEAttributeCarrier::parse(GNENet* net, const std::string& value) {
715  // Declare string vector
716  std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
717  std::vector<GNELane*> parsedLanes;
718  // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes
719  for (auto i : laneIds) {
720  GNELane* retrievedLane = net->retrieveLane(i, false);
721  if (retrievedLane) {
722  parsedLanes.push_back(net->retrieveLane(i));
723  } else {
724  throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_LANES) + ". " + toString(SUMO_TAG_LANE) + " '" + i + "' doesn't exist.");
725  }
726  }
727  return parsedLanes;
728 }
729 
730 
731 template<> std::string
732 GNEAttributeCarrier::parseIDs(const std::vector<GNEEdge*>& ACs) {
733  // obtain ID's of edges and return their join
734  std::vector<std::string> edgeIDs;
735  for (auto i : ACs) {
736  edgeIDs.push_back(i->getID());
737  }
738  return joinToString(edgeIDs, " ");
739 }
740 
741 
742 template<> std::string
743 GNEAttributeCarrier::parseIDs(const std::vector<GNELane*>& ACs) {
744  // obtain ID's of lanes and return their join
745  std::vector<std::string> laneIDs;
746  for (auto i : ACs) {
747  laneIDs.push_back(i->getID());
748  }
749  return joinToString(laneIDs, " ");
750 }
751 
752 
753 bool
754 GNEAttributeCarrier::parseStringToANDBool(const std::string& string) {
755  // obtain boolean vector (throw exception if string is empty)
756  std::vector<bool> boolValues = GNEAttributeCarrier::parse<std::vector<bool> >(string);
757  // set value of checkbox
758  if (boolValues.size() == 1) {
759  return boolValues.front();
760  } else {
761  int sum = 0;
762  for (auto i : boolValues) {
763  sum += (int)(i);
764  }
765  // only return true if all values are true
766  if ((sum == 0) || (sum != (int)boolValues.size())) {
767  return false;
768  } else {
769  return true;
770  }
771  }
772 }
773 
774 
775 std::string
777  return getAttribute(key);
778 }
779 
780 
783  return myTag;
784 }
785 
786 
787 FXIcon*
789  // define on first access
790  if (myAllowedTags.size() == 0) {
792  }
793  return GUIIconSubSys::getIcon(myAllowedTags.at(myTag).getGUIIcon());
794 }
795 
796 
797 const std::string
799  return getAttribute(SUMO_ATTR_ID);
800 }
801 
802 // ===========================================================================
803 // static methods
804 // ===========================================================================
805 
808  // define on first access
809  if (myAllowedTags.size() == 0) {
811  }
812  // check that tag is defined
813  if (myAllowedTags.count(tag) == 0) {
814  throw ProcessError("Attributes for tag '" + toString(tag) + "' not defined");
815  } else {
816  return myAllowedTags.at(tag);
817  }
818 }
819 
820 
821 std::vector<SumoXMLTag>
822 GNEAttributeCarrier::allowedTags(bool onlyDrawables) {
823  std::vector<SumoXMLTag> allTags;
824  // define on first access
825  if (myAllowedTags.size() == 0) {
827  }
828  // fill all tags
829  for (auto i : myAllowedTags) {
830  if (!onlyDrawables || i.second.isDrawable()) {
831  allTags.push_back(i.first);
832  }
833  }
834  return allTags;
835 }
836 
837 
838 std::vector<SumoXMLTag>
840  std::vector<SumoXMLTag> netElementTags;
841  // define on first access
842  if (myAllowedTags.size() == 0) {
844  }
845  // fill netElements tags
846  for (auto i : myAllowedTags) {
847  if (i.second.isNetElement() && (!onlyDrawables || i.second.isDrawable())) {
848  netElementTags.push_back(i.first);
849  }
850  }
851  return netElementTags;
852 }
853 
854 
855 std::vector<SumoXMLTag>
857  std::vector<SumoXMLTag> additionalTags;
858  // define on first access
859  if (myAllowedTags.size() == 0) {
861  }
862  // fill additional tags
863  for (auto i : myAllowedTags) {
864  if (i.second.isAdditional() && (!onlyDrawables || i.second.isDrawable())) {
865  additionalTags.push_back(i.first);
866  }
867  }
868  return additionalTags;
869 }
870 
871 
872 std::vector<SumoXMLTag>
874  std::vector<SumoXMLTag> shapeTags;
875  // define on first access
876  if (myAllowedTags.size() == 0) {
878  }
879  // fill shape tags
880  for (auto i : myAllowedTags) {
881  if (i.second.isShape() && (onlyDrawables || i.second.isDrawable())) {
882  shapeTags.push_back(i.first);
883  }
884  }
885  return shapeTags;
886 }
887 
888 
889 int
891  int maxNumAttribute = 0;
892  // define on first access
893  if (myAllowedTags.size() == 0) {
895  }
896  // get max num attributes
897  for (auto i : myAllowedTags) {
898  maxNumAttribute = MAX2(maxNumAttribute, i.second.getNumberOfAttributes());
899  }
900  return maxNumAttribute;
901 }
902 
903 
904 bool
906  // separate value in a vector of string using | as separator
907  std::vector<std::string> parsedValues;
908  StringTokenizer stValues(value, "|", true);
909  while (stValues.hasNext()) {
910  parsedValues.push_back(stValues.next());
911  }
912  // check that parsed values (A=B)can be parsed in generic parameters
913  for (auto i : parsedValues) {
914  std::vector<std::string> parsedParameters;
915  StringTokenizer stParam(i, "=", true);
916  while (stParam.hasNext()) {
917  parsedParameters.push_back(stParam.next());
918  }
919  // Check that parsed parameters are exactly two
920  if (parsedParameters.size() == 2) {
921  // check that key and value contains valid characters
922  if (!SUMOXMLDefinitions::isValidGenericParameterKey(parsedParameters.front()) || !SUMOXMLDefinitions::isValidGenericParameterValue(parsedParameters.back())) {
923  return false;
924  }
925  } else {
926  return false;
927  }
928  }
929  // all ok, then return true
930  return true;
931 }
932 
933 
934 int
936  if (settings.drawForSelecting) {
937  return 8;
938  } else if (settings.scale >= 10) {
939  return 32;
940  } else if (settings.scale >= 2) {
941  return 16;
942  } else {
943  return 8;
944  }
945 }
946 
947 
948 void
950  const OptionsCont& oc = OptionsCont::getOptions();
951  // obtain Node Types except NODETYPE_DEAD_END_DEPRECATED
952  std::vector<std::string> nodeTypes = SUMOXMLDefinitions::NodeTypes.getStrings();
953  nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_DEAD_END_DEPRECATED)));
954  // fill all ACs
955  SumoXMLTag currentTag = SUMO_TAG_EDGE;
956  {
957  // set values of tag
959  // set values of attributes
960  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
962  "The id of the edge",
963  "");
964  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FROM,
966  "The name of a node within the nodes-file the edge shall start at",
967  "");
968  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TO,
970  "The name of a node within the nodes-file the edge shall end at",
971  "");
972  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEED,
974  "The maximum speed allowed on the edge in m/s",
975  toString(oc.getFloat("default.speed")));
976  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PRIORITY,
978  "The priority of the edge",
979  toString(oc.getInt("default.priority")));
980  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NUMLANES,
982  "The number of lanes of the edge",
983  toString(oc.getInt("default.lanenumber")));
984  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TYPE,
986  "The name of a type within the SUMO edge type file",
987  "");
988  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ALLOW,
990  "Explicitly allows the given vehicle classes (not given will be not allowed)",
991  "all",
992  SumoVehicleClassStrings.getStrings());
993  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DISALLOW,
995  "Explicitly disallows the given vehicle classes (not given will be allowed)",
996  "",
997  SumoVehicleClassStrings.getStrings());
998  //myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PREFER, );
999  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SHAPE,
1001  "If the shape is given it should start and end with the positions of the from-node and to-node",
1002  "");
1003  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LENGTH,
1005  "The length of the edge in meter",
1006  "");
1007  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPREADTYPE,
1009  "Lane width for all lanes of this edge in meters (used for visualization)",
1010  "right",
1012  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1014  "street name (need not be unique, used for visualization)",
1015  "");
1016  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
1018  "Lane width for all lanes of this edge in meters (used for visualization)",
1019  "-1");
1020  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ENDOFFSET,
1022  "Move the stop line back from the intersection by the given amount",
1023  "0");
1024  myAllowedTags[currentTag].addAttribute(GNE_ATTR_SHAPE_START,
1025  ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_DEFAULTVALUE, // virtual attribute used to define an endPoint
1026  "Custom position in which shape start (by default position of junction from)",
1027  "");
1028  myAllowedTags[currentTag].addAttribute(GNE_ATTR_SHAPE_END,
1029  ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_DEFAULTVALUE, // virtual attribute from to define an endPoint
1030  "Custom position in which shape end (by default position of junction from)",
1031  "");
1032  myAllowedTags[currentTag].addAttribute(GNE_ATTR_BIDIR,
1033  ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_NONEDITABLE, // virtual attribute to check of this edge is part of a bidirectional railway (cannot be edited)
1034  "Show if edge is bidireccional",
1035  "0");
1036  }
1037  currentTag = SUMO_TAG_JUNCTION;
1038  {
1039  // set values of tag
1041  // set values of attributes
1042  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1044  "The id of the node",
1045  "");
1046  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1047  ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_POSITION, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1048  "The x-y-z position of the node on the plane in meters",
1049  "");
1050  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TYPE,
1052  "An optional type for the node",
1053  "",
1054  nodeTypes);
1055  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SHAPE,
1057  "A custom shape for that node",
1058  "");
1059  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_RADIUS,
1061  "Optional turning radius (for all corners) for that node in meters",
1062  "1.5");
1063  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_KEEP_CLEAR,
1065  "Whether the junction-blocking-heuristic should be activated at this node",
1066  "1");
1067  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TLTYPE,
1069  "An optional type for the traffic light algorithm",
1070  "",
1072  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TLID,
1074  "An optional id for the traffic light program",
1075  "");
1076  }
1077  currentTag = SUMO_TAG_LANE;
1078  {
1079  // set values of tag
1081  // set values of attributes
1082  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1084  "ID of lane (Automatic, non editable)",
1085  "");
1086  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_INDEX,
1088  "The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one)",
1089  "");
1090  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEED,
1092  "Speed in meters per second",
1093  "13.89");
1094  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ALLOW,
1096  "Explicitly allows the given vehicle classes (not given will be not allowed)",
1097  "all",
1098  SumoVehicleClassStrings.getStrings());
1099  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DISALLOW,
1101  "Explicitly disallows the given vehicle classes (not given will be allowed)",
1102  "",
1103  SumoVehicleClassStrings.getStrings());
1104  //myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PREFER, );
1105  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
1107  "Width in meters (used for visualization)",
1108  "-1");
1109  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ENDOFFSET,
1111  "Move the stop line back from the intersection by the given amount",
1112  "0");
1113  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ACCELERATION,
1115  "Enable or disable lane as acceleration lane",
1116  "0");
1117  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CUSTOMSHAPE,
1119  "If the shape is given it overrides the computation based on edge shape",
1120  "");
1121  }
1122  currentTag = SUMO_TAG_CROSSING;
1123  {
1124  // set values of tag
1126  // set values of attributes
1127  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1129  "The ID of Crossing",
1130  "");
1131  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGES,
1133  "The (road) edges which are crossed",
1134  "");
1135  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PRIORITY,
1137  "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections)",
1138  "0");
1139  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
1141  "The width of the crossings",
1142  toString(OptionsCont::getOptions().getFloat("default.crossing-width")));
1143  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TLLINKINDEX,
1145  "sets the tls-index for this crossing",
1146  "-1");
1147  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TLLINKINDEX2,
1149  "sets the opposite-direction tls-index for this crossing",
1150  "-1");
1151  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CUSTOMSHAPE,
1153  "Overrids default shape of pedestrian crossing",
1154  "");
1155  }
1156  currentTag = SUMO_TAG_CONNECTION;
1157  {
1158  // set values of tag
1160  // set values of attributes
1161  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FROM,
1163  "The name of the edge the vehicles leave",
1164  "");
1165  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TO,
1167  "The name of the edge the vehicles may reach when leaving 'from'",
1168  "");
1169  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FROM_LANE,
1171  "the lane index of the incoming lane (numbers starting with 0)",
1172  "");
1173  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TO_LANE,
1175  "the lane index of the outgoing lane (numbers starting with 0)",
1176  "");
1177  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PASS,
1179  "if set, vehicles which pass this (lane-2-lane) connection) will not wait",
1180  "0");
1181  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_KEEP_CLEAR,
1183  "if set to false, vehicles which pass this (lane-2-lane) connection) will not worry about blocking the intersection",
1184  "0");
1185  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CONTPOS,
1187  "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",
1189  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_UNCONTROLLED,
1191  "If set to true, This connection will not be TLS-controlled despite its node being controlled",
1192  "0");
1193  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VISIBILITY_DISTANCE,
1195  "",
1197  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TLLINKINDEX,
1199  "sets the distance to the connection at which all relevant foes are visible",
1200  "-1");
1201  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEED,
1203  "sets custom speed limit for the connection",
1205  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CUSTOMSHAPE,
1207  "sets custom shape for the connection",
1208  "");
1209  }
1210  currentTag = SUMO_TAG_BUS_STOP;
1211  {
1212  // set values of tag
1214  // set values of attributes
1215  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1217  "The id of bus stop",
1218  "");
1219  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1221  "The name of the lane the bus stop shall be located at",
1222  "");
1223  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_STARTPOS,
1225  "The begin position on the lane (the lower position on the lane) in meters",
1226  "");
1227  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ENDPOS,
1229  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m",
1230  "");
1231  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1233  "Name of " + toString(currentTag),
1234  "");
1235  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1237  "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",
1238  "0");
1239  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LINES,
1241  "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes",
1242  "");
1243  }
1244  currentTag = SUMO_TAG_ACCESS;
1245  {
1246  // set values of tag
1248  // set values of attributes
1249  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1251  "The name of the lane the stop access shall be located at",
1252  "");
1253  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1255  "The position on the lane (the lower position on the lane) in meters",
1256  "0");
1257  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LENGTH,
1259  "The walking length of the access in meters",
1260  "");
1261  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1263  "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",
1264  "0");
1265  }
1266  currentTag = SUMO_TAG_CONTAINER_STOP;
1267  {
1268  // set values of tag
1270  // set values of attributes
1271  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1273  "The id of container stop",
1274  "");
1275  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1277  "The name of the lane the container stop shall be located at",
1278  "");
1279  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_STARTPOS,
1281  "The begin position on the lane (the lower position on the lane) in meters",
1282  "");
1283  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ENDPOS,
1285  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m",
1286  "");
1287  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1289  "Name of " + toString(currentTag),
1290  "");
1291  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1293  "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",
1294  "0");
1295  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LINES,
1297  "meant to be the names of the bus lines that stop at this container stop. This is only used for visualization purposes",
1298  "");
1299  }
1300  currentTag = SUMO_TAG_CHARGING_STATION;
1301  {
1302  // set values of tag
1304  // set values of attributes
1305  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1307  "The id of charging station",
1308  "");
1309  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1311  "Lane of the charging station location",
1312  "");
1313  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_STARTPOS,
1315  "Begin position in the specified lane",
1316  "");
1317  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ENDPOS,
1319  "End position in the specified lane",
1320  "");
1321  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1323  "Name of " + toString(currentTag),
1324  "");
1325  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1327  "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",
1328  "0");
1329  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CHARGINGPOWER,
1331  "Charging power in W",
1332  "22000.00");
1333  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EFFICIENCY,
1335  "Charging efficiency [0,1]",
1336  "0.95");
1337  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CHARGEINTRANSIT,
1339  "Enable or disable charge in transit, i.e. vehicle must or must not to stop for charging",
1340  "0");
1341  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CHARGEDELAY,
1343  "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins",
1344  "0.00");
1345  }
1346  currentTag = SUMO_TAG_PARKING_AREA;
1347  {
1348  // set values of tag
1350  // set values of attributes
1351  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1353  "The id of ParkingArea",
1354  "");
1355  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1357  "The name of the lane the Parking Area shall be located at",
1358  "");
1359  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_STARTPOS,
1361  "The begin position on the lane (the lower position on the lane) in meters",
1362  "");
1363  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ENDPOS,
1365  "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m",
1366  "");
1367  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1369  "Name of " + toString(currentTag),
1370  "");
1371  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ROADSIDE_CAPACITY,
1373  " The number of parking spaces for road-side parking ",
1374  "0");
1375  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1377  "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",
1378  "0");
1379  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
1381  "The width of the road-side parking spaces",
1382  "3.20");
1383  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LENGTH,
1385  "The length of the road-side parking spaces. By default (endPos - startPos) / roadsideCapacity",
1386  "");
1387  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ANGLE,
1389  "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise",
1390  "0.00");
1391  }
1392  currentTag = SUMO_TAG_PARKING_SPACE;
1393  {
1394  // set values of tag
1396  // set values of attributes
1397  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_X,
1399  "The X position in meters of the parking vehicle",
1400  "");
1401  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_Y,
1403  "The Y position in meters of the parking vehicle",
1404  "");
1405  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_Z,
1407  "The Z position in meters of the parking vehicle",
1408  "0.00");
1409  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
1411  "The width of the road-side parking spaces",
1412  "3.20");
1413  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LENGTH,
1415  "The length of the road-side parking spaces",
1416  "5.00");
1417  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ANGLE,
1419  "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise",
1420  "0.00");
1421  }
1422  currentTag = SUMO_TAG_E1DETECTOR;
1423  {
1424  // set values of tag
1426  // set values of attributes
1427  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1429  "The id of E1",
1430  "");
1431  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1433  "The id of the lane the detector shall be laid on. The lane must be a part of the network used",
1434  "");
1435  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1437  "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",
1438  "");
1439  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FREQUENCY,
1441  "The aggregation period the values the detector collects shall be summed up",
1442  "900.00");
1443  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1445  "Name of " + toString(currentTag),
1446  "");
1447  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILE,
1449  "The path to the output file",
1450  "");
1451  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VTYPES,
1453  "Space separated list of vehicle type ids to consider",
1454  "");
1455  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1457  "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",
1458  "0");
1459  }
1460  currentTag = SUMO_TAG_E2DETECTOR;
1461  {
1462  // set values of tag
1464  // set "file" as deprecated attribute
1465  myAllowedTags[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT);
1466  // set values of attributes
1467  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1469  "The id of E2",
1470  "");
1471  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1473  "The id of the lane the detector shall be laid on. The lane must be a part of the network used",
1474  "");
1475  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1477  "The position on the lane the detector shall be laid on in meters",
1478  "");
1479  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LENGTH,
1481  "The length of the detector in meters",
1482  "10.00");
1483  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FREQUENCY,
1485  "The aggregation period the values the detector collects shall be summed up",
1486  "900.00");
1487  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1489  "Name of " + toString(currentTag),
1490  "");
1491  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILE,
1493  "The path to the output file",
1494  "");
1495  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VTYPES,
1497  "Space separated list of vehicle type ids to consider",
1498  "");
1499  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD,
1501  "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)",
1502  "1.00");
1503  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HALTING_SPEED_THRESHOLD,
1505  "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
1506  "1.39");
1507  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_JAM_DIST_THRESHOLD,
1509  "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m",
1510  "10.00");
1511  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1513  "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",
1514  "0");
1515  }
1516  currentTag = SUMO_TAG_E3DETECTOR;
1517  {
1518  // set values of tag
1520  // set values of attributes
1521  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1523  "The id of E3",
1524  "");
1525  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1527  "X-Y position of detector in editor (Only used in NETEDIT)",
1528  "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1529  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FREQUENCY,
1531  "The aggregation period the values the detector collects shall be summed up",
1532  "900.00");
1533  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1535  "Name of " + toString(currentTag),
1536  "");
1537  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILE,
1539  "The path to the output file",
1540  "");
1541  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VTYPES,
1543  "Space separated list of vehicle type ids to consider",
1544  "");
1545  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD,
1547  "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting) in s",
1548  "1.00");
1549  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HALTING_SPEED_THRESHOLD,
1551  "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
1552  "1.39");
1553  }
1554  currentTag = SUMO_TAG_DET_ENTRY;
1555  {
1556  // set values of tag
1558  // set values of attributes
1559  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1561  "The id of the lane the detector shall be laid on. The lane must be a part of the network used",
1562  "");
1563  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1565  "The position on the lane the detector shall be laid on in meters",
1566  "");
1567  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1569  "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",
1570  "0");
1571  }
1572  currentTag = SUMO_TAG_DET_EXIT;
1573  {
1574  // set values of tag
1576  // set values of attributes
1577  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1579  "The id of the lane the detector shall be laid on. The lane must be a part of the network used",
1580  "");
1581  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1583  "The position on the lane the detector shall be laid on in meters",
1584  "");
1585  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1587  "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",
1588  "0");
1589  }
1590  currentTag = SUMO_TAG_INSTANT_INDUCTION_LOOP;
1591  {
1592  // set values of tag
1594  // set values of attributes
1595  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1597  "The id of Instant Induction Loop (E1Instant)",
1598  "");
1599  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1601  "The id of the lane the detector shall be laid on. The lane must be a part of the network used",
1602  "");
1603  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1605  "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",
1606  "");
1607  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1609  "Name of " + toString(currentTag),
1610  "");
1611  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILE,
1613  "The path to the output file",
1614  "");
1615  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VTYPES,
1617  "Space separated list of vehicle type ids to consider",
1618  "");
1619  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FRIENDLY_POS,
1621  "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",
1622  "0");
1623  }
1624  currentTag = SUMO_TAG_VSS;
1625  {
1626  // set values of tag
1628  // set "file" as deprecated attribute
1629  myAllowedTags[currentTag].addDeprecatedAttribute(SUMO_ATTR_FILE);
1630  // set values of attributes
1631  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1633  "The id of Variable Speed Signal",
1634  "");
1635  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1637  "X-Y position of detector in editor (Only used in NETEDIT)",
1638  "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1639  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANES,
1641  "list of lanes of Variable Speed Sign",
1642  "");
1643  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1645  "Name of " + toString(currentTag),
1646  "");
1647  }
1648  currentTag = SUMO_TAG_STEP;
1649  {
1650  // set values of tag
1652  // set values of attributes
1653  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TIME,
1655  "Time",
1656  "");
1657  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEED,
1659  "Speed",
1660  "13.89");
1661  }
1662  currentTag = SUMO_TAG_CALIBRATOR;
1663  {
1664  // set values of tag
1666  // set values of attributes
1667  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1669  "The id of Calibrator",
1670  "");
1671  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGE,
1673  "The id of edge in the simulation network",
1674  "");
1675  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1677  "The position of the calibrator on the specified lane",
1678  "0");
1679  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FREQUENCY,
1681  "The aggregation interval in which to calibrate the flows. default is step-length",
1682  "1.00");
1683  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1685  "Name of " + toString(currentTag),
1686  "");
1687  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ROUTEPROBE,
1689  "The id of the routeProbe element from which to determine the route distribution for generated vehicles",
1690  "");
1691  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_OUTPUT,
1693  "The output file for writing calibrator information or NULL",
1694  "");
1695  }
1696  currentTag = SUMO_TAG_LANECALIBRATOR;
1697  {
1698  // set values of tag
1700  // set values of attributes
1701  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1703  "The id of Calibrator",
1704  "");
1705  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1707  "The id of lane in the simulation network",
1708  "");
1709  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1711  "The position of the calibrator on the specified lane",
1712  "0");
1713  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FREQUENCY,
1715  "The aggregation interval in which to calibrate the flows. default is step-length",
1716  "100.00");
1717  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1719  "Name of " + toString(currentTag),
1720  "");
1721  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ROUTEPROBE,
1723  "The id of the routeProbe element from which to determine the route distribution for generated vehicles",
1724  "");
1725  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_OUTPUT,
1727  "The output file for writing calibrator information or NULL",
1728  "");
1729  }
1730  currentTag = SUMO_TAG_FLOW;
1731  {
1732  // set values of tag
1734  // set values of attributes
1735  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TYPE,
1737  "The id of the vehicle type to use for this vehicle",
1739  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ROUTE,
1741  "The id of the route the vehicle shall drive along",
1742  "");
1743  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VEHSPERHOUR,
1745  "Number of vehicles per hour, equally spaced",
1746  "");
1747  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEED,
1749  "Speed of vehicles",
1750  "");
1751  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_COLOR,
1753  "This vehicle's color",
1754  "yellow");
1755  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_BEGIN,
1757  "First vehicle departure time",
1758  "0.00");
1759  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_END,
1761  "End of departure interval",
1762  "3600.00");
1763  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DEPARTLANE,
1765  "The lane on which the vehicle shall be inserted",
1766  "first");
1767  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DEPARTPOS,
1769  "The position at which the vehicle shall enter the net",
1770  "base");
1771  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DEPARTSPEED,
1773  "The speed with which the vehicle shall enter the network",
1774  "0");
1775  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ARRIVALLANE,
1777  "The lane at which the vehicle shall leave the network",
1778  "current");
1779  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ARRIVALPOS,
1781  "The position at which the vehicle shall leave the network",
1782  "max");
1783  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ARRIVALSPEED,
1785  "The speed with which the vehicle shall leave the network",
1786  "current");
1787  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LINE,
1789  "A string specifying the id of a public transport line which can be used when specifying person rides",
1790  "");
1791  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PERSON_NUMBER,
1793  "The number of occupied seats when the vehicle is inserted",
1794  "0");
1795  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CONTAINER_NUMBER,
1797  "The number of occupied container places when the vehicle is inserted",
1798  "0");
1799  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_REROUTE,
1801  "Whether the vehicle should be equipped with a rerouting device",
1802  "0");
1803  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DEPARTPOS_LAT,
1805  "The lateral position on the departure lane at which the vehicle shall enter the net",
1806  "center",
1808  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ARRIVALPOS_LAT,
1810  "The lateral position on the arrival lane at which the vehicle shall arrive",
1811  "center",
1813  }
1814  currentTag = SUMO_TAG_ROUTE;
1815  {
1816  // set values of tag
1818  // set values of attributes
1819  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1821  "The id of Route",
1822  "");
1823  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGES,
1825  "The edges the vehicle shall drive along, given as their ids, separated using spaces",
1826  "");
1827  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_COLOR,
1829  "This route's color",
1830  "yellow");
1831  }
1832  currentTag = SUMO_TAG_REROUTER;
1833  {
1834  // set values of tag
1836  // set values of attributes
1837  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1839  "The id of Rerouter",
1840  "");
1841  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGES,
1843  "An edge id or a list of edge ids where vehicles shall be rerouted",
1844  "");
1845  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
1847  "X,Y position in editor (Only used in NETEDIT)",
1848  "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1849  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1851  "Name of " + toString(currentTag),
1852  "");
1853  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILE,
1855  "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)",
1856  "");
1857  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PROB,
1859  "The probability for vehicle rerouting (0-1)",
1860  "1.00");
1861  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD,
1863  "The waiting time threshold (in s) that must be reached to activate rerouting (default -1 which disables the threshold)",
1864  "0.00");
1865  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VTYPES,
1867  "The list of vehicle types that shall be affected by this rerouter (empty to affect all types)",
1868  "");
1869  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_OFF,
1871  "Whether the router should be inactive initially (and switched on in the gui)",
1872  "0");
1873  }
1874  currentTag = SUMO_TAG_INTERVAL;
1875  {
1876  // set values of tag
1878  // set values of attributes
1879  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_BEGIN,
1881  "Begin",
1882  "0");
1883  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_END,
1885  "End",
1886  "3600.00");
1887  }
1888  currentTag = SUMO_TAG_CLOSING_REROUTE;
1889  {
1890  // set values of tag
1892  // set values of attributes
1893  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGE,
1895  "Edge ID",
1896  "",
1897  SUMO_ATTR_ID);
1898  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ALLOW,
1900  "allowed vehicles",
1901  "");
1902  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DISALLOW,
1904  "disallowed vehicles",
1905  "");
1906  }
1907  currentTag = SUMO_TAG_CLOSING_LANE_REROUTE;
1908  {
1909  // set values of tag
1911  // set values of attributes
1912  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
1914  "Lane ID",
1915  "",
1916  SUMO_ATTR_ID);
1917  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ALLOW,
1919  "allowed vehicles",
1920  "");
1921  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DISALLOW,
1923  "disallowed vehicles",
1924  "");
1925  }
1926  currentTag = SUMO_TAG_DEST_PROB_REROUTE;
1927  {
1928  // set values of tag
1930  // set values of attributes
1931  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGE,
1933  "Edge ID",
1934  "",
1935  SUMO_ATTR_ID);
1936  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PROB,
1938  "probability",
1939  "1.00");
1940  }
1941  currentTag = SUMO_TAG_PARKING_ZONE_REROUTE;
1942  {
1943  // set values of tag
1945  // set values of attributes
1946  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PARKING,
1948  "ParkingArea ID",
1949  "",
1950  SUMO_ATTR_ID);
1951  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PROB,
1953  "probability",
1954  "1.00");
1955  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VISIBLE,
1957  "Enable or disable visibility for parking area reroutes",
1958  "1");
1959  }
1960  currentTag = SUMO_TAG_ROUTE_PROB_REROUTE;
1961  {
1962  // set values of tag
1964  // set values of attributes
1965  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ROUTE,
1967  "Route",
1968  "",
1969  SUMO_ATTR_ID);
1970  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PROB,
1972  "probability",
1973  "1.00");
1974  }
1975  currentTag = SUMO_TAG_ROUTEPROBE;
1976  {
1977  // set values of tag
1979  // set values of attributes
1980  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
1982  "The id of RouteProbe",
1983  "");
1984  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EDGE,
1986  "The id of an edge in the simulation network",
1987  "");
1988  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FREQUENCY,
1990  "The frequency in which to report the distribution",
1991  "3600");
1992  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
1994  "Name of " + toString(currentTag),
1995  "");
1996  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILE,
1998  "The file for generated output",
1999  "");
2000  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_BEGIN,
2002  "The time at which to start generating output",
2003  "0");
2004  }
2005  currentTag = SUMO_TAG_VAPORIZER;
2006  {
2007  // set values of tag
2009  // set values of attributes
2010  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
2012  "Edge in which vaporizer is placed",
2013  "");
2014  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_BEGIN,
2016  "Start Time",
2017  "0");
2018  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_END,
2020  "End Time",
2021  "3600.00");
2022  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_NAME,
2024  "Name of " + toString(currentTag),
2025  "");
2026  }
2027  currentTag = SUMO_TAG_VTYPE;
2028  {
2029  // obtain a vector string with the emissions
2030  std::vector<std::string> emissions = { "zero", "LDV", "LDV_G_EU0", "LDV_G_EU1", "LDV_G_EU2", "LDV_G_EU3", "LDV_G_EU4", "LDV_G_EU5",
2031  "LDV_G_EU6", "LDV_G_East", "LDV_D_EU0", "LDV_D_EU1", "LDV_D_EU2", "LDV_D_EU3", "LDV_D_EU4", "LDV_D_EU5", "LDV_D_EU6",
2032  "PC", "PC_Alternative", "PC_G_EU0", "PC_G_EU1", "PC_G_EU2", "PC_G_EU3", "PC_G_EU4", "PC_G_EU5", "PC_G_EU6", "PC_G_East",
2033  "PC_D_EU0", "PC_D_EU1", "PC_D_EU2", "PC_D_EU3", "PC_D_EU4", "PC_D_EU5", "PC_D_EU6", "Bus", "Coach", "HDV", "HDV_G", "HDV_D_EU0",
2034  "HDV_D_EU1", "HDV_D_EU2", "HDV_D_EU3", "HDV_D_EU4", "HDV_D_EU5", "HDV_D_EU6", "HDV_D_East"
2035  };
2036 
2037  // set values of tag
2039  // set values of attributes
2040  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
2042  "The id of VehicleType",
2043  "");
2044  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ACCEL,
2046  "The acceleration ability of vehicles of this type [m/s^2]",
2047  "2.60");
2048  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_DECEL,
2050  "The deceleration ability of vehicles of this type [m/s^2]",
2051  "4.50");
2052  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SIGMA,
2054  "Car-following model parameter",
2055  "0.50");
2056  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TAU,
2058  "Car-following model parameter",
2059  "1.00");
2060  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LENGTH,
2062  "The vehicle's netto-length (length) [m]",
2063  "5.00");
2064  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_MINGAP,
2066  "Empty space after leader [m]",
2067  "2.50");
2068  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_MAXSPEED,
2070  "The vehicle's maximum velocity [m/s]",
2071  "70.00");
2072  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEEDFACTOR,
2074  "The vehicles expected multiplicator for lane speed limits",
2075  "1.00");
2076  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SPEEDDEV,
2078  "The deviation of the speedFactor",
2079  "0.00");
2080  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_COLOR,
2082  "This vehicle type's color",
2083  "1,1,0");
2084  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_VCLASS,
2086  "An abstract vehicle class",
2087  "passenger",
2088  SumoVehicleClassStrings.getStrings());
2089  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_EMISSIONCLASS,
2091  "An abstract emission class",
2092  "PC_G_EU4",
2093  emissions);
2094  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_GUISHAPE,
2096  "How this vehicle is rendered",
2097  "",
2098  SumoVehicleShapeStrings.getStrings());
2099  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
2101  "The vehicle's width [m] (only used for drawing)",
2102  "2.00");
2103  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_IMGFILE,
2105  "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)",
2106  "");
2107  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_IMPATIENCE,
2109  "Willingess of drivers to impede vehicles with higher priority",
2110  "0.00");
2111  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE_CHANGE_MODEL,
2113  "The model used for changing lanes",
2114  "LC2013",
2116  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL,
2118  "The model used for car following",
2119  "Krauss",
2121  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_PERSON_CAPACITY,
2123  "The number of persons (excluding an autonomous driver) the vehicle can transport",
2124  "4");
2125  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_CONTAINER_CAPACITY,
2127  "The number of containers the vehicle can transport",
2128  "0");
2129  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_BOARDING_DURATION,
2131  "The time required by a person to board the vehicle",
2132  "0.50");
2133  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LOADING_DURATION,
2135  "The time required to load a container onto the vehicle",
2136  "90.00");
2137  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LATALIGNMENT,
2139  "The preferred lateral alignment when using the sublane-model",
2140  "center",
2142  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_MINGAP_LAT,
2144  "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model",
2145  "0.12");
2146  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_MAXSPEED_LAT,
2148  "The maximum lateral speed when using the sublane-model",
2149  "1.00");
2150  }
2151  currentTag = SUMO_TAG_POLY;
2152  {
2153  // set values of tag
2155  // set values of attributes
2156  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
2158  "The id of the polygon",
2159  "");
2160  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_SHAPE,
2162  "The shape of the polygon",
2163  "");
2164  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_COLOR,
2166  "The RGBA color with which the polygon shall be displayed",
2167  "red");
2168  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_FILL,
2170  "An information whether the polygon shall be filled",
2171  "0");
2172  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LAYER,
2174  "The layer in which the polygon lies",
2176  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TYPE,
2178  "A typename for the polygon",
2180  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_IMGFILE,
2182  "A bitmap to use for rendering this polygon",
2184  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_RELATIVEPATH,
2186  "Enable or disable use image file as a relative path",
2188  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ANGLE,
2190  "Angle of rendered image in degree",
2192  }
2193  currentTag = SUMO_TAG_POI;
2194  {
2195  // set values of tag
2197  // set values of attributes
2198  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
2200  "The id of the POI",
2201  "");
2202  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
2203  ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2204  "The position in view",
2205  "");
2206  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_COLOR,
2208  "The color with which the poi shall be displayed",
2209  "red");
2210  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TYPE,
2212  "A typename for the poi",
2214  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LAYER,
2216  "The layer of the poi for drawing and selecting",
2218  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
2220  "Width of rendered image in meters",
2222  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HEIGHT,
2224  "Height of rendered image in meters",
2226  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_IMGFILE,
2228  "A bitmap to use for rendering this poi",
2230  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_RELATIVEPATH,
2232  "Enable or disable use image file as a relative path",
2234  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ANGLE,
2236  "Angle of rendered image in degree",
2238  }
2239  currentTag = SUMO_TAG_POILANE;
2240  {
2241  // set values of tag
2243  // set values of attributes
2244  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ID,
2246  "The id of the POI",
2247  "");
2248  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LANE,
2250  "The name of the lane the poi is located at",
2251  "");
2252  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION,
2254  "The position on the named lane or in the net in meters at which the poi is located at",
2255  "");
2256  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_POSITION_LAT,
2258  "The lateral offset on the named lane at which the poi is located at",
2259  "0.00");
2260  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_COLOR,
2262  "The color with which the poi shall be displayed",
2263  "red");
2264  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_TYPE,
2266  "A typename for the poi",
2268  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_LAYER,
2270  "The layer of the poi for drawing and selecting",
2272  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_WIDTH,
2274  "Width of rendered image in meters",
2276  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_HEIGHT,
2278  "Height of rendered image in meters",
2280  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_IMGFILE,
2282  "A bitmap to use for rendering this poi",
2284  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_RELATIVEPATH,
2286  "Enable or disable use image file as a relative path",
2288  myAllowedTags[currentTag].addAttribute(SUMO_ATTR_ANGLE,
2290  "Angle of rendered image in degree",
2292  }
2293 }
2294 
2295 /****************************************************************************/
2296 
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
static bool _str2Bool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter ...
Definition: TplConvert.h:404
static const std::string FEATURE_APPROVED
feature has been approved but not changed (i.e. after being reguessed)
bool isSVCPermission() const
return true if atribute is a VehicleClass
bool isOptional() const
return true if atribute is optional
The information about how to spread the lanes from the given position.
std::map< SumoXMLAttr, AttributeValues > myAttributeValues
map with the attribute values vinculated with this Tag
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
static StringBijection< SumoXMLTag > CarFollowModels
car following models
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool hasAttribute(SumoXMLAttr attr) const
check if current TagValues owns the attribute attr
static StringBijection< SumoXMLNodeType > NodeTypes
node types
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:173
a routeprobe detector
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:915
double scale
information about a lane&#39;s width (temporary, used for a single view)
description of a vehicle type
static std::vector< SumoXMLTag > allowedAdditionalTags(bool onlyDrawables)
get all editable for tag additional elements
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Whether vehicles must keep the junction clear.
int myAttributeProperty
Property of attribute.
whether a given shape is user-defined
std::string next()
bool hasMinimumNumberOfChilds() const
return true if tag correspond to an element that only have a limited number of childs ...
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:47
const SumoXMLTag myTag
the xml tag to which this attribute carrier corresponds
begin/end of the description of a junction
begin/end of the description of a single lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:268
bool canBlockMovement() const
return true if tag correspond to an element that can block their movement
a flow definition (used by router)
bool isTime() const
return true if atribute is time
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:36
A calibrator placed over edge.
SumoXMLTag myTagSynonym
Tag written in XML (If is SUMO_TAG_NOTHING), original Tag name will be written)
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
bool isBool() const
return true if atribute is boolean
bool hasGEOPosition() const
return true if tag correspond to an element that can use a geo position
static const double DEFAULT_LAYER_POI
Definition: Shape.h:45
lane of a reroute of type closing
A layer number.
connectio between two lanes
Stores the information about how to visualize structures.
Allow/disallow charge in transit in Charging Stations.
static std::map< SumoXMLTag, TagValues > myAllowedTags
map with the tags values
bool isSelectable() const
return true if tag correspond to a selectable element
std::string getDescription() const
return a description of attribute
bool canBeReparent() const
return true if tag correspond to an element that can be reparent
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
foe visibility distance of a link
static const double DEFAULT_IMG_HEIGHT
Definition: Shape.h:50
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
bool hasAttrSynonym() const
return true if Attr correspond to an element that will be written in XML with another name ...
weights: time range begin
link,node: the traffic light id responsible for this link
std::vector< std::string > myDiscreteValues
discrete values that can take this Attribute (by default empty)
FXIcon * getIcon() const
get FXIcon associated to this AC
T MAX2(T a, T b)
Definition: StdDefs.h:76
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:80
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
std::map< SumoXMLAttr, AttributeValues >::const_iterator end() const
get end of attribute values (used for iterate)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
A parking space for a single vehicle within a parking area.
static const std::string DEFAULT_TYPE
Definition: Shape.h:43
const std::string DEFAULT_VTYPE_ID
virtual std::string getAttribute(SumoXMLAttr key) const =0
first coordinate of edge shape
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
bool isString() const
return true if atribute is a string
bool isVClass() const
return true if atribute is a VehicleClass
bool isList() const
return true if atribute is a list
begin/end of the description of a route
std::vector< std::string > getStrings() const
bool isNumerical() const
return true if atribute is numerical (int or float)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
an e3 entry point
static double _str2double(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
Definition: TplConvert.h:357
link: the index of the opposite direction link of a pedestrian crossing
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:262
static std::vector< SumoXMLTag > allowedTags(bool onlyDrawables)
get all editable for tag elements of all types
SumoXMLAttr getAttrSynonym() const
get tag synonym
SumoXMLTag getTagSynonym() const
get tag synonym
SumoXMLAttr myAttrSynonym
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written) ...
bool isStoppingPlace() const
return true if tag correspond to a detector (Only used to group all stoppingPlaces in the output XML)...
std::string myDefinition
text with a definition of attribute
The turning radius at an intersection in m.
whether an edge is part of a bidirectional railway
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
bool canCloseShape() const
return true if tag correspond to an element that can close their shape
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
bool isAttributeDeprecated(SumoXMLAttr attr) const
return true if attribute of this tag is deprecated
An instantenous induction loop.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
static const double INVALID_POSITION
default value for invalid positions (used by POIs and Polygons)
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
static void fillAttributeCarriers()
fill Attribute Carriers
an e3 exit point
A list of positions.
bool isPositive() const
return true if atribute is positive
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
not defined
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:265
static std::vector< SumoXMLTag > allowedShapeTags(bool onlyDrawables)
get all editable for tag shape elements
A calibrator placed over lane (used in netedit)
static int _str2int(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
Definition: TplConvert.h:161
static const bool DEFAULT_RELATIVEPATH
Definition: Shape.h:48
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can&#39;t tell (yet)
invalid attribute
int getPositionListed() const
get position in list (used in frames for listing attributes with certain sort)
static bool parseStringToANDBool(const std::string &string)
parse a string of booleans (1 0 1 1....) using AND operation
node: the type of traffic light
edge: the shape in xml-definition
probability of route of a reroute
probability of destiny of a reroute
const std::string getID() const
function to support debugging
const std::string & getDefaultValue() const
get default value
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
bool canAutomaticSortChilds() const
return true if tag correspond to an element that can sort their childs automatic
bool hasTagSynonym() const
return true if tag correspond to an element that will be written in XML with another tag ...
bool canWriteChildsSeparate() const
return true if tag correspond to an element that can sort their childs automatic
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
bool isNetElement() const
return true if tag correspond to a netElement
bool isDetector() const
return true if tag correspond to a shape (Only used to group all detectors in the XML) ...
begin/end of the description of an edge
bool isColor() const
return true if atribute is a color
std::vector< std::string > getVector()
reroute of type closing
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
entry for an alternative parking zone
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
trigger: the time of the step
void addDeprecatedAttribute(SumoXMLAttr attr)
add deprecated Attribute
GNEAttributeCarrier(SumoXMLTag tag)
Constructor.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
bool canBlockShape() const
return true if tag correspond to an element that can block their shape
virtual std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
std::map< SumoXMLAttr, AttributeValues >::const_iterator begin() const
get begin of attribute values (used for iterate)
const AttributeValues & getAttribute(SumoXMLAttr attr) const
get attribute (throw error if doesn&#39;t exist)
weights: time range end
std::string myDefaultValue
default value (by default empty)
A storage for options typed value containers)
Definition: OptionsCont.h:92
const std::vector< std::string > & getDiscreteValues() const
get discrete values
static int getCircleResolution(const GUIVisualizationSettings &settings)
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
bool isCombinable() const
return true if atribute is combinable with other Attribute
std::vector< SumoXMLAttr > myDeprecatedAttributes
List with the deprecated Attributes.
bool isntZero() const
return true if atribute cannot be zero
crossing between edges for pedestrians
int getPositionListed() const
get position in list (used in frames for listing tags with certain sort)
vaporizer of vehicles
bool isInt() const
return true if atribute is an integer
void addAttribute(SumoXMLAttr attr, int attributeProperty, const std::string &definition, const std::string &defaultValue, std::vector< std::string > discreteValues=std::vector< std::string >(), SumoXMLAttr synonym=SUMO_ATTR_NOTHING)
add attribute (duplicated attributed aren&#39;t allowed)
bool isAdditional() const
return true if tag correspond to an additional
static const std::string FEATURE_LOADED
an aggreagated-output interval
static const double DEFAULT_IMG_WIDTH
Definition: Shape.h:49
bool isShape() const
return true if tag correspond to a shape
A variable speed sign.
Eficiency of the charge in Charging Stations.
int getNumberOfAttributes() const
get number of attributes
link: the index of the link within the traffic light
last coordinate of edge shape
int myTagProperty
Property of attribute.
bool hasGEOShape() const
return true if tag correspond to an element that can use a geo shape
bool isFloat() const
return true if atribute is a float
bool isDiscrete() const
return true if atribute is discrete
static std::vector< SumoXMLTag > allowedNetElementsTags(bool onlyDrawables)
get all editable for tag net elements
static const TagValues & getTagProperties(SumoXMLTag tag)
get Tag Properties
bool isProbability() const
return true if atribute is a probability
Delay in the charge of charging stations.
bool isUnique() const
return true if atribute is unique
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
begin/end of the description of a Point of interest over Lane (used by Netedit)
An access point for a train stop.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1074
A color information.
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc.)
const std::string & getDefinition() const
get default value
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GUIIcon myIcon
icon associated to this Tag
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
struct with the attribute Properties
bool isDrawable() const
return true if tag correspond to a drawable element
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.
Fill the polygon.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:230
vehicles ignoring classes
bool isNonEditable() const
return true if atribute isn&#39;t editable
struct with the attribute Properties
bool isFilename() const
return true if atribute is a filename
bool hasParent() const
return true if tag correspond to an element that can had another element as parent ...
static const double DEFAULT_ANGLE
Definition: Shape.h:46
begin/end of the description of a polygon
static const double DEFAULT_LAYER
Definition: Shape.h:44
trigger: a step description
bool hasDefaultValue() const
return true if attribute owns a default value
SumoXMLTag getTag() const
get XML Tag assigned to this object
SumoXMLTag getParentTag() const
if Tag owns a parent, return parent tag