1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 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 /****************************************************************************/
10 /// @file GNEAttributeCarrier.cpp
11 /// @author Jakob Erdmann
12 /// @date Feb 2011
13 /// @version $Id$
14 ///
15 // Abstract Base class for gui objects which carry attributes
16 /****************************************************************************/
17
18
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <netedit/netelements/GNEEdge.h>
23 #include <netedit/netelements/GNEJunction.h>
24 #include <netedit/netelements/GNELane.h>
25 #include <utils/common/StringTokenizer.h>
26 #include <utils/geom/GeomConvHelper.h>
27 #include <utils/gui/images/GUIIconSubSys.h>
28 #include <utils/options/OptionsCont.h>
29
30 #include "GNEAttributeCarrier.h"
31 #include "GNENet.h"
32
33
34 // ===========================================================================
35 // static members
36 // ===========================================================================
37
38 std::map<SumoXMLTag, GNEAttributeCarrier::TagProperties> GNEAttributeCarrier::myTagProperties;
39 GNEAttributeCarrier::TagProperties GNEAttributeCarrier::dummyTagProperty;
40
41 const std::string GNEAttributeCarrier::FEATURE_LOADED = "loaded";
42 const std::string GNEAttributeCarrier::FEATURE_GUESSED = "guessed";
43 const std::string GNEAttributeCarrier::FEATURE_MODIFIED = "modified";
44 const std::string GNEAttributeCarrier::FEATURE_APPROVED = "approved";
45 const double GNEAttributeCarrier::INVALID_POSITION(-1000000);
46
47
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
51
52 // ---------------------------------------------------------------------------
53 // GNEAttributeCarrier::AttributeProperties - methods
54 // ---------------------------------------------------------------------------
55
AttributeProperties()56 GNEAttributeCarrier::AttributeProperties::AttributeProperties() :
57 myAttribute(SUMO_ATTR_NOTHING),
58 myTagPropertyParent(nullptr),
59 myAttrStr(toString(SUMO_ATTR_NOTHING)),
60 myAttributeProperty(ATTRPROPERTY_STRING),
61 myPositionListed(0),
62 myDefinition(""),
63 myDefaultValue(""),
64 myAttrSynonym(SUMO_ATTR_NOTHING),
65 myMinimumRange(0),
66 myMaximumRange(0) {}
67
68
AttributeProperties(const SumoXMLAttr attribute,const int attributeProperty,const std::string & definition,std::string defaultValue)69 GNEAttributeCarrier::AttributeProperties::AttributeProperties(const SumoXMLAttr attribute, const int attributeProperty, const std::string& definition, std::string defaultValue) :
70 myAttribute(attribute),
71 myTagPropertyParent(nullptr),
72 myAttrStr(toString(attribute)),
73 myAttributeProperty(attributeProperty),
74 myPositionListed(0),
75 myDefinition(definition),
76 myDefaultValue(defaultValue),
77 myAttrSynonym(SUMO_ATTR_NOTHING),
78 myMinimumRange(0),
79 myMaximumRange(0) {
80 // empty definition aren't valid
81 if (definition.empty()) {
82 throw FormatException("Every AttributeProperty needs a definition");
83 }
84 // if default value isn't empty, but attribute doesn't support default values, throw exception.
85 if (!defaultValue.empty() && !(attributeProperty & ATTRPROPERTY_DEFAULTVALUE)) {
86 throw FormatException("AttributeProperty doesn't support default values");
87 }
88 }
89
90
~AttributeProperties()91 GNEAttributeCarrier::AttributeProperties::~AttributeProperties() {}
92
93
94 void
checkAttributeIntegrity()95 GNEAttributeCarrier::AttributeProperties::checkAttributeIntegrity() {
96 // check that secuential attributes correspond to a list
97 if (isSecuential() && !isList()) {
98 throw FormatException("Secuential property only is compatible with list properties");
99 }
100 // check that synonym attribute isn't nothing
101 if (hasAttrSynonym() && (myAttrSynonym == SUMO_ATTR_NOTHING)) {
102 throw FormatException("synonym attribute cannot be nothing");
103 }
104 // check that ranges are valid
105 if (hasAttrRange()) {
106 if ((myMinimumRange == 0) && (myMaximumRange == 0)) {
107 throw FormatException("non-defined range");
108 } else if ((myMaximumRange - myMinimumRange) <= 0) {
109 throw FormatException("invalid range");
110 }
111 }
112 }
113
114
115 void
setDiscreteValues(const std::vector<std::string> & discreteValues)116 GNEAttributeCarrier::AttributeProperties::setDiscreteValues(const std::vector<std::string>& discreteValues) {
117 if (isDiscrete()) {
118 myDiscreteValues = discreteValues;
119 } else {
120 throw FormatException("AttributeProperty doesn't support discrete values values");
121 }
122 }
123
124
125 void
setSynonym(const SumoXMLAttr synonym)126 GNEAttributeCarrier::AttributeProperties::setSynonym(const SumoXMLAttr synonym) {
127 if (hasAttrSynonym()) {
128 myAttrSynonym = synonym;
129 } else {
130 throw FormatException("AttributeProperty doesn't support synonyms");
131 }
132 }
133
134
135 void
setRange(const double minimum,const double maximum)136 GNEAttributeCarrier::AttributeProperties::setRange(const double minimum, const double maximum) {
137 if (hasAttrRange()) {
138 myMinimumRange = minimum;
139 myMaximumRange = maximum;
140 } else {
141 throw FormatException("AttributeProperty doesn't support ranges");
142 }
143 }
144
145
146 void
setPositionListed(const int positionListed)147 GNEAttributeCarrier::AttributeProperties::setPositionListed(const int positionListed) {
148 myPositionListed = positionListed;
149 }
150
151
152 void
setTagPropertyParent(TagProperties * tagPropertyParent)153 GNEAttributeCarrier::AttributeProperties::setTagPropertyParent(TagProperties* tagPropertyParent) {
154 myTagPropertyParent = tagPropertyParent;
155 }
156
157
158 SumoXMLAttr
getAttr() const159 GNEAttributeCarrier::AttributeProperties::getAttr() const {
160 return myAttribute;
161 }
162
163
164 const std::string&
getAttrStr() const165 GNEAttributeCarrier::AttributeProperties::getAttrStr() const {
166 return myAttrStr;
167 }
168
169
170 const GNEAttributeCarrier::TagProperties&
getTagPropertyParent() const171 GNEAttributeCarrier::AttributeProperties::getTagPropertyParent() const {
172 return *myTagPropertyParent;
173 }
174
175
176 int
getPositionListed() const177 GNEAttributeCarrier::AttributeProperties::getPositionListed() const {
178 return myPositionListed;
179 }
180
181
182 const std::string&
getDefinition() const183 GNEAttributeCarrier::AttributeProperties::getDefinition() const {
184 return myDefinition;
185 }
186
187
188 const std::string&
getDefaultValue() const189 GNEAttributeCarrier::AttributeProperties::getDefaultValue() const {
190 return myDefaultValue;
191 }
192
193
194 std::string
getDescription() const195 GNEAttributeCarrier::AttributeProperties::getDescription() const {
196 std::string pre;
197 std::string type;
198 std::string plural;
199 std::string last;
200 // pre type
201 if ((myAttributeProperty & ATTRPROPERTY_LIST) != 0) {
202 pre += "list of ";
203 if ((myAttributeProperty & ATTRPROPERTY_VCLASS) != 0) {
204 plural = "es";
205 } else {
206 plural = "s";
207 }
208 }
209 if ((myAttributeProperty & ATTRPROPERTY_POSITIVE) != 0) {
210 pre += "positive ";
211 }
212 if ((myAttributeProperty & ATTRPROPERTY_NONEDITABLE) != 0) {
213 pre += "non editable ";
214 }
215 if ((myAttributeProperty & ATTRPROPERTY_DISCRETE) != 0) {
216 pre += "discrete ";
217 }
218 if ((myAttributeProperty & ATTRPROPERTY_OPTIONAL) != 0) {
219 pre += "optional ";
220 }
221 if ((myAttributeProperty & ATTRPROPERTY_UNIQUE) != 0) {
222 pre += "unique ";
223 }
224 if ((myAttributeProperty & ATTRPROPERTY_COMBINABLE) != 0) {
225 pre += "combinable ";
226 }
227 // type
228 if ((myAttributeProperty & ATTRPROPERTY_INT) != 0) {
229 type = "integer";
230 }
231 if ((myAttributeProperty & ATTRPROPERTY_FLOAT) != 0) {
232 type = "float";
233 }
234 if ((myAttributeProperty & ATTRPROPERTY_BOOL) != 0) {
235 type = "boolean";
236 }
237 if ((myAttributeProperty & ATTRPROPERTY_STRING) != 0) {
238 type = "string";
239 }
240 if ((myAttributeProperty & ATTRPROPERTY_POSITION) != 0) {
241 type = "position";
242 }
243 if ((myAttributeProperty & ATTRPROPERTY_COLOR) != 0) {
244 type = "color";
245 }
246 if ((myAttributeProperty & ATTRPROPERTY_VCLASS) != 0) {
247 type = "VClass";
248 }
249 if ((myAttributeProperty & ATTRPROPERTY_FILENAME) != 0) {
250 type = "filename";
251 }
252 if ((myAttributeProperty & ATTRPROPERTY_PROBABILITY) != 0) {
253 type = "probability";
254 last = "[0, 1]";
255 }
256 if ((myAttributeProperty & ATTRPROPERTY_TIME) != 0) {
257 type = "time";
258 }
259 if ((myAttributeProperty & ATTRPROPERTY_ANGLE) != 0) {
260 type = "angle";
261 last = "[0, 360]";
262 }
263 return pre + type + plural + last;
264 }
265
266
267 const std::vector<std::string>&
getDiscreteValues() const268 GNEAttributeCarrier::AttributeProperties::getDiscreteValues() const {
269 return myDiscreteValues;
270 }
271
272
273 SumoXMLAttr
getAttrSynonym() const274 GNEAttributeCarrier::AttributeProperties::getAttrSynonym() const {
275 if (hasAttrSynonym()) {
276 return myAttrSynonym;
277 } else {
278 throw ProcessError("Attr doesn't support synonym");
279 }
280 }
281
282
283 double
getMinimumRange() const284 GNEAttributeCarrier::AttributeProperties::getMinimumRange() const {
285 if (hasAttrRange()) {
286 return myMinimumRange;
287 } else {
288 throw ProcessError("Attr doesn't support range");
289 }
290 }
291
292
293 double
getMaximumRange() const294 GNEAttributeCarrier::AttributeProperties::getMaximumRange() const {
295 if (hasAttrRange()) {
296 return myMaximumRange;
297 } else {
298 throw ProcessError("Attr doesn't support range");
299 }
300 }
301
302
303 bool
hasDefaultValue() const304 GNEAttributeCarrier::AttributeProperties::hasDefaultValue() const {
305 return (myAttributeProperty & ATTRPROPERTY_DEFAULTVALUE) != 0;
306 }
307
308
309 bool
hasAttrSynonym() const310 GNEAttributeCarrier::AttributeProperties::hasAttrSynonym() const {
311 return (myAttributeProperty & ATTRPROPERTY_SYNONYM) != 0;
312 }
313
314 bool
hasAttrRange() const315 GNEAttributeCarrier::AttributeProperties::hasAttrRange() const {
316 return (myAttributeProperty & ATTRPROPERTY_RANGE) != 0;
317 }
318
319
320 bool
isInt() const321 GNEAttributeCarrier::AttributeProperties::isInt() const {
322 return (myAttributeProperty & ATTRPROPERTY_INT) != 0;
323 }
324
325
326 bool
isFloat() const327 GNEAttributeCarrier::AttributeProperties::isFloat() const {
328 return (myAttributeProperty & ATTRPROPERTY_FLOAT) != 0;
329 }
330
331
332 bool
isBool() const333 GNEAttributeCarrier::AttributeProperties::isBool() const {
334 return (myAttributeProperty & ATTRPROPERTY_BOOL) != 0;
335 }
336
337
338 bool
isString() const339 GNEAttributeCarrier::AttributeProperties::isString() const {
340 return (myAttributeProperty & ATTRPROPERTY_STRING) != 0;
341 }
342
343
344 bool
isposition() const345 GNEAttributeCarrier::AttributeProperties::isposition() const {
346 return (myAttributeProperty & ATTRPROPERTY_POSITION) != 0;
347 }
348
349
350 bool
isProbability() const351 GNEAttributeCarrier::AttributeProperties::isProbability() const {
352 return (myAttributeProperty & ATTRPROPERTY_PROBABILITY) != 0;
353 }
354
355
356 bool
isNumerical() const357 GNEAttributeCarrier::AttributeProperties::isNumerical() const {
358 return (myAttributeProperty & (ATTRPROPERTY_INT | ATTRPROPERTY_FLOAT)) != 0;
359 }
360
361
362 bool
isTime() const363 GNEAttributeCarrier::AttributeProperties::isTime() const {
364 return (myAttributeProperty & ATTRPROPERTY_TIME) != 0;
365 }
366
367
368 bool
isPositive() const369 GNEAttributeCarrier::AttributeProperties::isPositive() const {
370 return (myAttributeProperty & ATTRPROPERTY_POSITIVE) != 0;
371 }
372
373
374 bool
cannotBeZero() const375 GNEAttributeCarrier::AttributeProperties::cannotBeZero() const {
376 return (myAttributeProperty & ATTRPROPERTY_NOTZERO) != 0;
377 }
378
379
380 bool
isColor() const381 GNEAttributeCarrier::AttributeProperties::isColor() const {
382 return (myAttributeProperty & ATTRPROPERTY_COLOR) != 0;
383 }
384
385
386 bool
isFilename() const387 GNEAttributeCarrier::AttributeProperties::isFilename() const {
388 return (myAttributeProperty & ATTRPROPERTY_FILENAME) != 0;
389 }
390
391
392 bool
isVClass() const393 GNEAttributeCarrier::AttributeProperties::isVClass() const {
394 return (myAttributeProperty & ATTRPROPERTY_VCLASS) != 0;
395 }
396
397
398 bool
isSVCPermission() const399 GNEAttributeCarrier::AttributeProperties::isSVCPermission() const {
400 return ((myAttributeProperty & ATTRPROPERTY_LIST) != 0) && ((myAttributeProperty & ATTRPROPERTY_VCLASS) != 0);
401 }
402
403
404 bool
isList() const405 GNEAttributeCarrier::AttributeProperties::isList() const {
406 return (myAttributeProperty & ATTRPROPERTY_LIST) != 0;
407 }
408
409
410 bool
isSecuential() const411 GNEAttributeCarrier::AttributeProperties::isSecuential() const {
412 return (myAttributeProperty & ATTRPROPERTY_SECUENCIAL) != 0;
413 }
414
415
416 bool
isUnique() const417 GNEAttributeCarrier::AttributeProperties::isUnique() const {
418 return (myAttributeProperty & ATTRPROPERTY_UNIQUE) != 0;
419 }
420
421
422 bool
isOptional() const423 GNEAttributeCarrier::AttributeProperties::isOptional() const {
424 return (myAttributeProperty & ATTRPROPERTY_OPTIONAL) != 0;
425 }
426
427
428 bool
isDiscrete() const429 GNEAttributeCarrier::AttributeProperties::isDiscrete() const {
430 return (myAttributeProperty & ATTRPROPERTY_DISCRETE) != 0;
431 }
432
433
434 bool
isCombinable() const435 GNEAttributeCarrier::AttributeProperties::isCombinable() const {
436 return (myAttributeProperty & ATTRPROPERTY_COMBINABLE) != 0;
437 }
438
439
440 bool
isNonEditable() const441 GNEAttributeCarrier::AttributeProperties::isNonEditable() const {
442 return (myAttributeProperty & ATTRPROPERTY_NONEDITABLE) != 0;
443 }
444
445
446 bool
isExtended() const447 GNEAttributeCarrier::AttributeProperties::isExtended() const {
448 return (myAttributeProperty & ATTRPROPERTY_EXTENDED) != 0;
449 }
450
451
452 bool
requiereUpdateGeometry() const453 GNEAttributeCarrier::AttributeProperties::requiereUpdateGeometry() const {
454 return (myAttributeProperty & ATTRPROPERTY_UPDATEGEOMETRY) != 0;
455 }
456
457 // ---------------------------------------------------------------------------
458 // GNEAttributeCarrier::TagProperties - methods
459 // ---------------------------------------------------------------------------
460
TagProperties()461 GNEAttributeCarrier::TagProperties::TagProperties() :
462 myTag(SUMO_TAG_NOTHING),
463 myTagType(0),
464 myTagProperty(0),
465 myIcon(ICON_EMPTY),
466 myParentTag(SUMO_TAG_NOTHING),
467 myTagSynonym(SUMO_TAG_NOTHING) {
468 }
469
470
TagProperties(SumoXMLTag tag,int tagType,int tagProperty,GUIIcon icon,SumoXMLTag parentTag,SumoXMLTag tagSynonym)471 GNEAttributeCarrier::TagProperties::TagProperties(SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, SumoXMLTag parentTag, SumoXMLTag tagSynonym) :
472 myTag(tag),
473 myTagStr(toString(tag)),
474 myTagType(tagType),
475 myTagProperty(tagProperty),
476 myIcon(icon),
477 myParentTag(parentTag),
478 myTagSynonym(tagSynonym) {
479 }
480
481
~TagProperties()482 GNEAttributeCarrier::TagProperties::~TagProperties() {}
483
484
485 SumoXMLTag
getTag() const486 GNEAttributeCarrier::TagProperties::getTag() const {
487 return myTag;
488 }
489
490
491 const std::string&
getTagStr() const492 GNEAttributeCarrier::TagProperties::getTagStr() const {
493 return myTagStr;
494 }
495
496
497 void
checkTagIntegrity() const498 GNEAttributeCarrier::TagProperties::checkTagIntegrity() const {
499 // check that element must ist at least netElement, Additional, or shape
500 if (!isNetElement() && !isAdditional() && !isShape() && !isTAZ() && !isDemandElement()) {
501 throw ProcessError("element must be at leas netElement, additional, TAZ, shape or demandElement");
502 }
503 // check that element only is netElement, Additional, or shape at the same time
504 if ((isNetElement() + isAdditional() + isShape() + isTAZ() + isDemandElement()) > 1) {
505 throw ProcessError("element can be only a netElement, additional, shape or demandElement at the same time");
506 }
507 // if element can mask the start and end position, check that bot attributes exist
508 if (canMaskStartEndPos() && (!hasAttribute(SUMO_ATTR_STARTPOS) || !hasAttribute(SUMO_ATTR_ENDPOS))) {
509 throw ProcessError("If attribute mask the start and end position, bot attribute has to be defined");
510 }
511 // check that synonym tag isn't nothing
512 if (hasTagSynonym() && (myTagSynonym == SUMO_TAG_NOTHING)) {
513 throw FormatException("synonym tag cannot be nothing");
514 }
515 // check integrity of all attributes
516 for (auto i : myAttributeProperties) {
517 i.second.checkAttributeIntegrity();
518 // check that if attribute is combinable, own a combination of Allow/disallow attibute
519 if (i.second.isCombinable()) {
520 if ((i.first != SUMO_ATTR_ALLOW) && (i.first != SUMO_ATTR_DISALLOW)) {
521 throw ProcessError("Attributes aren't combinables");
522 } else if ((i.first == SUMO_ATTR_ALLOW) && !hasAttribute(SUMO_ATTR_DISALLOW)) {
523 throw ProcessError("allow need a disallow attribute in the same tag");
524 } else if ((i.first == SUMO_ATTR_DISALLOW) && !hasAttribute(SUMO_ATTR_ALLOW)) {
525 throw ProcessError("disallow need an allow attribute in the same tag");
526 }
527 }
528 }
529 // check that all position listed are consecutives
530 for (int i = 0; i < (int)myAttributeProperties.size(); i++) {
531 bool found = false;
532 for (auto j : myAttributeProperties) {
533 if (j.second.getPositionListed() == i) {
534 found = true;
535 }
536 }
537 if (!found) {
538 throw FormatException("There is no position listed consecutive");
539 }
540 }
541 }
542
543
544 const std::string&
getDefaultValue(SumoXMLAttr attr) const545 GNEAttributeCarrier::TagProperties::getDefaultValue(SumoXMLAttr attr) const {
546 if (myAttributeProperties.count(attr) == 0) {
547 throw ProcessError("Attribute '" + toString(attr) + "' not defined");
548 } else if (!myAttributeProperties.at(attr).hasDefaultValue()) {
549 throw ProcessError("attribute '" + toString(attr) + "' doesn't have a default value");
550 } else {
551 return myAttributeProperties.at(attr).getDefaultValue();
552 }
553 }
554
555
556 void
addAttribute(const AttributeProperties & attributeProperty)557 GNEAttributeCarrier::TagProperties::addAttribute(const AttributeProperties& attributeProperty) {
558 if (isAttributeDeprecated(attributeProperty.getAttr())) {
559 throw ProcessError("Attribute '" + attributeProperty.getAttrStr() + "' is deprecated and cannot be inserted");
560 } else if (myAttributeProperties.count(attributeProperty.getAttr()) != 0) {
561 throw ProcessError("Attribute '" + attributeProperty.getAttrStr() + "' already inserted");
562 } else {
563 // insert AttributeProperties in map
564 myAttributeProperties[attributeProperty.getAttr()] = attributeProperty;
565 // update position listed
566 myAttributeProperties[attributeProperty.getAttr()].setPositionListed((int)myAttributeProperties.size() - 1);
567 myAttributeProperties[attributeProperty.getAttr()].setTagPropertyParent(this);
568 }
569 }
570
571
572 void
addDeprecatedAttribute(SumoXMLAttr attr)573 GNEAttributeCarrier::TagProperties::addDeprecatedAttribute(SumoXMLAttr attr) {
574 // Check that attribute wasn't already inserted
575 for (auto i : myAttributeProperties) {
576 if (i.first == attr) {
577 throw ProcessError("Attribute '" + toString(attr) + "' is deprecated but was inserted in list of attributes");
578 }
579 }
580 // add it into myDeprecatedAttributes
581 myDeprecatedAttributes.push_back(attr);
582 }
583
584
585 const GNEAttributeCarrier::AttributeProperties&
getAttributeProperties(SumoXMLAttr attr) const586 GNEAttributeCarrier::TagProperties::getAttributeProperties(SumoXMLAttr attr) const {
587 if (myAttributeProperties.count(attr) != 0) {
588 return myAttributeProperties.at(attr);
589 } else {
590 // check if we're try to loading an synonym
591 for (auto i : myAttributeProperties) {
592 if (i.second.hasAttrSynonym() && i.second.getAttrSynonym() == attr) {
593 return myAttributeProperties.at(i.first);
594 }
595 }
596 // throw error if these attribute doesn't exist
597 throw ProcessError("Attribute '" + toString(attr) + "' doesn't exist");
598 }
599 }
600
601
602 std::map<SumoXMLAttr, GNEAttributeCarrier::AttributeProperties>::const_iterator
begin() const603 GNEAttributeCarrier::TagProperties::begin() const {
604 return myAttributeProperties.begin();
605 }
606
607
608 std::map<SumoXMLAttr, GNEAttributeCarrier::AttributeProperties>::const_iterator
end() const609 GNEAttributeCarrier::TagProperties::end() const {
610 return myAttributeProperties.end();
611 }
612
613
614 int
getNumberOfAttributes() const615 GNEAttributeCarrier::TagProperties::getNumberOfAttributes() const {
616 return (int)myAttributeProperties.size();
617 }
618
619
620 GUIIcon
getGUIIcon() const621 GNEAttributeCarrier::TagProperties::getGUIIcon() const {
622 return myIcon;
623 }
624
625
626 SumoXMLTag
getParentTag() const627 GNEAttributeCarrier::TagProperties::getParentTag() const {
628 if (hasParent()) {
629 return myParentTag;
630 } else {
631 throw ProcessError("Tag doesn't have parent");
632 }
633 }
634
635
636 SumoXMLTag
getTagSynonym() const637 GNEAttributeCarrier::TagProperties::getTagSynonym() const {
638 if (hasTagSynonym()) {
639 return myTagSynonym;
640 } else {
641 throw ProcessError("Tag doesn't have synonym");
642 }
643 }
644
645
646 void
setDisjointAttributes(const std::vector<SumoXMLAttr> & attrs)647 GNEAttributeCarrier::TagProperties::setDisjointAttributes(const std::vector<SumoXMLAttr>& attrs) {
648 if (hasDisjointAttributes()) {
649 myDisjointAttrs = attrs;
650 } else {
651 throw ProcessError("Tag doesn't support disjoint attributes");
652 }
653 }
654
655
656 bool
isDisjointAttributes(SumoXMLAttr attr) const657 GNEAttributeCarrier::TagProperties::isDisjointAttributes(SumoXMLAttr attr) const {
658 if (myDisjointAttrs.empty()) {
659 return false;
660 } else {
661 return (std::find(myDisjointAttrs.begin(), myDisjointAttrs.end(), attr) != myDisjointAttrs.end());
662 }
663 }
664
665
666 bool
hasAttribute(SumoXMLAttr attr) const667 GNEAttributeCarrier::TagProperties::hasAttribute(SumoXMLAttr attr) const {
668 return (myAttributeProperties.count(attr) == 1);
669 }
670
671
672 bool
isNetElement() const673 GNEAttributeCarrier::TagProperties::isNetElement() const {
674 return (myTagType & TAGTYPE_NETELEMENT) != 0;
675 }
676
677
678 bool
isAdditional() const679 GNEAttributeCarrier::TagProperties::isAdditional() const {
680 return (myTagType & TAGTYPE_ADDITIONAL) != 0;
681 }
682
683 bool
isShape() const684 GNEAttributeCarrier::TagProperties::isShape() const {
685 return (myTagType & TAGTYPE_SHAPE) != 0;
686 }
687
688
689 bool
isTAZ() const690 GNEAttributeCarrier::TagProperties::isTAZ() const {
691 return (myTagType & TAGTYPE_TAZ) != 0;
692 }
693
694
695 bool
isDemandElement() const696 GNEAttributeCarrier::TagProperties::isDemandElement() const {
697 return (myTagType & TAGTYPE_DEMANDELEMENT) != 0;
698 }
699
700
701 bool
isStoppingPlace() const702 GNEAttributeCarrier::TagProperties::isStoppingPlace() const {
703 return (myTagType & TAGTYPE_STOPPINGPLACE) != 0;
704 }
705
706
707 bool
isDetector() const708 GNEAttributeCarrier::TagProperties::isDetector() const {
709 return (myTagType & TAGTYPE_DETECTOR) != 0;
710 }
711
712
713 bool
isVehicle() const714 GNEAttributeCarrier::TagProperties::isVehicle() const {
715 return (myTagType & TAGTYPE_VEHICLE) != 0;
716 }
717
718
719 bool
isStop() const720 GNEAttributeCarrier::TagProperties::isStop() const {
721 return (myTagType & TAGTYPE_STOP) != 0;
722 }
723
724
725 bool
isDrawable() const726 GNEAttributeCarrier::TagProperties::isDrawable() const {
727 return (myTagProperty & TAGPROPERTY_DRAWABLE) != 0;
728 }
729
730
731 bool
isSelectable() const732 GNEAttributeCarrier::TagProperties::isSelectable() const {
733 return (myTagProperty & TAGPROPERTY_SELECTABLE) != 0;
734 }
735
736
737 bool
canBlockMovement() const738 GNEAttributeCarrier::TagProperties::canBlockMovement() const {
739 return (myTagProperty & TAGPROPERTY_BLOCKMOVEMENT) != 0;
740 }
741
742
743 bool
canBlockShape() const744 GNEAttributeCarrier::TagProperties::canBlockShape() const {
745 return (myTagProperty & TAGPROPERTY_BLOCKSHAPE) != 0;
746 }
747
748
749 bool
canCloseShape() const750 GNEAttributeCarrier::TagProperties::canCloseShape() const {
751 return (myTagProperty & TAGPROPERTY_CLOSESHAPE) != 0;
752 }
753
754
755 bool
hasGEOPosition() const756 GNEAttributeCarrier::TagProperties::hasGEOPosition() const {
757 return (myTagProperty & TAGPROPERTY_GEOPOSITION) != 0;
758 }
759
760
761 bool
hasGEOShape() const762 GNEAttributeCarrier::TagProperties::hasGEOShape() const {
763 return (myTagProperty & TAGPROPERTY_GEOSHAPE) != 0;
764 }
765
766
767 bool
hasParent() const768 GNEAttributeCarrier::TagProperties::hasParent() const {
769 return (myTagProperty & TAGPROPERTY_PARENT) != 0;
770 }
771
772
773 bool
hasTagSynonym() const774 GNEAttributeCarrier::TagProperties::hasTagSynonym() const {
775 return (myTagProperty & TAGPROPERTY_SYNONYM) != 0;
776 }
777
778
779 bool
hasDialog() const780 GNEAttributeCarrier::TagProperties::hasDialog() const {
781 return (myTagProperty & TAGPROPERTY_DIALOG) != 0;
782 }
783
784
785 bool
hasMinimumNumberOfChilds() const786 GNEAttributeCarrier::TagProperties::hasMinimumNumberOfChilds() const {
787 return (myTagProperty & TAGPROPERTY_MINIMUMCHILDS) != 0;
788 }
789
790
791 bool
hasGenericParameters() const792 GNEAttributeCarrier::TagProperties::hasGenericParameters() const {
793 // note: By default all Tags supports generic parameters, except Tags with "TAGPROPERTY_NOGENERICPARAMETERS"
794 return (myTagProperty & TAGPROPERTY_NOGENERICPARAMETERS) == 0;
795 }
796
797
798 bool
hasDisjointAttributes() const799 GNEAttributeCarrier::TagProperties::hasDisjointAttributes() const {
800 // note: By default all Tags supports generic parameters, except Tags with "TAGPROPERTY_NOGENERICPARAMETERS"
801 return (myTagProperty & TAGPROPERTY_DISJOINTATTRIBUTES) != 0;
802 }
803
804
805 bool
canBeReparent() const806 GNEAttributeCarrier::TagProperties::canBeReparent() const {
807 return (myTagProperty & TAGPROPERTY_REPARENT) != 0;
808 }
809
810
811 bool
canAutomaticSortChilds() const812 GNEAttributeCarrier::TagProperties::canAutomaticSortChilds() const {
813 return (myTagProperty & TAGPROPERTY_AUTOMATICSORTING) != 0;
814 }
815
816
817 bool
canWriteChildsSeparate() const818 GNEAttributeCarrier::TagProperties::canWriteChildsSeparate() const {
819 return (myTagProperty & TAGPROPERTY_WRITECHILDSSEPARATE) != 0;
820 }
821
822
823 bool
canMaskStartEndPos() const824 GNEAttributeCarrier::TagProperties::canMaskStartEndPos() const {
825 return (myTagProperty & TAGPROPERTY_MASKSTARTENDPOS) != 0;
826 }
827
828
829 bool
canMaskXYZPositions() const830 GNEAttributeCarrier::TagProperties::canMaskXYZPositions() const {
831 return (myTagProperty & TAGPROPERTY_MASKXYZPOSITION) != 0;
832 }
833
834
835 bool
isAttributeDeprecated(SumoXMLAttr attr) const836 GNEAttributeCarrier::TagProperties::isAttributeDeprecated(SumoXMLAttr attr) const {
837 return (std::find(myDeprecatedAttributes.begin(), myDeprecatedAttributes.end(), attr) != myDeprecatedAttributes.end());
838 }
839
840 // ---------------------------------------------------------------------------
841 // GNEAttributeCarrier - methods
842 // ---------------------------------------------------------------------------
843
GNEAttributeCarrier(const SumoXMLTag tag)844 GNEAttributeCarrier::GNEAttributeCarrier(const SumoXMLTag tag) :
845 myTagProperty(getTagProperties(tag)),
846 mySelected(false) {
847 }
848
849
~GNEAttributeCarrier()850 GNEAttributeCarrier::~GNEAttributeCarrier() {}
851
852
853 bool
isDisjointAttributeSet(const SumoXMLAttr) const854 GNEAttributeCarrier::isDisjointAttributeSet(const SumoXMLAttr /*attr*/) const {
855 // by default all attributes are set
856 return true;
857 }
858
859
860 void
setDisjointAttribute(const SumoXMLAttr,GNEUndoList *)861 GNEAttributeCarrier::setDisjointAttribute(const SumoXMLAttr /*attr*/, GNEUndoList* /*undoList*/) {
862 // by default empty
863 }
864
865
866 template<> int
parse(const std::string & string)867 GNEAttributeCarrier::parse(const std::string& string) {
868 return StringUtils::toInt(string);
869 }
870
871 template<> long long
parse(const std::string & string)872 GNEAttributeCarrier::parse(const std::string& string) {
873 return StringUtils::toLong(string);
874 }
875
876
877 template<> double
parse(const std::string & string)878 GNEAttributeCarrier::parse(const std::string& string) {
879 return StringUtils::toDouble(string);
880 }
881
882
883 template<> bool
parse(const std::string & string)884 GNEAttributeCarrier::parse(const std::string& string) {
885 return StringUtils::toBool(string);
886 }
887
888
889 template<> std::string
parse(const std::string & string)890 GNEAttributeCarrier::parse(const std::string& string) {
891 return string;
892 }
893
894
895 template<> SUMOVehicleClass
parse(const std::string & string)896 GNEAttributeCarrier::parse(const std::string& string) {
897 if (string.size() == 0) {
898 throw EmptyData();
899 } else if (!SumoVehicleClassStrings.hasString(string)) {
900 return SVC_IGNORING;
901 } else {
902 return SumoVehicleClassStrings.get(string);
903 }
904 }
905
906
907 template<> RGBColor
parse(const std::string & string)908 GNEAttributeCarrier::parse(const std::string& string) {
909 return RGBColor::parseColor(string);
910 }
911
912
913 template<> Position
parse(const std::string & string)914 GNEAttributeCarrier::parse(const std::string& string) {
915 if (string.size() == 0) {
916 throw EmptyData();
917 } else {
918 bool ok = true;
919 PositionVector pos = GeomConvHelper::parseShapeReporting(string, "user-supplied position", 0, ok, false, false);
920 if (!ok || (pos.size() != 1)) {
921 throw NumberFormatException("(Position) " + string);
922 } else {
923 return pos[0];
924 }
925 }
926 }
927
928
929 template<> PositionVector
parse(const std::string & string)930 GNEAttributeCarrier::parse(const std::string& string) {
931 PositionVector posVector;
932 // empty string are allowed (It means empty position vector)
933 if (string.empty()) {
934 return posVector;
935 } else {
936 bool ok = true;
937 posVector = GeomConvHelper::parseShapeReporting(string, "user-supplied shape", 0, ok, false, true);
938 if (!ok) {
939 throw NumberFormatException("(Position List) " + string);
940 } else {
941 return posVector;
942 }
943 }
944 }
945
946
947 template<> SUMOVehicleShape
parse(const std::string & string)948 GNEAttributeCarrier::parse(const std::string& string) {
949 if ((string == "unknown") || (!SumoVehicleShapeStrings.hasString(string))) {
950 return SVS_UNKNOWN;
951 } else {
952 return SumoVehicleShapeStrings.get(string);
953 }
954 }
955
956
957 template<> std::vector<std::string>
parse(const std::string & string)958 GNEAttributeCarrier::parse(const std::string& string) {
959 return StringTokenizer(string).getVector();
960 }
961
962
963 template<> std::set<std::string>
parse(const std::string & string)964 GNEAttributeCarrier::parse(const std::string& string) {
965 std::vector<std::string> vectorString = StringTokenizer(string).getVector();
966 std::set<std::string> solution;
967 for (const auto& i : vectorString) {
968 solution.insert(i);
969 }
970 return solution;
971 }
972
973
974 template<> std::vector<int>
parse(const std::string & string)975 GNEAttributeCarrier::parse(const std::string& string) {
976 std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
977 std::vector<int> parsedIntValues;
978 for (const auto& i : parsedValues) {
979 parsedIntValues.push_back(parse<int>(i));
980 }
981 return parsedIntValues;
982 }
983
984
985 template<> std::vector<double>
parse(const std::string & string)986 GNEAttributeCarrier::parse(const std::string& string) {
987 std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
988 std::vector<double> parsedDoubleValues;
989 for (const auto& i : parsedValues) {
990 parsedDoubleValues.push_back(parse<double>(i));
991 }
992 return parsedDoubleValues;
993 }
994
995
996 template<> std::vector<bool>
parse(const std::string & string)997 GNEAttributeCarrier::parse(const std::string& string) {
998 std::vector<std::string> parsedValues = parse<std::vector<std::string> >(string);
999 std::vector<bool> parsedBoolValues;
1000 for (const auto& i : parsedValues) {
1001 parsedBoolValues.push_back(parse<bool>(i));
1002 }
1003 return parsedBoolValues;
1004 }
1005
1006
1007 template<> std::vector<GNEEdge*>
parse(GNENet * net,const std::string & value)1008 GNEAttributeCarrier::parse(GNENet* net, const std::string& value) {
1009 // Declare string vector
1010 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
1011 std::vector<GNEEdge*> parsedEdges;
1012 // Iterate over edges IDs, retrieve Edges and add it into parsedEdges
1013 for (const auto& i : edgeIds) {
1014 GNEEdge* retrievedEdge = net->retrieveEdge(i, false);
1015 if (retrievedEdge) {
1016 parsedEdges.push_back(net->retrieveEdge(i));
1017 } else {
1018 throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_EDGES) + ". " + toString(SUMO_TAG_EDGE) + " '" + i + "' doesn't exist");
1019 }
1020 }
1021 return parsedEdges;
1022 }
1023
1024
1025 template<> std::vector<GNELane*>
parse(GNENet * net,const std::string & value)1026 GNEAttributeCarrier::parse(GNENet* net, const std::string& value) {
1027 // Declare string vector
1028 std::vector<std::string> laneIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
1029 std::vector<GNELane*> parsedLanes;
1030 // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes
1031 for (const auto& i : laneIds) {
1032 GNELane* retrievedLane = net->retrieveLane(i, false);
1033 if (retrievedLane) {
1034 parsedLanes.push_back(net->retrieveLane(i));
1035 } else {
1036 throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_LANES) + ". " + toString(SUMO_TAG_LANE) + " '" + i + "' doesn't exist");
1037 }
1038 }
1039 return parsedLanes;
1040 }
1041
1042
1043 template<> std::string
parseIDs(const std::vector<GNEEdge * > & ACs)1044 GNEAttributeCarrier::parseIDs(const std::vector<GNEEdge*>& ACs) {
1045 // obtain ID's of edges and return their join
1046 std::vector<std::string> edgeIDs;
1047 for (const auto& i : ACs) {
1048 edgeIDs.push_back(i->getID());
1049 }
1050 return joinToString(edgeIDs, " ");
1051 }
1052
1053
1054 template<> std::string
parseIDs(const std::vector<GNELane * > & ACs)1055 GNEAttributeCarrier::parseIDs(const std::vector<GNELane*>& ACs) {
1056 // obtain ID's of lanes and return their join
1057 std::vector<std::string> laneIDs;
1058 for (const auto& i : ACs) {
1059 laneIDs.push_back(i->getID());
1060 }
1061 return joinToString(laneIDs, " ");
1062 }
1063
1064
1065 bool
lanesConsecutives(const std::vector<GNELane * > & lanes)1066 GNEAttributeCarrier::lanesConsecutives(const std::vector<GNELane*>& lanes) {
1067 // we need at least two lanes
1068 if (lanes.size() > 1) {
1069 // now check that lanes are consecutives (not neccesary connected)
1070 int currentLane = 0;
1071 while (currentLane < ((int)lanes.size() - 1)) {
1072 int nextLane = -1;
1073 // iterate over outgoing edges of destiny juntion of edge's lane
1074 for (int i = 0; (i < (int)lanes.at(currentLane)->getParentEdge().getGNEJunctionDestiny()->getGNEOutgoingEdges().size()) && (nextLane == -1); i++) {
1075 // iterate over lanes of outgoing edges of destiny juntion of edge's lane
1076 for (int j = 0; (j < (int)lanes.at(currentLane)->getParentEdge().getGNEJunctionDestiny()->getGNEOutgoingEdges().at(i)->getLanes().size()) && (nextLane == -1); j++) {
1077 // check if lane correspond to the next lane of "lanes"
1078 if (lanes.at(currentLane)->getParentEdge().getGNEJunctionDestiny()->getGNEOutgoingEdges().at(i)->getLanes().at(j) == lanes.at(currentLane + 1)) {
1079 nextLane = currentLane;
1080 }
1081 }
1082 }
1083 if (nextLane == -1) {
1084 return false;
1085 } else {
1086 currentLane++;
1087 }
1088 }
1089 return true;
1090 } else {
1091 return false;
1092 }
1093 }
1094
1095
1096 std::string
getAttributeForSelection(SumoXMLAttr key) const1097 GNEAttributeCarrier::getAttributeForSelection(SumoXMLAttr key) const {
1098 return getAttribute(key);
1099 }
1100
1101
1102 const std::string&
getTagStr() const1103 GNEAttributeCarrier::getTagStr() const {
1104 return myTagProperty.getTagStr();
1105 }
1106
1107
1108 const GNEAttributeCarrier::TagProperties&
getTagProperty() const1109 GNEAttributeCarrier::getTagProperty() const {
1110 return myTagProperty;
1111 }
1112
1113
1114 FXIcon*
getIcon() const1115 GNEAttributeCarrier::getIcon() const {
1116 // define on first access
1117 if (myTagProperties.size() == 0) {
1118 fillAttributeCarriers();
1119 }
1120 return GUIIconSubSys::getIcon(myTagProperty.getGUIIcon());
1121 }
1122
1123
1124 const std::string
getID() const1125 GNEAttributeCarrier::getID() const {
1126 return getAttribute(SUMO_ATTR_ID);
1127 }
1128
1129 // ===========================================================================
1130 // static methods
1131 // ===========================================================================
1132
1133 const GNEAttributeCarrier::TagProperties&
getTagProperties(SumoXMLTag tag)1134 GNEAttributeCarrier::getTagProperties(SumoXMLTag tag) {
1135 if (tag == SUMO_TAG_NOTHING) {
1136 return dummyTagProperty;
1137 }
1138 // define on first access
1139 if (myTagProperties.size() == 0) {
1140 fillAttributeCarriers();
1141 }
1142 // check that tag is defined
1143 if (myTagProperties.count(tag) == 0) {
1144 throw ProcessError("Attributes for tag '" + toString(tag) + "' not defined");
1145 } else {
1146 return myTagProperties.at(tag);
1147 }
1148 }
1149
1150
1151 std::vector<SumoXMLTag>
allowedTags(bool onlyDrawables)1152 GNEAttributeCarrier::allowedTags(bool onlyDrawables) {
1153 std::vector<SumoXMLTag> allTags;
1154 // define on first access
1155 if (myTagProperties.size() == 0) {
1156 fillAttributeCarriers();
1157 }
1158 // fill all tags
1159 for (const auto& i : myTagProperties) {
1160 if (!onlyDrawables || i.second.isDrawable()) {
1161 allTags.push_back(i.first);
1162 }
1163 }
1164 return allTags;
1165 }
1166
1167
1168 std::vector<SumoXMLTag>
allowedTagsByCategory(int tagPropertyCategory,bool onlyDrawables)1169 GNEAttributeCarrier::allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables) {
1170 std::vector<SumoXMLTag> allowedTags;
1171 // define on first access
1172 if (myTagProperties.size() == 0) {
1173 fillAttributeCarriers();
1174 }
1175 if (tagPropertyCategory & TAGTYPE_NETELEMENT) {
1176 // fill netElements tags
1177 for (const auto& i : myTagProperties) {
1178 if (i.second.isNetElement() && (!onlyDrawables || i.second.isDrawable())) {
1179 allowedTags.push_back(i.first);
1180 }
1181 }
1182 }
1183 if (tagPropertyCategory & TAGTYPE_ADDITIONAL) {
1184 // fill additional tags
1185 for (const auto& i : myTagProperties) {
1186 if (i.second.isAdditional() && (!onlyDrawables || i.second.isDrawable())) {
1187 allowedTags.push_back(i.first);
1188 }
1189 }
1190 }
1191 if (tagPropertyCategory & TAGTYPE_SHAPE) {
1192 // fill shape tags
1193 for (const auto& i : myTagProperties) {
1194 if (i.second.isShape() && (!onlyDrawables || i.second.isDrawable())) {
1195 allowedTags.push_back(i.first);
1196 }
1197 }
1198 }
1199 if (tagPropertyCategory & TAGTYPE_TAZ) {
1200 // fill taz tags
1201 for (const auto& i : myTagProperties) {
1202 if (i.second.isTAZ() && (!onlyDrawables || i.second.isDrawable())) {
1203 allowedTags.push_back(i.first);
1204 }
1205 }
1206 }
1207 if (tagPropertyCategory & TAGTYPE_DEMANDELEMENT) {
1208 // fill demand tags
1209 for (const auto& i : myTagProperties) {
1210 if (i.second.isDemandElement() && (!onlyDrawables || i.second.isDrawable())) {
1211 allowedTags.push_back(i.first);
1212 }
1213 }
1214 }
1215 if (tagPropertyCategory & TAGTYPE_VEHICLE) {
1216 // fill demand tags
1217 for (const auto& i : myTagProperties) {
1218 if (i.second.isVehicle() && (!onlyDrawables || i.second.isDrawable())) {
1219 allowedTags.push_back(i.first);
1220 }
1221 }
1222 }
1223 if (tagPropertyCategory & TAGTYPE_STOP) {
1224 // fill demand tags
1225 for (const auto& i : myTagProperties) {
1226 if (i.second.isStop() && (!onlyDrawables || i.second.isDrawable())) {
1227 allowedTags.push_back(i.first);
1228 }
1229 }
1230 }
1231 return allowedTags;
1232 }
1233
1234
1235 int
getHigherNumberOfAttributes()1236 GNEAttributeCarrier::getHigherNumberOfAttributes() {
1237 int maxNumAttribute = 0;
1238 // define on first access
1239 if (myTagProperties.size() == 0) {
1240 fillAttributeCarriers();
1241 }
1242 // get max num attributes
1243 for (const auto& i : myTagProperties) {
1244 maxNumAttribute = MAX2(maxNumAttribute, i.second.getNumberOfAttributes());
1245 }
1246 return maxNumAttribute;
1247 }
1248
1249
1250 bool
isGenericParametersValid(const std::string & value)1251 GNEAttributeCarrier::isGenericParametersValid(const std::string& value) {
1252 // separate value in a vector of string using | as separator
1253 std::vector<std::string> parsedValues;
1254 StringTokenizer stValues(value, "|", true);
1255 while (stValues.hasNext()) {
1256 parsedValues.push_back(stValues.next());
1257 }
1258 // check that parsed values (A=B)can be parsed in generic parameters
1259 for (auto i : parsedValues) {
1260 std::vector<std::string> parsedParameters;
1261 StringTokenizer stParam(i, "=", true);
1262 while (stParam.hasNext()) {
1263 parsedParameters.push_back(stParam.next());
1264 }
1265 // Check that parsed parameters are exactly two
1266 if (parsedParameters.size() == 2) {
1267 // check that key and value contains valid characters
1268 if (!SUMOXMLDefinitions::isValidGenericParameterKey(parsedParameters.front()) || !SUMOXMLDefinitions::isValidGenericParameterValue(parsedParameters.back())) {
1269 return false;
1270 }
1271 } else {
1272 return false;
1273 }
1274 }
1275 // all ok, then return true
1276 return true;
1277 }
1278
1279
1280 int
getCircleResolution(const GUIVisualizationSettings & settings)1281 GNEAttributeCarrier::getCircleResolution(const GUIVisualizationSettings& settings) {
1282 if (settings.drawForSelecting) {
1283 return 8;
1284 } else if (settings.scale >= 10) {
1285 return 32;
1286 } else if (settings.scale >= 2) {
1287 return 16;
1288 } else {
1289 return 8;
1290 }
1291 }
1292
1293 // ===========================================================================
1294 // private
1295 // ===========================================================================
1296
1297 void
setDisjointAttribute(const int)1298 GNEAttributeCarrier::setDisjointAttribute(const int /*newParameterSet*/) {
1299 // by default empty
1300 }
1301
1302 void
fillAttributeCarriers()1303 GNEAttributeCarrier::fillAttributeCarriers() {
1304 // fill all groups of ACs
1305 fillNetElements();
1306 fillAdditionals();
1307 fillShapes();
1308 fillDemandElements();
1309 // check integrity of all Tags (function checkTagIntegrity() throw an exception if there is an inconsistency)
1310 for (const auto& i : myTagProperties) {
1311 i.second.checkTagIntegrity();
1312 }
1313 }
1314
1315
1316 void
fillNetElements()1317 GNEAttributeCarrier::fillNetElements() {
1318 // declare empty AttributeProperties
1319 AttributeProperties attrProperty;
1320 // obtain Node Types except NODETYPE_DEAD_END_DEPRECATED
1321 const OptionsCont& oc = OptionsCont::getOptions();
1322 std::vector<std::string> nodeTypes = SUMOXMLDefinitions::NodeTypes.getStrings();
1323 nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_DEAD_END_DEPRECATED)));
1324 nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_DEAD_END)));
1325 nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_NOJUNCTION)));
1326 nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_INTERNAL)));
1327 // fill netElement ACs
1328 SumoXMLTag currentTag = SUMO_TAG_EDGE;
1329 {
1330 // set values of tag
1331 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_EDGE);
1332 // set values of attributes
1333 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1334 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1335 "The id of the edge");
1336 myTagProperties[currentTag].addAttribute(attrProperty);
1337
1338 attrProperty = AttributeProperties(SUMO_ATTR_FROM,
1339 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1340 "The name of a node within the nodes-file the edge shall start at");
1341 myTagProperties[currentTag].addAttribute(attrProperty);
1342
1343 attrProperty = AttributeProperties(SUMO_ATTR_TO,
1344 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1345 "The name of a node within the nodes-file the edge shall end at");
1346 myTagProperties[currentTag].addAttribute(attrProperty);
1347
1348 attrProperty = AttributeProperties(SUMO_ATTR_SPEED,
1349 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
1350 "The maximum speed allowed on the edge in m/s");
1351 toString(oc.getFloat("default.speed"));
1352 myTagProperties[currentTag].addAttribute(attrProperty);
1353
1354 attrProperty = AttributeProperties(SUMO_ATTR_PRIORITY,
1355 ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUE,
1356 "The priority of the edge");
1357 toString(oc.getInt("default.priority"));
1358 myTagProperties[currentTag].addAttribute(attrProperty);
1359
1360 attrProperty = AttributeProperties(SUMO_ATTR_NUMLANES,
1361 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
1362 "The number of lanes of the edge");
1363 toString(oc.getInt("default.lanenumber"));
1364 myTagProperties[currentTag].addAttribute(attrProperty);
1365
1366 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
1367 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE,
1368 "The name of a type within the SUMO edge type file");
1369 myTagProperties[currentTag].addAttribute(attrProperty);
1370
1371 attrProperty = AttributeProperties(SUMO_ATTR_ALLOW,
1372 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE,
1373 "Explicitly allows the given vehicle classes (not given will be not allowed)",
1374 "all");
1375 attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1376 myTagProperties[currentTag].addAttribute(attrProperty);
1377
1378 attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW,
1379 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE,
1380 "Explicitly disallows the given vehicle classes (not given will be allowed)");
1381 attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1382 myTagProperties[currentTag].addAttribute(attrProperty);
1383
1384 attrProperty = AttributeProperties(SUMO_ATTR_SHAPE,
1385 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1386 "If the shape is given it should start and end with the positions of the from-node and to-node");
1387 myTagProperties[currentTag].addAttribute(attrProperty);
1388
1389 attrProperty = AttributeProperties(SUMO_ATTR_LENGTH,
1390 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_UPDATEGEOMETRY,
1391 "The length of the edge in meter");
1392 myTagProperties[currentTag].addAttribute(attrProperty);
1393
1394 attrProperty = AttributeProperties(SUMO_ATTR_SPREADTYPE,
1395 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE,
1396 "Lane width for all lanes of this edge in meters (used for visualization)",
1397 "right");
1398 attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneSpreadFunctions.getStrings());
1399 myTagProperties[currentTag].addAttribute(attrProperty);
1400
1401 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
1402 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE,
1403 "street name (need not be unique, used for visualization)");
1404 myTagProperties[currentTag].addAttribute(attrProperty);
1405
1406 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
1407 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1408 "Lane width for all lanes of this edge in meters (used for visualization)",
1409 "-1");
1410 myTagProperties[currentTag].addAttribute(attrProperty);
1411
1412 attrProperty = AttributeProperties(SUMO_ATTR_ENDOFFSET,
1413 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1414 "Move the stop line back from the intersection by the given amount",
1415 "0");
1416 myTagProperties[currentTag].addAttribute(attrProperty);
1417
1418 attrProperty = AttributeProperties(GNE_ATTR_SHAPE_START,
1419 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute used to define an endPoint
1420 "Custom position in which shape start (by default position of junction from)");
1421 myTagProperties[currentTag].addAttribute(attrProperty);
1422
1423 attrProperty = AttributeProperties(GNE_ATTR_SHAPE_END,
1424 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from to define an endPoint
1425 "Custom position in which shape end (by default position of junction from)");
1426 myTagProperties[currentTag].addAttribute(attrProperty);
1427
1428 attrProperty = AttributeProperties(GNE_ATTR_BIDIR,
1429 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_NONEDITABLE, // virtual attribute to check of this edge is part of a bidirectional railway (cannot be edited)
1430 "Show if edge is bidireccional",
1431 "0");
1432 myTagProperties[currentTag].addAttribute(attrProperty);
1433
1434 }
1435 currentTag = SUMO_TAG_JUNCTION;
1436 {
1437 // set values of tag
1438 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_JUNCTION);
1439 // set values of attributes
1440 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1441 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1442 "The id of the node");
1443 myTagProperties[currentTag].addAttribute(attrProperty);
1444
1445 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
1446 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_POSITION | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1447 "The x-y-z position of the node on the plane in meters");
1448 myTagProperties[currentTag].addAttribute(attrProperty);
1449
1450 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
1451 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE,
1452 "An optional type for the node");
1453 attrProperty.setDiscreteValues(nodeTypes);
1454 myTagProperties[currentTag].addAttribute(attrProperty);
1455
1456 attrProperty = AttributeProperties(SUMO_ATTR_SHAPE,
1457 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1458 "A custom shape for that node");
1459 myTagProperties[currentTag].addAttribute(attrProperty);
1460
1461 attrProperty = AttributeProperties(SUMO_ATTR_RADIUS,
1462 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1463 "Optional turning radius (for all corners) for that node in meters",
1464 "1.5");
1465 myTagProperties[currentTag].addAttribute(attrProperty);
1466
1467 attrProperty = AttributeProperties(SUMO_ATTR_KEEP_CLEAR,
1468 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE,
1469 "Whether the junction-blocking-heuristic should be activated at this node",
1470 "1");
1471 myTagProperties[currentTag].addAttribute(attrProperty);
1472
1473 attrProperty = AttributeProperties(SUMO_ATTR_RIGHT_OF_WAY,
1474 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE,
1475 "How to compute right of way rules at this node",
1476 SUMOXMLDefinitions::RightOfWayValues.getString(RIGHT_OF_WAY_DEFAULT));
1477 attrProperty.setDiscreteValues(SUMOXMLDefinitions::RightOfWayValues.getStrings());
1478 myTagProperties[currentTag].addAttribute(attrProperty);
1479
1480 attrProperty = AttributeProperties(SUMO_ATTR_FRINGE,
1481 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE,
1482 "Whether this junction is at the fringe of the network",
1483 SUMOXMLDefinitions::FringeTypeValues.getString(FRINGE_TYPE_DEFAULT));
1484 attrProperty.setDiscreteValues(SUMOXMLDefinitions::FringeTypeValues.getStrings());
1485 myTagProperties[currentTag].addAttribute(attrProperty);
1486
1487 attrProperty = AttributeProperties(SUMO_ATTR_TLTYPE,
1488 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE,
1489 "An optional type for the traffic light algorithm");
1490 attrProperty.setDiscreteValues(SUMOXMLDefinitions::TrafficLightTypes.getStrings());
1491 myTagProperties[currentTag].addAttribute(attrProperty);
1492
1493 attrProperty = AttributeProperties(SUMO_ATTR_TLID,
1494 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE,
1495 "An optional id for the traffic light program");
1496 myTagProperties[currentTag].addAttribute(attrProperty);
1497 }
1498 currentTag = SUMO_TAG_LANE;
1499 {
1500 // set values of tag
1501 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_LANE);
1502 // set values of attributes
1503 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1504 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE,
1505 "ID of lane (Automatic, non editable)");
1506 myTagProperties[currentTag].addAttribute(attrProperty);
1507
1508 attrProperty = AttributeProperties(SUMO_ATTR_INDEX,
1509 ATTRPROPERTY_INT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_UPDATEGEOMETRY,
1510 "The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one)");
1511 myTagProperties[currentTag].addAttribute(attrProperty);
1512
1513 attrProperty = AttributeProperties(SUMO_ATTR_SPEED,
1514 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
1515 "Speed in meters per second",
1516 "13.89");
1517 myTagProperties[currentTag].addAttribute(attrProperty);
1518
1519 attrProperty = AttributeProperties(SUMO_ATTR_ALLOW,
1520 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE,
1521 "Explicitly allows the given vehicle classes (not given will be not allowed)",
1522 "all");
1523 attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1524 myTagProperties[currentTag].addAttribute(attrProperty);
1525
1526 attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW,
1527 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE,
1528 "Explicitly disallows the given vehicle classes (not given will be allowed)");
1529 attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
1530 myTagProperties[currentTag].addAttribute(attrProperty);
1531
1532 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
1533 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1534 "Width in meters (used for visualization)",
1535 "-1");
1536 myTagProperties[currentTag].addAttribute(attrProperty);
1537
1538 attrProperty = AttributeProperties(SUMO_ATTR_ENDOFFSET,
1539 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1540 "Move the stop line back from the intersection by the given amount",
1541 "0");
1542 myTagProperties[currentTag].addAttribute(attrProperty);
1543
1544 attrProperty = AttributeProperties(SUMO_ATTR_ACCELERATION,
1545 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE,
1546 "Enable or disable lane as acceleration lane",
1547 "0");
1548 myTagProperties[currentTag].addAttribute(attrProperty);
1549
1550 attrProperty = AttributeProperties(SUMO_ATTR_CUSTOMSHAPE,
1551 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1552 "If the shape is given it overrides the computation based on edge shape");
1553 myTagProperties[currentTag].addAttribute(attrProperty);
1554 }
1555 currentTag = SUMO_TAG_CROSSING;
1556 {
1557 // set values of tag
1558 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_CROSSING, SUMO_TAG_JUNCTION);
1559 // set values of attributes
1560 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1561 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE,
1562 "The ID of Crossing");
1563 myTagProperties[currentTag].addAttribute(attrProperty);
1564
1565 attrProperty = AttributeProperties(SUMO_ATTR_EDGES,
1566 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1567 "The (road) edges which are crossed");
1568 myTagProperties[currentTag].addAttribute(attrProperty);
1569
1570 attrProperty = AttributeProperties(SUMO_ATTR_PRIORITY,
1571 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE,
1572 "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections)",
1573 "0");
1574 myTagProperties[currentTag].addAttribute(attrProperty);
1575
1576 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
1577 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1578 "The width of the crossings",
1579 toString(OptionsCont::getOptions().getFloat("default.crossing-width")));
1580 myTagProperties[currentTag].addAttribute(attrProperty);
1581
1582 attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX,
1583 ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUE,
1584 "sets the tls-index for this crossing",
1585 "-1");
1586 myTagProperties[currentTag].addAttribute(attrProperty);
1587
1588 attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX2,
1589 ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUE,
1590 "sets the opposite-direction tls-index for this crossing",
1591 "-1");
1592 myTagProperties[currentTag].addAttribute(attrProperty);
1593
1594 attrProperty = AttributeProperties(SUMO_ATTR_CUSTOMSHAPE,
1595 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1596 "Overrids default shape of pedestrian crossing");
1597 myTagProperties[currentTag].addAttribute(attrProperty);
1598 }
1599 currentTag = SUMO_TAG_CONNECTION;
1600 {
1601 // set values of tag
1602 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_CONNECTION, SUMO_TAG_EDGE);
1603 // set values of attributes
1604 attrProperty = AttributeProperties(SUMO_ATTR_FROM,
1605 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_UPDATEGEOMETRY,
1606 "The name of the edge the vehicles leave");
1607 myTagProperties[currentTag].addAttribute(attrProperty);
1608
1609 attrProperty = AttributeProperties(SUMO_ATTR_TO,
1610 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_UPDATEGEOMETRY,
1611 "The name of the edge the vehicles may reach when leaving 'from'");
1612 myTagProperties[currentTag].addAttribute(attrProperty);
1613
1614 attrProperty = AttributeProperties(SUMO_ATTR_FROM_LANE,
1615 ATTRPROPERTY_INT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_UPDATEGEOMETRY,
1616 "the lane index of the incoming lane (numbers starting with 0)");
1617 myTagProperties[currentTag].addAttribute(attrProperty);
1618
1619 attrProperty = AttributeProperties(SUMO_ATTR_TO_LANE,
1620 ATTRPROPERTY_INT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_UPDATEGEOMETRY,
1621 "the lane index of the outgoing lane (numbers starting with 0)");
1622 myTagProperties[currentTag].addAttribute(attrProperty);
1623
1624 attrProperty = AttributeProperties(SUMO_ATTR_PASS,
1625 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE,
1626 "if set, vehicles which pass this (lane-2-lane) connection) will not wait",
1627 "0");
1628 myTagProperties[currentTag].addAttribute(attrProperty);
1629
1630 attrProperty = AttributeProperties(SUMO_ATTR_KEEP_CLEAR,
1631 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE,
1632 "if set to false, vehicles which pass this (lane-2-lane) connection) will not worry about blocking the intersection",
1633 "0");
1634 myTagProperties[currentTag].addAttribute(attrProperty);
1635
1636 attrProperty = AttributeProperties(SUMO_ATTR_CONTPOS,
1637 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
1638 "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",
1639 toString(NBEdge::UNSPECIFIED_CONTPOS));
1640 myTagProperties[currentTag].addAttribute(attrProperty);
1641
1642 attrProperty = AttributeProperties(SUMO_ATTR_UNCONTROLLED,
1643 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE,
1644 "If set to true, This connection will not be TLS-controlled despite its node being controlled",
1645 "0");
1646 myTagProperties[currentTag].addAttribute(attrProperty);
1647
1648 attrProperty = AttributeProperties(SUMO_ATTR_VISIBILITY_DISTANCE,
1649 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
1650 "Vision distance between vehicles",
1651 toString(NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE));
1652 myTagProperties[currentTag].addAttribute(attrProperty);
1653
1654 attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX,
1655 ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUE,
1656 "sets the distance to the connection at which all relevant foes are visible",
1657 "-1");
1658 myTagProperties[currentTag].addAttribute(attrProperty);
1659
1660 attrProperty = AttributeProperties(SUMO_ATTR_SPEED,
1661 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
1662 "sets custom speed limit for the connection",
1663 toString(NBEdge::UNSPECIFIED_SPEED));
1664 myTagProperties[currentTag].addAttribute(attrProperty);
1665
1666 attrProperty = AttributeProperties(SUMO_ATTR_CUSTOMSHAPE,
1667 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1668 "sets custom shape for the connection");
1669 myTagProperties[currentTag].addAttribute(attrProperty);
1670
1671 attrProperty = AttributeProperties(SUMO_ATTR_DIR,
1672 ATTRPROPERTY_STRING | ATTRPROPERTY_NONEDITABLE,
1673 "turning direction for this connection (computed)");
1674 myTagProperties[currentTag].addAttribute(attrProperty);
1675
1676 attrProperty = AttributeProperties(SUMO_ATTR_STATE,
1677 ATTRPROPERTY_STRING | ATTRPROPERTY_NONEDITABLE,
1678 "link state for this connection (computed)");
1679 myTagProperties[currentTag].addAttribute(attrProperty);
1680 }
1681 }
1682
1683
1684 void
fillAdditionals()1685 GNEAttributeCarrier::fillAdditionals() {
1686 // declare empty AttributeProperties
1687 AttributeProperties attrProperty;
1688 // fill additional elements
1689 SumoXMLTag currentTag = SUMO_TAG_BUS_STOP;
1690 {
1691 // set values of tag
1692 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_CONTAINERSTOP, SUMO_TAG_LANE);
1693 // set values of attributes
1694 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1695 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1696 "The id of bus stop");
1697 myTagProperties[currentTag].addAttribute(attrProperty);
1698
1699 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
1700 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1701 "The name of the lane the bus stop shall be located at");
1702 myTagProperties[currentTag].addAttribute(attrProperty);
1703
1704 attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS,
1705 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1706 "The begin position on the lane (the lower position on the lane) in meters");
1707
1708 myTagProperties[currentTag].addAttribute(attrProperty);
1709 attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS,
1710 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1711 "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
1712 myTagProperties[currentTag].addAttribute(attrProperty);
1713
1714 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
1715 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1716 "Name of " + toString(currentTag));
1717 myTagProperties[currentTag].addAttribute(attrProperty);
1718
1719 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
1720 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1721 "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",
1722 "0");
1723 myTagProperties[currentTag].addAttribute(attrProperty);
1724
1725 attrProperty = AttributeProperties(SUMO_ATTR_LINES,
1726 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1727 "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes");
1728 myTagProperties[currentTag].addAttribute(attrProperty);
1729
1730 attrProperty = AttributeProperties(SUMO_ATTR_PERSON_CAPACITY,
1731 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1732 "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes",
1733 "-1");
1734 myTagProperties[currentTag].addAttribute(attrProperty);
1735 }
1736 currentTag = SUMO_TAG_ACCESS;
1737 {
1738 // set values of tag
1739 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_ACCESS, SUMO_TAG_BUS_STOP);
1740 // set values of attributes
1741 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
1742 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1743 "The name of the lane the stop access shall be located at");
1744 myTagProperties[currentTag].addAttribute(attrProperty);
1745
1746 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
1747 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1748 "The position on the lane (the lower position on the lane) in meters",
1749 "0");
1750 myTagProperties[currentTag].addAttribute(attrProperty);
1751
1752 attrProperty = AttributeProperties(SUMO_ATTR_LENGTH,
1753 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1754 "The walking length of the access in meters");
1755 myTagProperties[currentTag].addAttribute(attrProperty);
1756
1757 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
1758 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1759 "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",
1760 "0");
1761 myTagProperties[currentTag].addAttribute(attrProperty);
1762
1763 }
1764 currentTag = SUMO_TAG_CONTAINER_STOP;
1765 {
1766 // set values of tag
1767 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_CONTAINERSTOP, SUMO_TAG_LANE);
1768 // set values of attributes
1769 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1770 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1771 "The id of container stop");
1772 myTagProperties[currentTag].addAttribute(attrProperty);
1773
1774 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
1775 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1776 "The name of the lane the container stop shall be located at");
1777 myTagProperties[currentTag].addAttribute(attrProperty);
1778
1779 attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS,
1780 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1781 "The begin position on the lane (the lower position on the lane) in meters");
1782 myTagProperties[currentTag].addAttribute(attrProperty);
1783
1784 attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS,
1785 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1786 "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
1787 myTagProperties[currentTag].addAttribute(attrProperty);
1788
1789 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
1790 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1791 "Name of " + toString(currentTag));
1792 myTagProperties[currentTag].addAttribute(attrProperty);
1793
1794 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
1795 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1796 "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",
1797 "0");
1798 myTagProperties[currentTag].addAttribute(attrProperty);
1799
1800 attrProperty = AttributeProperties(SUMO_ATTR_LINES,
1801 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1802 "meant to be the names of the bus lines that stop at this container stop. This is only used for visualization purposes");
1803 myTagProperties[currentTag].addAttribute(attrProperty);
1804 }
1805 currentTag = SUMO_TAG_CHARGING_STATION;
1806 {
1807 // set values of tag
1808 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_CHARGINGSTATION, SUMO_TAG_LANE);
1809 // set values of attributes
1810 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1811 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1812 "The id of charging station");
1813 myTagProperties[currentTag].addAttribute(attrProperty);
1814
1815 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
1816 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1817 "Lane of the charging station location");
1818 myTagProperties[currentTag].addAttribute(attrProperty);
1819
1820 attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS,
1821 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1822 "Begin position in the specified lane");
1823 myTagProperties[currentTag].addAttribute(attrProperty);
1824
1825 attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS,
1826 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1827 "End position in the specified lane");
1828 myTagProperties[currentTag].addAttribute(attrProperty);
1829
1830 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
1831 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1832 "Name of " + toString(currentTag));
1833 myTagProperties[currentTag].addAttribute(attrProperty);
1834
1835 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
1836 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1837 "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",
1838 "0");
1839 myTagProperties[currentTag].addAttribute(attrProperty);
1840
1841 attrProperty = AttributeProperties(SUMO_ATTR_CHARGINGPOWER,
1842 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1843 "Charging power in W",
1844 "22000.00");
1845 myTagProperties[currentTag].addAttribute(attrProperty);
1846
1847 attrProperty = AttributeProperties(SUMO_ATTR_EFFICIENCY,
1848 ATTRPROPERTY_FLOAT | ATTRPROPERTY_RANGE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1849 "Charging efficiency [0,1]",
1850 "0.95");
1851 attrProperty.setRange(0, 1);
1852 myTagProperties[currentTag].addAttribute(attrProperty);
1853
1854 attrProperty = AttributeProperties(SUMO_ATTR_CHARGEINTRANSIT,
1855 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1856 "Enable or disable charge in transit, i.e. vehicle must or must not to stop for charging",
1857 "0");
1858 myTagProperties[currentTag].addAttribute(attrProperty);
1859
1860 attrProperty = AttributeProperties(SUMO_ATTR_CHARGEDELAY,
1861 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1862 "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins",
1863 "0.00");
1864 myTagProperties[currentTag].addAttribute(attrProperty);
1865 }
1866 currentTag = SUMO_TAG_PARKING_AREA;
1867 {
1868 // set values of tag
1869 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_PARKINGAREA, SUMO_TAG_LANE);
1870 // set values of attributes
1871 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1872 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1873 "The id of ParkingArea");
1874 myTagProperties[currentTag].addAttribute(attrProperty);
1875
1876 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
1877 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1878 "The name of the lane the Parking Area shall be located at");
1879 myTagProperties[currentTag].addAttribute(attrProperty);
1880
1881 attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS,
1882 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1883 "The begin position on the lane (the lower position on the lane) in meters");
1884 myTagProperties[currentTag].addAttribute(attrProperty);
1885
1886 attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS,
1887 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1888 "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
1889 myTagProperties[currentTag].addAttribute(attrProperty);
1890
1891 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
1892 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1893 "Name of " + toString(currentTag));
1894 myTagProperties[currentTag].addAttribute(attrProperty);
1895
1896 attrProperty = AttributeProperties(SUMO_ATTR_ROADSIDE_CAPACITY,
1897 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1898 " The number of parking spaces for road-side parking",
1899 "0");
1900 myTagProperties[currentTag].addAttribute(attrProperty);
1901
1902 attrProperty = AttributeProperties(SUMO_ATTR_ONROAD,
1903 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1904 "If set, vehicles will park on the road lane and thereby reducing capacity",
1905 "0");
1906 myTagProperties[currentTag].addAttribute(attrProperty);
1907
1908 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
1909 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1910 "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",
1911 "0");
1912 myTagProperties[currentTag].addAttribute(attrProperty);
1913
1914 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
1915 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1916 "The width of the road-side parking spaces",
1917 "3.20");
1918 myTagProperties[currentTag].addAttribute(attrProperty);
1919
1920 attrProperty = AttributeProperties(SUMO_ATTR_LENGTH,
1921 ATTRPROPERTY_FLOAT | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
1922 "The length of the road-side parking spaces. By default (endPos - startPos) / roadsideCapacity");
1923 myTagProperties[currentTag].addAttribute(attrProperty);
1924
1925 attrProperty = AttributeProperties(SUMO_ATTR_ANGLE,
1926 ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1927 "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise",
1928 "0.00");
1929 myTagProperties[currentTag].addAttribute(attrProperty);
1930
1931 }
1932 currentTag = SUMO_TAG_PARKING_SPACE;
1933 {
1934 // set values of tag
1935 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_MASKXYZPOSITION | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_REPARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_PARKINGSPACE, SUMO_TAG_PARKING_AREA);
1936 // set values of attributes
1937 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
1938 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_POSITION | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
1939 "The x-y-z position of the parking vehicle on the plane");
1940 myTagProperties[currentTag].addAttribute(attrProperty);
1941
1942 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
1943 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1944 "The width of the road-side parking spaces",
1945 "3.20");
1946 myTagProperties[currentTag].addAttribute(attrProperty);
1947
1948 attrProperty = AttributeProperties(SUMO_ATTR_LENGTH,
1949 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1950 "The length of the road-side parking spaces",
1951 "5.00");
1952 myTagProperties[currentTag].addAttribute(attrProperty);
1953
1954 attrProperty = AttributeProperties(SUMO_ATTR_ANGLE,
1955 ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
1956 "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise",
1957 "0.00");
1958 myTagProperties[currentTag].addAttribute(attrProperty);
1959
1960 }
1961 currentTag = SUMO_TAG_E1DETECTOR;
1962 {
1963 // set values of tag
1964 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_E1, SUMO_TAG_LANE);
1965 // set values of attributes
1966 attrProperty = AttributeProperties(SUMO_ATTR_ID,
1967 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
1968 "The id of E1");
1969 myTagProperties[currentTag].addAttribute(attrProperty);
1970
1971 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
1972 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1973 "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
1974 myTagProperties[currentTag].addAttribute(attrProperty);
1975
1976 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
1977 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
1978 "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");
1979 myTagProperties[currentTag].addAttribute(attrProperty);
1980
1981 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
1982 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
1983 "The aggregation period the values the detector collects shall be summed up",
1984 "900.00");
1985 myTagProperties[currentTag].addAttribute(attrProperty);
1986
1987 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
1988 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1989 "Name of " + toString(currentTag));
1990 myTagProperties[currentTag].addAttribute(attrProperty);
1991
1992 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
1993 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE,
1994 "The path to the output file");
1995 myTagProperties[currentTag].addAttribute(attrProperty);
1996
1997 attrProperty = AttributeProperties(SUMO_ATTR_VTYPES,
1998 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
1999 "Space separated list of vehicle type ids to consider");
2000 myTagProperties[currentTag].addAttribute(attrProperty);
2001
2002 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
2003 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2004 "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",
2005 "0");
2006 myTagProperties[currentTag].addAttribute(attrProperty);
2007
2008 }
2009 currentTag = SUMO_TAG_E2DETECTOR;
2010 {
2011 // set values of tag
2012 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_E2, SUMO_TAG_LANE);
2013 // set "file" as deprecated attribute
2014 myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT);
2015 // set values of attributes
2016 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2017 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2018 "The id of E2");
2019 myTagProperties[currentTag].addAttribute(attrProperty);
2020
2021 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2022 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2023 "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
2024 myTagProperties[currentTag].addAttribute(attrProperty);
2025
2026 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2027 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2028 "The position on the lane the detector shall be laid on in meters");
2029 myTagProperties[currentTag].addAttribute(attrProperty);
2030
2031 attrProperty = AttributeProperties(SUMO_ATTR_LENGTH,
2032 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
2033 "The length of the detector in meters",
2034 "10.00");
2035 myTagProperties[currentTag].addAttribute(attrProperty);
2036
2037 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
2038 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2039 "The aggregation period the values the detector collects shall be summed up",
2040 "900.00");
2041 myTagProperties[currentTag].addAttribute(attrProperty);
2042
2043 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2044 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2045 "Name of " + toString(currentTag));
2046 myTagProperties[currentTag].addAttribute(attrProperty);
2047
2048 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
2049 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE,
2050 "The path to the output file");
2051 myTagProperties[currentTag].addAttribute(attrProperty);
2052
2053 attrProperty = AttributeProperties(SUMO_ATTR_VTYPES,
2054 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2055 "Space separated list of vehicle type ids to consider");
2056 myTagProperties[currentTag].addAttribute(attrProperty);
2057
2058 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD,
2059 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2060 "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)",
2061 "1.00");
2062 myTagProperties[currentTag].addAttribute(attrProperty);
2063
2064 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD,
2065 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2066 "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
2067 "1.39");
2068 myTagProperties[currentTag].addAttribute(attrProperty);
2069
2070 attrProperty = AttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD,
2071 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2072 "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m",
2073 "10.00");
2074 myTagProperties[currentTag].addAttribute(attrProperty);
2075
2076 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
2077 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2078 "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",
2079 "0");
2080 myTagProperties[currentTag].addAttribute(attrProperty);
2081 }
2082 currentTag = SUMO_TAG_E2DETECTOR_MULTILANE;
2083 {
2084 // set values of tag
2085 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SYNONYM | TAGPROPERTY_BLOCKMOVEMENT, ICON_E2, SUMO_TAG_LANE, SUMO_TAG_E2DETECTOR);
2086 // set "file" as deprecated attribute
2087 myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT);
2088 // set values of attributes
2089 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2090 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2091 "The id of Multilane E2");
2092 myTagProperties[currentTag].addAttribute(attrProperty);
2093
2094 attrProperty = AttributeProperties(SUMO_ATTR_LANES,
2095 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_SECUENCIAL | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2096 "The list of secuencial lane ids in which the detector shall be laid on");
2097 myTagProperties[currentTag].addAttribute(attrProperty);
2098
2099 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2100 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2101 "The position on the lane the detector shall be laid on in meters");
2102 myTagProperties[currentTag].addAttribute(attrProperty);
2103
2104 attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS,
2105 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2106 "The end position on the lane the detector shall be laid on in meters");
2107 myTagProperties[currentTag].addAttribute(attrProperty);
2108
2109 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
2110 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2111 "The aggregation period the values the detector collects shall be summed up",
2112 "900.00");
2113 myTagProperties[currentTag].addAttribute(attrProperty);
2114
2115 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2116 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2117 "Name of " + toString(currentTag));
2118 myTagProperties[currentTag].addAttribute(attrProperty);
2119
2120 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
2121 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE,
2122 "The path to the output file");
2123 myTagProperties[currentTag].addAttribute(attrProperty);
2124
2125 attrProperty = AttributeProperties(SUMO_ATTR_VTYPES,
2126 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2127 "Space separated list of vehicle type ids to consider");
2128 myTagProperties[currentTag].addAttribute(attrProperty);
2129
2130 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD,
2131 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2132 "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)",
2133 "1.00");
2134 myTagProperties[currentTag].addAttribute(attrProperty);
2135
2136 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD,
2137 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2138 "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
2139 "1.39");
2140 myTagProperties[currentTag].addAttribute(attrProperty);
2141
2142 attrProperty = AttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD,
2143 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2144 "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m",
2145 "10.00");
2146 myTagProperties[currentTag].addAttribute(attrProperty);
2147
2148 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
2149 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2150 "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",
2151 "0");
2152 myTagProperties[currentTag].addAttribute(attrProperty);
2153
2154 }
2155 currentTag = SUMO_TAG_E3DETECTOR;
2156 {
2157 // set values of tag
2158 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MINIMUMCHILDS | TAGPROPERTY_AUTOMATICSORTING, ICON_E3);
2159 // set values of attributes
2160 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2161 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2162 "The id of E3");
2163 myTagProperties[currentTag].addAttribute(attrProperty);
2164
2165 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2166 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
2167 "X-Y position of detector in editor (Only used in NETEDIT)",
2168 "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2169 myTagProperties[currentTag].addAttribute(attrProperty);
2170
2171 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
2172 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2173 "The aggregation period the values the detector collects shall be summed up",
2174 "900.00");
2175 myTagProperties[currentTag].addAttribute(attrProperty);
2176
2177 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2178 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2179 "Name of " + toString(currentTag));
2180 myTagProperties[currentTag].addAttribute(attrProperty);
2181
2182 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
2183 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE,
2184 "The path to the output file");
2185 myTagProperties[currentTag].addAttribute(attrProperty);
2186
2187 attrProperty = AttributeProperties(SUMO_ATTR_VTYPES,
2188 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2189 "Space separated list of vehicle type ids to consider");
2190 myTagProperties[currentTag].addAttribute(attrProperty);
2191
2192 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD,
2193 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2194 "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting) in s",
2195 "1.00");
2196 myTagProperties[currentTag].addAttribute(attrProperty);
2197
2198 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD,
2199 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2200 "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s",
2201 "1.39");
2202 myTagProperties[currentTag].addAttribute(attrProperty);
2203 }
2204 currentTag = SUMO_TAG_DET_ENTRY;
2205 {
2206 // set values of tag
2207 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_REPARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_E3ENTRY, SUMO_TAG_E3DETECTOR);
2208 // set values of attributes
2209 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2210 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2211 "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
2212 myTagProperties[currentTag].addAttribute(attrProperty);
2213
2214 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2215 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2216 "The position on the lane the detector shall be laid on in meters");
2217 myTagProperties[currentTag].addAttribute(attrProperty);
2218
2219 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
2220 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2221 "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",
2222 "0");
2223 myTagProperties[currentTag].addAttribute(attrProperty);
2224
2225 }
2226 currentTag = SUMO_TAG_DET_EXIT;
2227 {
2228 // set values of tag
2229 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_REPARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_E3EXIT, SUMO_TAG_E3DETECTOR);
2230 // set values of attributes
2231 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2232 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2233 "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
2234 myTagProperties[currentTag].addAttribute(attrProperty);
2235
2236 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2237 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2238 "The position on the lane the detector shall be laid on in meters");
2239 myTagProperties[currentTag].addAttribute(attrProperty);
2240
2241 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
2242 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2243 "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",
2244 "0");
2245 myTagProperties[currentTag].addAttribute(attrProperty);
2246
2247 }
2248 currentTag = SUMO_TAG_INSTANT_INDUCTION_LOOP;
2249 {
2250 // set values of tag
2251 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_E1INSTANT);
2252 // set values of attributes
2253 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2254 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2255 "The id of Instant Induction Loop (E1Instant)");
2256 myTagProperties[currentTag].addAttribute(attrProperty);
2257
2258 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2259 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2260 "The id of the lane the detector shall be laid on. The lane must be a part of the network used");
2261 myTagProperties[currentTag].addAttribute(attrProperty);
2262
2263 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2264 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2265 "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");
2266 myTagProperties[currentTag].addAttribute(attrProperty);
2267
2268 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2269 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2270 "Name of " + toString(currentTag));
2271 myTagProperties[currentTag].addAttribute(attrProperty);
2272
2273 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
2274 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE,
2275 "The path to the output file");
2276 myTagProperties[currentTag].addAttribute(attrProperty);
2277
2278 attrProperty = AttributeProperties(SUMO_ATTR_VTYPES,
2279 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2280 "Space separated list of vehicle type ids to consider");
2281 myTagProperties[currentTag].addAttribute(attrProperty);
2282
2283 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
2284 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2285 "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",
2286 "0");
2287 myTagProperties[currentTag].addAttribute(attrProperty);
2288
2289 }
2290 currentTag = SUMO_TAG_VSS;
2291 {
2292 // set values of tag
2293 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_DIALOG, ICON_VARIABLESPEEDSIGN);
2294 // set "file" as deprecated attribute
2295 myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_FILE);
2296 // set values of attributes
2297 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2298 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE,
2299 "The id of Variable Speed Signal");
2300 myTagProperties[currentTag].addAttribute(attrProperty);
2301
2302 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2303 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
2304 "X-Y position of detector in editor (Only used in NETEDIT)",
2305 "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2306 myTagProperties[currentTag].addAttribute(attrProperty);
2307
2308 attrProperty = AttributeProperties(SUMO_ATTR_LANES,
2309 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
2310 "list of lanes of Variable Speed Sign");
2311 myTagProperties[currentTag].addAttribute(attrProperty);
2312
2313 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2314 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2315 "Name of " + toString(currentTag));
2316 myTagProperties[currentTag].addAttribute(attrProperty);
2317 }
2318 currentTag = SUMO_TAG_STEP;
2319 {
2320 // set values of tag
2321 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_VSSSTEP, SUMO_TAG_VSS);
2322 // set values of attributes
2323 attrProperty = AttributeProperties(SUMO_ATTR_TIME,
2324 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME,
2325 "Time");
2326 myTagProperties[currentTag].addAttribute(attrProperty);
2327
2328 attrProperty = AttributeProperties(SUMO_ATTR_SPEED,
2329 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
2330 "Speed",
2331 "13.89");
2332 myTagProperties[currentTag].addAttribute(attrProperty);
2333 }
2334 currentTag = SUMO_TAG_CALIBRATOR;
2335 {
2336 // set values of tag
2337 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_DIALOG, ICON_CALIBRATOR);
2338 // set values of attributes
2339 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2340 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2341 "The id of Calibrator");
2342 myTagProperties[currentTag].addAttribute(attrProperty);
2343
2344 attrProperty = AttributeProperties(SUMO_ATTR_EDGE,
2345 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2346 "The id of edge in the simulation network");
2347 myTagProperties[currentTag].addAttribute(attrProperty);
2348
2349 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2350 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
2351 "The position of the calibrator on the specified lane",
2352 "0");
2353 myTagProperties[currentTag].addAttribute(attrProperty);
2354
2355 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
2356 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2357 "The aggregation interval in which to calibrate the flows. default is step-length",
2358 "1.00");
2359 myTagProperties[currentTag].addAttribute(attrProperty);
2360
2361 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2362 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2363 "Name of " + toString(currentTag));
2364 myTagProperties[currentTag].addAttribute(attrProperty);
2365
2366 attrProperty = AttributeProperties(SUMO_ATTR_ROUTEPROBE,
2367 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2368 "The id of the routeProbe element from which to determine the route distribution for generated vehicles");
2369 myTagProperties[currentTag].addAttribute(attrProperty);
2370
2371 attrProperty = AttributeProperties(SUMO_ATTR_OUTPUT,
2372 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2373 "The output file for writing calibrator information or NULL");
2374 myTagProperties[currentTag].addAttribute(attrProperty);
2375 }
2376 currentTag = SUMO_TAG_LANECALIBRATOR;
2377 {
2378 // set values of tag
2379 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_SYNONYM | TAGPROPERTY_DIALOG, ICON_CALIBRATOR, SUMO_TAG_NOTHING, SUMO_TAG_CALIBRATOR);
2380 // set values of attributes
2381 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2382 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2383 "The id of Calibrator");
2384 myTagProperties[currentTag].addAttribute(attrProperty);
2385
2386 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2387 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2388 "The id of lane in the simulation network");
2389 myTagProperties[currentTag].addAttribute(attrProperty);
2390
2391 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2392 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
2393 "The position of the calibrator on the specified lane",
2394 "0");
2395 myTagProperties[currentTag].addAttribute(attrProperty);
2396
2397 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
2398 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2399 "The aggregation interval in which to calibrate the flows. default is step-length",
2400 "100.00");
2401 myTagProperties[currentTag].addAttribute(attrProperty);
2402
2403 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2404 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2405 "Name of " + toString(currentTag));
2406 myTagProperties[currentTag].addAttribute(attrProperty);
2407
2408 attrProperty = AttributeProperties(SUMO_ATTR_ROUTEPROBE,
2409 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2410 "The id of the routeProbe element from which to determine the route distribution for generated vehicles");
2411 myTagProperties[currentTag].addAttribute(attrProperty);
2412
2413 attrProperty = AttributeProperties(SUMO_ATTR_OUTPUT,
2414 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2415 "The output file for writing calibrator information or NULL");
2416 myTagProperties[currentTag].addAttribute(attrProperty);
2417 }
2418 currentTag = SUMO_TAG_CALIBRATORFLOW;
2419 {
2420 // set values of tag
2421 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT | TAGPROPERTY_DISJOINTATTRIBUTES, ICON_FLOW, SUMO_TAG_CALIBRATOR);
2422 // set values of attributes
2423 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
2424 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
2425 "The id of the vehicle type to use for this vehicle",
2426 DEFAULT_VTYPE_ID);
2427 myTagProperties[currentTag].addAttribute(attrProperty);
2428
2429 attrProperty = AttributeProperties(SUMO_ATTR_ROUTE,
2430 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2431 "The id of the route the vehicle shall drive along");
2432 myTagProperties[currentTag].addAttribute(attrProperty);
2433
2434 attrProperty = AttributeProperties(SUMO_ATTR_VEHSPERHOUR,
2435 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2436 "Number of vehicles per hour, equally spaced");
2437 myTagProperties[currentTag].addAttribute(attrProperty);
2438
2439 attrProperty = AttributeProperties(SUMO_ATTR_SPEED,
2440 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2441 "Speed of vehicles");
2442 myTagProperties[currentTag].addAttribute(attrProperty);
2443
2444 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
2445 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2446 "This vehicle's color",
2447 "yellow");
2448 myTagProperties[currentTag].addAttribute(attrProperty);
2449
2450 attrProperty = AttributeProperties(SUMO_ATTR_BEGIN,
2451 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2452 "First vehicle departure time",
2453 "0.00");
2454 myTagProperties[currentTag].addAttribute(attrProperty);
2455
2456 attrProperty = AttributeProperties(SUMO_ATTR_END,
2457 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2458 "End of departure interval",
2459 "3600.00");
2460 myTagProperties[currentTag].addAttribute(attrProperty);
2461
2462 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTLANE,
2463 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
2464 "The lane on which the vehicle shall be inserted",
2465 "first");
2466 myTagProperties[currentTag].addAttribute(attrProperty);
2467
2468 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS,
2469 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
2470 "The position at which the vehicle shall enter the net",
2471 "base");
2472 myTagProperties[currentTag].addAttribute(attrProperty);
2473
2474 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTSPEED,
2475 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2476 "The speed with which the vehicle shall enter the network",
2477 "0");
2478 myTagProperties[currentTag].addAttribute(attrProperty);
2479
2480 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALLANE,
2481 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2482 "The lane at which the vehicle shall leave the network",
2483 "current");
2484 myTagProperties[currentTag].addAttribute(attrProperty);
2485
2486 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS,
2487 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2488 "The position at which the vehicle shall leave the network",
2489 "max");
2490 myTagProperties[currentTag].addAttribute(attrProperty);
2491
2492 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALSPEED,
2493 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2494 "The speed with which the vehicle shall leave the network",
2495 "current");
2496 myTagProperties[currentTag].addAttribute(attrProperty);
2497
2498 attrProperty = AttributeProperties(SUMO_ATTR_LINE,
2499 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2500 "A string specifying the id of a public transport line which can be used when specifying person rides");
2501 myTagProperties[currentTag].addAttribute(attrProperty);
2502
2503 attrProperty = AttributeProperties(SUMO_ATTR_PERSON_NUMBER,
2504 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2505 "The number of occupied seats when the vehicle is inserted",
2506 "0");
2507 myTagProperties[currentTag].addAttribute(attrProperty);
2508
2509 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_NUMBER,
2510 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2511 "The number of occupied container places when the vehicle is inserted",
2512 "0");
2513 myTagProperties[currentTag].addAttribute(attrProperty);
2514
2515 attrProperty = AttributeProperties(SUMO_ATTR_REROUTE,
2516 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2517 "Whether the vehicle should be equipped with a rerouting device",
2518 "0");
2519 myTagProperties[currentTag].addAttribute(attrProperty);
2520
2521 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS_LAT,
2522 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2523 "The lateral position on the departure lane at which the vehicle shall enter the net",
2524 "center");
2525 attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());
2526 myTagProperties[currentTag].addAttribute(attrProperty);
2527
2528 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS_LAT,
2529 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2530 "The lateral position on the arrival lane at which the vehicle shall arrive",
2531 "center");
2532 attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());
2533 myTagProperties[currentTag].addAttribute(attrProperty);
2534 }
2535 currentTag = SUMO_TAG_REROUTER;
2536 {
2537 // set values of tag
2538 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_DIALOG | TAGPROPERTY_WRITECHILDSSEPARATE, ICON_REROUTER);
2539 // set values of attributes
2540 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2541 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2542 "The id of Rerouter");
2543 myTagProperties[currentTag].addAttribute(attrProperty);
2544
2545 attrProperty = AttributeProperties(SUMO_ATTR_EDGES,
2546 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2547 "An edge id or a list of edge ids where vehicles shall be rerouted");
2548 myTagProperties[currentTag].addAttribute(attrProperty);
2549
2550 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2551 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
2552 "X,Y position in editor (Only used in NETEDIT)",
2553 "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2554 myTagProperties[currentTag].addAttribute(attrProperty);
2555
2556 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2557 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2558 "Name of " + toString(currentTag));
2559 myTagProperties[currentTag].addAttribute(attrProperty);
2560
2561 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
2562 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2563 "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)");
2564 myTagProperties[currentTag].addAttribute(attrProperty);
2565
2566 attrProperty = AttributeProperties(SUMO_ATTR_PROB,
2567 ATTRPROPERTY_FLOAT | ATTRPROPERTY_PROBABILITY | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2568 "The probability for vehicle rerouting (0-1)",
2569 "1.00");
2570 myTagProperties[currentTag].addAttribute(attrProperty);
2571
2572 attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD,
2573 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2574 "The waiting time threshold (in s) that must be reached to activate rerouting (default -1 which disables the threshold)",
2575 "0.00");
2576 myTagProperties[currentTag].addAttribute(attrProperty);
2577
2578 attrProperty = AttributeProperties(SUMO_ATTR_VTYPES,
2579 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2580 "The list of vehicle types that shall be affected by this rerouter (empty to affect all types)");
2581 myTagProperties[currentTag].addAttribute(attrProperty);
2582
2583 attrProperty = AttributeProperties(SUMO_ATTR_OFF,
2584 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2585 "Whether the router should be inactive initially (and switched on in the gui)",
2586 "0");
2587 myTagProperties[currentTag].addAttribute(attrProperty);
2588 }
2589 currentTag = SUMO_TAG_INTERVAL;
2590 {
2591 // set values of tag
2592 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_REROUTERINTERVAL, SUMO_TAG_REROUTER);
2593 // set values of attributes
2594 attrProperty = AttributeProperties(SUMO_ATTR_BEGIN,
2595 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2596 "Begin",
2597 "0");
2598 myTagProperties[currentTag].addAttribute(attrProperty);
2599
2600 attrProperty = AttributeProperties(SUMO_ATTR_END,
2601 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2602 "End",
2603 "3600.00");
2604 myTagProperties[currentTag].addAttribute(attrProperty);
2605 }
2606 currentTag = SUMO_TAG_CLOSING_REROUTE;
2607 {
2608 // set values of tag
2609 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_CLOSINGREROUTE, SUMO_TAG_INTERVAL);
2610 // set values of attributes
2611 attrProperty = AttributeProperties(SUMO_ATTR_EDGE,
2612 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY,
2613 "Edge ID");
2614 attrProperty.setSynonym(SUMO_ATTR_ID);
2615 myTagProperties[currentTag].addAttribute(attrProperty);
2616
2617 attrProperty = AttributeProperties(SUMO_ATTR_ALLOW,
2618 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE | ATTRPROPERTY_OPTIONAL,
2619 "allowed vehicles");
2620 myTagProperties[currentTag].addAttribute(attrProperty);
2621
2622 attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW,
2623 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE | ATTRPROPERTY_OPTIONAL,
2624 "disallowed vehicles");
2625 myTagProperties[currentTag].addAttribute(attrProperty);
2626 }
2627 currentTag = SUMO_TAG_CLOSING_LANE_REROUTE;
2628 {
2629 // set values of tag
2630 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_CLOSINGLANEREROUTE, SUMO_TAG_INTERVAL);
2631 // set values of attributes
2632 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2633 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY,
2634 "Lane ID");
2635 attrProperty.setSynonym(SUMO_ATTR_ID);
2636 myTagProperties[currentTag].addAttribute(attrProperty);
2637
2638 attrProperty = AttributeProperties(SUMO_ATTR_ALLOW,
2639 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE | ATTRPROPERTY_OPTIONAL,
2640 "allowed vehicles");
2641 myTagProperties[currentTag].addAttribute(attrProperty);
2642
2643 attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW,
2644 ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_COMBINABLE | ATTRPROPERTY_OPTIONAL,
2645 "disallowed vehicles");
2646 myTagProperties[currentTag].addAttribute(attrProperty);
2647 }
2648 currentTag = SUMO_TAG_DEST_PROB_REROUTE;
2649 {
2650 // set values of tag
2651 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_DESTPROBREROUTE, SUMO_TAG_INTERVAL);
2652 // set values of attributes
2653 attrProperty = AttributeProperties(SUMO_ATTR_EDGE,
2654 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY,
2655 "Edge ID");
2656 attrProperty.setSynonym(SUMO_ATTR_ID);
2657 myTagProperties[currentTag].addAttribute(attrProperty);
2658
2659 attrProperty = AttributeProperties(SUMO_ATTR_PROB,
2660 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2661 "SUMO Probability",
2662 "1.00");
2663 myTagProperties[currentTag].addAttribute(attrProperty);
2664 }
2665 currentTag = SUMO_TAG_PARKING_ZONE_REROUTE;
2666 {
2667 // set values of tag
2668 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_PARKINGZONEREROUTE, SUMO_TAG_INTERVAL);
2669 // set values of attributes
2670 attrProperty = AttributeProperties(SUMO_ATTR_PARKING,
2671 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM,
2672 "ParkingArea ID");
2673 attrProperty.setSynonym(SUMO_ATTR_ID);
2674 myTagProperties[currentTag].addAttribute(attrProperty);
2675
2676 attrProperty = AttributeProperties(SUMO_ATTR_PROB,
2677 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2678 "SUMO Probability",
2679 "1.00");
2680 myTagProperties[currentTag].addAttribute(attrProperty);
2681
2682 attrProperty = AttributeProperties(SUMO_ATTR_VISIBLE,
2683 ATTRPROPERTY_BOOL | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_DEFAULTVALUE,
2684 "Enable or disable visibility for parking area reroutes",
2685 "1");
2686 myTagProperties[currentTag].addAttribute(attrProperty);
2687 }
2688 currentTag = SUMO_TAG_ROUTE_PROB_REROUTE;
2689 {
2690 // set values of tag
2691 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_ROUTEPROBREROUTE, SUMO_TAG_INTERVAL);
2692 // set values of attributes
2693 attrProperty = AttributeProperties(SUMO_ATTR_ROUTE,
2694 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY,
2695 "Route");
2696 attrProperty.setSynonym(SUMO_ATTR_ID);
2697 myTagProperties[currentTag].addAttribute(attrProperty);
2698
2699 attrProperty = AttributeProperties(SUMO_ATTR_PROB,
2700 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2701 "SUMO Probability",
2702 "1.00");
2703 myTagProperties[currentTag].addAttribute(attrProperty);
2704 }
2705 currentTag = SUMO_TAG_ROUTEPROBE;
2706 {
2707 // set values of tag
2708 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_ROUTEPROBE);
2709 // set values of attributes
2710 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2711 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2712 "The id of RouteProbe");
2713 myTagProperties[currentTag].addAttribute(attrProperty);
2714
2715 attrProperty = AttributeProperties(SUMO_ATTR_EDGE,
2716 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2717 "The id of an edge in the simulation network");
2718 myTagProperties[currentTag].addAttribute(attrProperty);
2719
2720 attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY,
2721 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2722 "The frequency in which to report the distribution",
2723 "3600");
2724 myTagProperties[currentTag].addAttribute(attrProperty);
2725
2726 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2727 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2728 "Name of " + toString(currentTag));
2729 myTagProperties[currentTag].addAttribute(attrProperty);
2730
2731 attrProperty = AttributeProperties(SUMO_ATTR_FILE,
2732 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE,
2733 "The file for generated output");
2734 myTagProperties[currentTag].addAttribute(attrProperty);
2735
2736 attrProperty = AttributeProperties(SUMO_ATTR_BEGIN,
2737 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2738 "The time at which to start generating output",
2739 "0");
2740 myTagProperties[currentTag].addAttribute(attrProperty);
2741 }
2742 currentTag = SUMO_TAG_VAPORIZER;
2743 {
2744 // set values of tag
2745 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_VAPORIZER);
2746 // set values of attributes
2747 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2748 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2749 "Edge in which vaporizer is placed");
2750 myTagProperties[currentTag].addAttribute(attrProperty);
2751
2752 attrProperty = AttributeProperties(SUMO_ATTR_BEGIN,
2753 ATTRPROPERTY_FLOAT | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2754 "Start Time",
2755 "0");
2756 myTagProperties[currentTag].addAttribute(attrProperty);
2757
2758 attrProperty = AttributeProperties(SUMO_ATTR_END,
2759 ATTRPROPERTY_FLOAT | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
2760 "End Time",
2761 "3600.00");
2762 myTagProperties[currentTag].addAttribute(attrProperty);
2763
2764 attrProperty = AttributeProperties(SUMO_ATTR_NAME,
2765 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2766 "Name of " + toString(currentTag));
2767 myTagProperties[currentTag].addAttribute(attrProperty);
2768 }
2769 currentTag = SUMO_TAG_TAZ;
2770 {
2771 // set values of tag
2772 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_TAZ, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_BLOCKSHAPE | TAGPROPERTY_AUTOMATICSORTING, ICON_TAZ);
2773 // set values of attributes
2774 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2775 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2776 "The id of the TAZ");
2777 myTagProperties[currentTag].addAttribute(attrProperty);
2778
2779 attrProperty = AttributeProperties(SUMO_ATTR_SHAPE,
2780 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
2781 "The shape of the TAZ");
2782 myTagProperties[currentTag].addAttribute(attrProperty);
2783
2784 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
2785 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2786 "The RGBA color with which the TAZ shall be displayed",
2787 "red");
2788 myTagProperties[currentTag].addAttribute(attrProperty);
2789 }
2790 currentTag = SUMO_TAG_TAZSOURCE;
2791 {
2792 // set values of tag
2793 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_TAZ, TAGPROPERTY_PARENT, ICON_TAZEDGE, SUMO_TAG_TAZ);
2794 // set values of attributes
2795 attrProperty = AttributeProperties(SUMO_ATTR_EDGE,
2796 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY,
2797 "The id of edge in the simulation network");
2798 attrProperty.setSynonym(SUMO_ATTR_ID);
2799 myTagProperties[currentTag].addAttribute(attrProperty);
2800
2801 attrProperty = AttributeProperties(SUMO_ATTR_WEIGHT,
2802 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
2803 "Depart weight associated to this Edge",
2804 "1");
2805 myTagProperties[currentTag].addAttribute(attrProperty);
2806 }
2807 currentTag = SUMO_TAG_TAZSINK;
2808 {
2809 // set values of tag
2810 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_TAZ, TAGPROPERTY_PARENT, ICON_TAZEDGE, SUMO_TAG_TAZ);
2811 // set values of attributes
2812 attrProperty = AttributeProperties(SUMO_ATTR_EDGE,
2813 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_NONEDITABLE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY,
2814 "The id of edge in the simulation network");
2815 attrProperty.setSynonym(SUMO_ATTR_ID);
2816 myTagProperties[currentTag].addAttribute(attrProperty);
2817
2818 attrProperty = AttributeProperties(SUMO_ATTR_WEIGHT,
2819 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
2820 "Arrival weight associated to this Edget",
2821 "1");
2822 myTagProperties[currentTag].addAttribute(attrProperty);
2823 }
2824 }
2825
2826
2827 void
fillShapes()2828 GNEAttributeCarrier::fillShapes() {
2829 // declare empty AttributeProperties
2830 AttributeProperties attrProperty;
2831 // fill shape ACs
2832 SumoXMLTag currentTag = SUMO_TAG_POLY;
2833 {
2834 // set values of tag
2835 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_SHAPE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_BLOCKSHAPE | TAGPROPERTY_CLOSESHAPE | TAGPROPERTY_GEOSHAPE, ICON_LOCATEPOLY /* temporal */);
2836 // set values of attributes
2837 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2838 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2839 "The id of the polygon");
2840 myTagProperties[currentTag].addAttribute(attrProperty);
2841
2842 attrProperty = AttributeProperties(SUMO_ATTR_SHAPE,
2843 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE,
2844 "The shape of the polygon");
2845 myTagProperties[currentTag].addAttribute(attrProperty);
2846
2847 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
2848 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2849 "The RGBA color with which the polygon shall be displayed",
2850 "red");
2851 myTagProperties[currentTag].addAttribute(attrProperty);
2852
2853 attrProperty = AttributeProperties(SUMO_ATTR_FILL,
2854 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2855 "An information whether the polygon shall be filled",
2856 "0");
2857 myTagProperties[currentTag].addAttribute(attrProperty);
2858
2859 attrProperty = AttributeProperties(SUMO_ATTR_LINEWIDTH,
2860 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2861 "The default line width for drawing an unfilled polygon",
2862 "1");
2863 myTagProperties[currentTag].addAttribute(attrProperty);
2864
2865 attrProperty = AttributeProperties(SUMO_ATTR_LAYER,
2866 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2867 "The layer in which the polygon lies",
2868 toString(Shape::DEFAULT_LAYER));
2869 myTagProperties[currentTag].addAttribute(attrProperty);
2870
2871 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
2872 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2873 "A typename for the polygon",
2874 toString(Shape::DEFAULT_TYPE));
2875 myTagProperties[currentTag].addAttribute(attrProperty);
2876
2877 attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE,
2878 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2879 "A bitmap to use for rendering this polygon",
2880 toString(Shape::DEFAULT_IMG_FILE));
2881 myTagProperties[currentTag].addAttribute(attrProperty);
2882
2883 attrProperty = AttributeProperties(SUMO_ATTR_RELATIVEPATH,
2884 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2885 "Enable or disable use image file as a relative path",
2886 toString(Shape::DEFAULT_RELATIVEPATH));
2887 myTagProperties[currentTag].addAttribute(attrProperty);
2888
2889 attrProperty = AttributeProperties(SUMO_ATTR_ANGLE,
2890 ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2891 "Angle of rendered image in degree",
2892 toString(Shape::DEFAULT_ANGLE));
2893 myTagProperties[currentTag].addAttribute(attrProperty);
2894 }
2895 currentTag = SUMO_TAG_POI;
2896 {
2897 // set values of tag
2898 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_SHAPE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKXYZPOSITION | TAGPROPERTY_GEOPOSITION, ICON_LOCATEPOI /* temporal */);
2899 // set values of attributes
2900 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2901 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2902 "The id of the POI");
2903 myTagProperties[currentTag].addAttribute(attrProperty);
2904
2905 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2906 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y
2907 "The position in view");
2908 myTagProperties[currentTag].addAttribute(attrProperty);
2909
2910 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
2911 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2912 "The color with which the poi shall be displayed",
2913 "red");
2914 myTagProperties[currentTag].addAttribute(attrProperty);
2915
2916 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
2917 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2918 "A typename for the poi",
2919 toString(Shape::DEFAULT_TYPE));
2920 myTagProperties[currentTag].addAttribute(attrProperty);
2921
2922 attrProperty = AttributeProperties(SUMO_ATTR_LAYER,
2923 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2924 "The layer of the poi for drawing and selecting",
2925 toString(Shape::DEFAULT_LAYER_POI));
2926 myTagProperties[currentTag].addAttribute(attrProperty);
2927
2928 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
2929 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2930 "Width of rendered image in meters",
2931 toString(Shape::DEFAULT_IMG_WIDTH));
2932 myTagProperties[currentTag].addAttribute(attrProperty);
2933
2934 attrProperty = AttributeProperties(SUMO_ATTR_HEIGHT,
2935 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2936 "Height of rendered image in meters",
2937 toString(Shape::DEFAULT_IMG_HEIGHT));
2938 myTagProperties[currentTag].addAttribute(attrProperty);
2939
2940 attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE,
2941 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2942 "A bitmap to use for rendering this poi",
2943 toString(Shape::DEFAULT_IMG_FILE));
2944 myTagProperties[currentTag].addAttribute(attrProperty);
2945
2946 attrProperty = AttributeProperties(SUMO_ATTR_RELATIVEPATH,
2947 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2948 "Enable or disable use image file as a relative path",
2949 toString(Shape::DEFAULT_RELATIVEPATH));
2950 myTagProperties[currentTag].addAttribute(attrProperty);
2951
2952 attrProperty = AttributeProperties(SUMO_ATTR_ANGLE,
2953 ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2954 "Angle of rendered image in degree",
2955 toString(Shape::DEFAULT_ANGLE));
2956 myTagProperties[currentTag].addAttribute(attrProperty);
2957 }
2958 currentTag = SUMO_TAG_POILANE;
2959 {
2960 // set values of tag
2961 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_SHAPE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_LOCATEPOI /* temporal */);
2962 // set values of attributes
2963 attrProperty = AttributeProperties(SUMO_ATTR_ID,
2964 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2965 "The id of the POI");
2966 myTagProperties[currentTag].addAttribute(attrProperty);
2967
2968 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
2969 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
2970 "The name of the lane the poi is located at");
2971 myTagProperties[currentTag].addAttribute(attrProperty);
2972
2973 attrProperty = AttributeProperties(SUMO_ATTR_POSITION,
2974 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
2975 "The position on the named lane or in the net in meters at which the poi is located at");
2976 myTagProperties[currentTag].addAttribute(attrProperty);
2977
2978 attrProperty = AttributeProperties(SUMO_ATTR_POSITION_LAT,
2979 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
2980 "The lateral offset on the named lane at which the poi is located at",
2981 "0.00");
2982 myTagProperties[currentTag].addAttribute(attrProperty);
2983
2984 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
2985 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2986 "The color with which the poi shall be displayed",
2987 "red");
2988 myTagProperties[currentTag].addAttribute(attrProperty);
2989
2990 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
2991 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2992 "A typename for the poi",
2993 toString(Shape::DEFAULT_TYPE));
2994 myTagProperties[currentTag].addAttribute(attrProperty);
2995
2996 attrProperty = AttributeProperties(SUMO_ATTR_LAYER,
2997 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
2998 "The layer of the poi for drawing and selecting",
2999 toString(Shape::DEFAULT_LAYER_POI));
3000 myTagProperties[currentTag].addAttribute(attrProperty);
3001
3002 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
3003 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3004 "Width of rendered image in meters",
3005 toString(Shape::DEFAULT_IMG_WIDTH));
3006 myTagProperties[currentTag].addAttribute(attrProperty);
3007
3008 attrProperty = AttributeProperties(SUMO_ATTR_HEIGHT,
3009 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3010 "Height of rendered image in meters",
3011 toString(Shape::DEFAULT_IMG_HEIGHT));
3012 myTagProperties[currentTag].addAttribute(attrProperty);
3013
3014 attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE,
3015 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3016 "A bitmap to use for rendering this poi",
3017 toString(Shape::DEFAULT_IMG_FILE));
3018 myTagProperties[currentTag].addAttribute(attrProperty);
3019
3020 attrProperty = AttributeProperties(SUMO_ATTR_RELATIVEPATH,
3021 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3022 "Enable or disable use image file as a relative path",
3023 toString(Shape::DEFAULT_RELATIVEPATH));
3024 myTagProperties[currentTag].addAttribute(attrProperty);
3025
3026 attrProperty = AttributeProperties(SUMO_ATTR_ANGLE,
3027 ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3028 "Angle of rendered image in degree",
3029 toString(Shape::DEFAULT_ANGLE));
3030 myTagProperties[currentTag].addAttribute(attrProperty);
3031 }
3032 }
3033
3034
3035 void
fillDemandElements()3036 GNEAttributeCarrier::fillDemandElements() {
3037 // declare empty AttributeProperties
3038 AttributeProperties attrProperty;
3039 // obtain a vector string with the emissions
3040 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",
3041 "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",
3042 "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",
3043 "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",
3044 "HDV_D_EU1", "HDV_D_EU2", "HDV_D_EU3", "HDV_D_EU4", "HDV_D_EU5", "HDV_D_EU6", "HDV_D_East"
3045 };
3046 // fill demand elements
3047 SumoXMLTag currentTag = SUMO_TAG_ROUTE;
3048 {
3049 // set values of tag
3050 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_ROUTE);
3051 // set values of attributes
3052 attrProperty = AttributeProperties(SUMO_ATTR_ID,
3053 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
3054 "The id of Route");
3055 myTagProperties[currentTag].addAttribute(attrProperty);
3056
3057 attrProperty = AttributeProperties(SUMO_ATTR_EDGES,
3058 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3059 "The edges the vehicle shall drive along, given as their ids, separated using spaces");
3060 myTagProperties[currentTag].addAttribute(attrProperty);
3061
3062 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
3063 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3064 "This route's color",
3065 "yellow");
3066 myTagProperties[currentTag].addAttribute(attrProperty);
3067 }
3068 currentTag = SUMO_TAG_VTYPE;
3069 {
3070 // set values of tag
3071 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT, 0, ICON_VTYPE);
3072 // set values of attributes
3073 attrProperty = AttributeProperties(SUMO_ATTR_ID,
3074 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
3075 "The id of VehicleType");
3076 myTagProperties[currentTag].addAttribute(attrProperty);
3077
3078 attrProperty = AttributeProperties(SUMO_ATTR_VCLASS,
3079 ATTRPROPERTY_VCLASS | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3080 "An abstract vehicle class",
3081 "passenger");
3082 attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings());
3083 myTagProperties[currentTag].addAttribute(attrProperty);
3084
3085 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
3086 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3087 "This vehicle type's color",
3088 "");
3089 myTagProperties[currentTag].addAttribute(attrProperty);
3090
3091 attrProperty = AttributeProperties(SUMO_ATTR_LENGTH,
3092 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3093 "The vehicle's netto-length (length) [m]",
3094 "5.00");
3095 myTagProperties[currentTag].addAttribute(attrProperty);
3096
3097 attrProperty = AttributeProperties(SUMO_ATTR_MINGAP,
3098 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3099 "Empty space after leader [m]",
3100 "2.50");
3101 myTagProperties[currentTag].addAttribute(attrProperty);
3102
3103 attrProperty = AttributeProperties(SUMO_ATTR_MAXSPEED,
3104 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3105 "The vehicle's maximum velocity [m/s]",
3106 "55.00");
3107 myTagProperties[currentTag].addAttribute(attrProperty);
3108
3109 attrProperty = AttributeProperties(SUMO_ATTR_SPEEDFACTOR,
3110 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3111 "The vehicles expected multiplicator for lane speed limits",
3112 "1.00");
3113 myTagProperties[currentTag].addAttribute(attrProperty);
3114
3115 attrProperty = AttributeProperties(SUMO_ATTR_SPEEDDEV,
3116 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3117 "The deviation of the speedFactor",
3118 "0.00");
3119 myTagProperties[currentTag].addAttribute(attrProperty);
3120
3121 attrProperty = AttributeProperties(SUMO_ATTR_EMISSIONCLASS,
3122 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3123 "An abstract emission class",
3124 "PC_G_EU4");
3125 attrProperty.setDiscreteValues(emissions);
3126 myTagProperties[currentTag].addAttribute(attrProperty);
3127
3128 attrProperty = AttributeProperties(SUMO_ATTR_GUISHAPE,
3129 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3130 "How this vehicle is rendered");
3131 attrProperty.setDiscreteValues(SumoVehicleShapeStrings.getStrings());
3132 myTagProperties[currentTag].addAttribute(attrProperty);
3133
3134 attrProperty = AttributeProperties(SUMO_ATTR_WIDTH,
3135 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3136 "The vehicle's width [m] (only used for drawing)",
3137 "1.8");
3138 myTagProperties[currentTag].addAttribute(attrProperty);
3139
3140 attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE,
3141 ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3142 "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)");
3143 myTagProperties[currentTag].addAttribute(attrProperty);
3144
3145 attrProperty = AttributeProperties(SUMO_ATTR_LANE_CHANGE_MODEL,
3146 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3147 "The model used for changing lanes",
3148 "default");
3149 attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneChangeModels.getStrings());
3150 myTagProperties[currentTag].addAttribute(attrProperty);
3151
3152 attrProperty = AttributeProperties(SUMO_ATTR_CAR_FOLLOW_MODEL,
3153 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3154 "The model used for car following",
3155 "Krauss");
3156 attrProperty.setDiscreteValues(SUMOXMLDefinitions::CarFollowModels.getStrings());
3157 myTagProperties[currentTag].addAttribute(attrProperty);
3158
3159 attrProperty = AttributeProperties(SUMO_ATTR_PERSON_CAPACITY,
3160 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3161 "The number of persons (excluding an autonomous driver) the vehicle can transport",
3162 "4");
3163 myTagProperties[currentTag].addAttribute(attrProperty);
3164
3165 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_CAPACITY,
3166 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3167 "The number of containers the vehicle can transport",
3168 "0");
3169 myTagProperties[currentTag].addAttribute(attrProperty);
3170
3171 attrProperty = AttributeProperties(SUMO_ATTR_BOARDING_DURATION,
3172 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3173 "The time required by a person to board the vehicle",
3174 "0.50");
3175 myTagProperties[currentTag].addAttribute(attrProperty);
3176
3177 attrProperty = AttributeProperties(SUMO_ATTR_LOADING_DURATION,
3178 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3179 "The time required to load a container onto the vehicle",
3180 "90.00");
3181 myTagProperties[currentTag].addAttribute(attrProperty);
3182
3183 attrProperty = AttributeProperties(SUMO_ATTR_LATALIGNMENT,
3184 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3185 "The preferred lateral alignment when using the sublane-model",
3186 "center");
3187 attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());
3188 myTagProperties[currentTag].addAttribute(attrProperty);
3189
3190 attrProperty = AttributeProperties(SUMO_ATTR_MINGAP_LAT,
3191 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3192 "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model",
3193 "0.12");
3194 myTagProperties[currentTag].addAttribute(attrProperty);
3195
3196 attrProperty = AttributeProperties(SUMO_ATTR_MAXSPEED_LAT,
3197 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3198 "The maximum lateral speed when using the sublane-model",
3199 "1.00");
3200 myTagProperties[currentTag].addAttribute(attrProperty);
3201
3202 attrProperty = AttributeProperties(SUMO_ATTR_ACTIONSTEPLENGTH,
3203 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3204 "The interval length for which vehicle performs its decision logic (acceleration and lane-changing)",
3205 toString(OptionsCont::getOptions().getFloat("default.action-step-length")));
3206 myTagProperties[currentTag].addAttribute(attrProperty);
3207
3208 // fill Car Following Model Values (implemented in a separated function to improve code legibility)
3209 fillCarFollowingModelAttributes();
3210 // fill Junction Model Parameters (implemented in a separated function to improve code legibility)
3211 fillJunctionModelAttributes();
3212 }
3213 currentTag = SUMO_TAG_VEHICLE;
3214 {
3215 // set values of tag
3216 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_VEHICLE);
3217 // set values of attributes
3218 attrProperty = AttributeProperties(SUMO_ATTR_ID,
3219 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
3220 "The name of the vehicle");
3221 myTagProperties[currentTag].addAttribute(attrProperty);
3222
3223 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
3224 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE,
3225 "The id of the vehicle type to use for this vehicle",
3226 DEFAULT_VTYPE_ID);
3227 myTagProperties[currentTag].addAttribute(attrProperty);
3228
3229 attrProperty = AttributeProperties(SUMO_ATTR_ROUTE,
3230 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3231 "The id of the route the vehicle shall drive along");
3232 myTagProperties[currentTag].addAttribute(attrProperty);
3233
3234 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
3235 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE,
3236 "This vehicle's color",
3237 "yellow");
3238 myTagProperties[currentTag].addAttribute(attrProperty);
3239
3240 attrProperty = AttributeProperties(SUMO_ATTR_DEPART,
3241 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
3242 "The time step at which the vehicle shall enter the network",
3243 "0");
3244 myTagProperties[currentTag].addAttribute(attrProperty);
3245
3246 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTLANE,
3247 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3248 "The lane on which the vehicle shall be inserted",
3249 "first");
3250 myTagProperties[currentTag].addAttribute(attrProperty);
3251
3252 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS,
3253 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3254 "The position at which the vehicle shall enter the net",
3255 "base");
3256 myTagProperties[currentTag].addAttribute(attrProperty);
3257
3258 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTSPEED,
3259 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3260 "The speed with which the vehicle shall enter the network",
3261 "0");
3262 myTagProperties[currentTag].addAttribute(attrProperty);
3263
3264 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALLANE,
3265 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3266 "The lane at which the vehicle shall leave the network",
3267 "current");
3268 myTagProperties[currentTag].addAttribute(attrProperty);
3269
3270 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS,
3271 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3272 "The position at which the vehicle shall leave the network",
3273 "max");
3274 myTagProperties[currentTag].addAttribute(attrProperty);
3275
3276 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALSPEED,
3277 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3278 "The speed with which the vehicle shall leave the network",
3279 "current");
3280 myTagProperties[currentTag].addAttribute(attrProperty);
3281
3282 attrProperty = AttributeProperties(SUMO_ATTR_LINE,
3283 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3284 "A string specifying the id of a public transport line which can be used when specifying person rides");
3285 myTagProperties[currentTag].addAttribute(attrProperty);
3286
3287 attrProperty = AttributeProperties(SUMO_ATTR_PERSON_NUMBER,
3288 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3289 "The number of occupied seats when the vehicle is inserted",
3290 "0");
3291 myTagProperties[currentTag].addAttribute(attrProperty);
3292
3293 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_NUMBER,
3294 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3295 "The number of occupied container places when the vehicle is inserted",
3296 "0");
3297 myTagProperties[currentTag].addAttribute(attrProperty);
3298
3299 attrProperty = AttributeProperties(SUMO_ATTR_REROUTE,
3300 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3301 "Whether the vehicle should be equipped with a rerouting device",
3302 "0");
3303 myTagProperties[currentTag].addAttribute(attrProperty);
3304
3305 attrProperty = AttributeProperties(SUMO_ATTR_VIA,
3306 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3307 "List of intermediate edges that shall be passed on rerouting");
3308 myTagProperties[currentTag].addAttribute(attrProperty);
3309
3310 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS_LAT,
3311 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3312 "The lateral position on the departure lane at which the vehicle shall enter the net",
3313 "center");
3314 /*attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());*/
3315 myTagProperties[currentTag].addAttribute(attrProperty);
3316
3317 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS_LAT,
3318 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3319 "The lateral position on the arrival lane at which the vehicle shall arrive",
3320 "center");
3321 /*attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());*/
3322 myTagProperties[currentTag].addAttribute(attrProperty);
3323 }
3324 currentTag = SUMO_TAG_FLOW;
3325 {
3326 // set values of tag
3327 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_DISJOINTATTRIBUTES, ICON_FLOW);
3328 myTagProperties[currentTag].setDisjointAttributes({SUMO_ATTR_NUMBER, SUMO_ATTR_END, SUMO_ATTR_VEHSPERHOUR, SUMO_ATTR_PERIOD, SUMO_ATTR_PROB});
3329 // set values of attributes
3330 attrProperty = AttributeProperties(SUMO_ATTR_ID,
3331 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE,
3332 "The name of the vehicle");
3333 myTagProperties[currentTag].addAttribute(attrProperty);
3334
3335 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
3336 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_UPDATEGEOMETRY,
3337 "The id of the vehicle type to use for this vehicle",
3338 DEFAULT_VTYPE_ID);
3339 myTagProperties[currentTag].addAttribute(attrProperty);
3340
3341 attrProperty = AttributeProperties(SUMO_ATTR_ROUTE,
3342 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3343 "The id of the route the vehicle shall drive along");
3344 myTagProperties[currentTag].addAttribute(attrProperty);
3345
3346 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
3347 ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3348 "This vehicle's color",
3349 "yellow");
3350 myTagProperties[currentTag].addAttribute(attrProperty);
3351
3352 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTLANE,
3353 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3354 "The lane on which the vehicle shall be inserted",
3355 "first");
3356 myTagProperties[currentTag].addAttribute(attrProperty);
3357
3358 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS,
3359 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3360 "The position at which the vehicle shall enter the net",
3361 "base");
3362 myTagProperties[currentTag].addAttribute(attrProperty);
3363
3364 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTSPEED,
3365 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3366 "The speed with which the vehicle shall enter the network",
3367 "0");
3368 myTagProperties[currentTag].addAttribute(attrProperty);
3369
3370 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALLANE,
3371 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3372 "The lane at which the vehicle shall leave the network",
3373 "current");
3374 myTagProperties[currentTag].addAttribute(attrProperty);
3375
3376 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS,
3377 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3378 "The position at which the vehicle shall leave the network",
3379 "max");
3380 myTagProperties[currentTag].addAttribute(attrProperty);
3381
3382 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALSPEED,
3383 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3384 "The speed with which the vehicle shall leave the network",
3385 "current");
3386 myTagProperties[currentTag].addAttribute(attrProperty);
3387
3388 attrProperty = AttributeProperties(SUMO_ATTR_LINE,
3389 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3390 "A string specifying the id of a public transport line which can be used when specifying person rides");
3391 myTagProperties[currentTag].addAttribute(attrProperty);
3392
3393 attrProperty = AttributeProperties(SUMO_ATTR_PERSON_NUMBER,
3394 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3395 "The number of occupied seats when the vehicle is inserted",
3396 "0");
3397 myTagProperties[currentTag].addAttribute(attrProperty);
3398
3399 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_NUMBER,
3400 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3401 "The number of occupied container places when the vehicle is inserted",
3402 "0");
3403 myTagProperties[currentTag].addAttribute(attrProperty);
3404
3405 attrProperty = AttributeProperties(SUMO_ATTR_REROUTE,
3406 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3407 "Whether the vehicle should be equipped with a rerouting device",
3408 "0");
3409 myTagProperties[currentTag].addAttribute(attrProperty);
3410
3411 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS_LAT,
3412 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3413 "The lateral position on the departure lane at which the vehicle shall enter the net",
3414 "center");
3415 /*attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());*/
3416 myTagProperties[currentTag].addAttribute(attrProperty);
3417
3418 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS_LAT,
3419 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */,
3420 "The lateral position on the arrival lane at which the vehicle shall arrive",
3421 "center");
3422 /*attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings());*/
3423 myTagProperties[currentTag].addAttribute(attrProperty);
3424
3425 attrProperty = AttributeProperties(SUMO_ATTR_BEGIN,
3426 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
3427 "First vehicle departure time",
3428 "0.00");
3429 myTagProperties[currentTag].addAttribute(attrProperty);
3430
3431 attrProperty = AttributeProperties(SUMO_ATTR_END,
3432 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_TIME | ATTRPROPERTY_DEFAULTVALUE,
3433 "End of departure interval",
3434 "3600.00");
3435 myTagProperties[currentTag].addAttribute(attrProperty);
3436
3437 attrProperty = AttributeProperties(SUMO_ATTR_NUMBER,
3438 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3439 "probability for emitting a vehicle each second (not together with vehsPerHour or period)",
3440 "1800");
3441 myTagProperties[currentTag].addAttribute(attrProperty);
3442
3443 attrProperty = AttributeProperties(SUMO_ATTR_VEHSPERHOUR,
3444 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3445 "Number of vehicles per hour, equally spaced (not together with period or probability)",
3446 "1800");
3447 myTagProperties[currentTag].addAttribute(attrProperty);
3448
3449 attrProperty = AttributeProperties(SUMO_ATTR_PERIOD,
3450 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3451 "Insert equally spaced vehicles at that period (not together with vehsPerHour or probability)",
3452 "2");
3453 myTagProperties[currentTag].addAttribute(attrProperty);
3454
3455 attrProperty = AttributeProperties(SUMO_ATTR_PROB,
3456 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3457 "probability for emitting a vehicle each second (not together with vehsPerHour or period)",
3458 "0.5");
3459 myTagProperties[currentTag].addAttribute(attrProperty);
3460 }
3461 currentTag = SUMO_TAG_TRIP;
3462 {
3463 // set values of tag
3464 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_TRIP);
3465 // set values of attributes
3466 attrProperty = AttributeProperties(SUMO_ATTR_ID,
3467 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE,
3468 "The name of vehicles that will be generated using this trip definition");
3469 myTagProperties[currentTag].addAttribute(attrProperty);
3470
3471 attrProperty = AttributeProperties(SUMO_ATTR_TYPE,
3472 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE,
3473 "The id of the vehicle type to use for this vehicle",
3474 DEFAULT_VTYPE_ID);
3475 myTagProperties[currentTag].addAttribute(attrProperty);
3476
3477 attrProperty = AttributeProperties(SUMO_ATTR_DEPART,
3478 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
3479 "The departure time of the (first) vehicle which is generated using this trip definition",
3480 "0");
3481 myTagProperties[currentTag].addAttribute(attrProperty);
3482
3483 attrProperty = AttributeProperties(SUMO_ATTR_FROM,
3484 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3485 "The name of the edge the route starts at; the edge must be a part of the used network");
3486 myTagProperties[currentTag].addAttribute(attrProperty);
3487
3488 attrProperty = AttributeProperties(SUMO_ATTR_TO,
3489 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3490 "The name of the edge the route ends at; the edge must be a part of the used network");
3491 myTagProperties[currentTag].addAttribute(attrProperty);
3492
3493 attrProperty = AttributeProperties(SUMO_ATTR_VIA,
3494 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST,
3495 "List of intermediate edge ids which shall be part of the route; the edges must be a part of the used network");
3496 myTagProperties[currentTag].addAttribute(attrProperty);
3497
3498 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
3499 ATTRPROPERTY_COLOR | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_DEFAULTVALUE,
3500 "This generated vehicle's color",
3501 "yellow");
3502 myTagProperties[currentTag].addAttribute(attrProperty);
3503
3504 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTLANE,
3505 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3506 "The lane on which the vehicle shall be inserted",
3507 "first");
3508 myTagProperties[currentTag].addAttribute(attrProperty);
3509
3510 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS,
3511 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3512 "The position at which the vehicle shall enter the net",
3513 "base");
3514 myTagProperties[currentTag].addAttribute(attrProperty);
3515
3516 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTSPEED,
3517 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3518 "The speed with which the vehicle shall enter the network",
3519 "0");
3520 myTagProperties[currentTag].addAttribute(attrProperty);
3521
3522 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALLANE,
3523 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3524 "The lane at which the vehicle shall leave the network",
3525 "current");
3526 myTagProperties[currentTag].addAttribute(attrProperty);
3527
3528 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS,
3529 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3530 "The position at which the vehicle shall leave the network",
3531 "max");
3532 myTagProperties[currentTag].addAttribute(attrProperty);
3533
3534 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALSPEED,
3535 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3536 "The speed with which the vehicle shall leave the network",
3537 "current");
3538 myTagProperties[currentTag].addAttribute(attrProperty);
3539 }
3540 /* currently disabled. See #5259
3541 currentTag = SUMO_TAG_TRIP_TAZ;
3542 {
3543 // set values of tag
3544 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE, ICON_TRIP);
3545 // set values of attributes
3546 attrProperty = AttributeProperties(SUMO_ATTR_ID,
3547 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE,
3548 "The name of vehicles that will be generated using this trip definition");
3549 myTagProperties[currentTag].addAttribute(attrProperty);
3550
3551 attrProperty = AttributeProperties(SUMO_ATTR_DEPART,
3552 ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE,
3553 "The departure time of the (first) vehicle which is generated using this trip definition",
3554 "0");
3555 myTagProperties[currentTag].addAttribute(attrProperty);
3556
3557 attrProperty = AttributeProperties(SUMO_ATTR_FROM_TAZ,
3558 ATTRPROPERTY_STRING,
3559 "The name of the district the route starts at. TAZ edges are selected so that travel time is minimized");
3560 myTagProperties[currentTag].addAttribute(attrProperty);
3561
3562 attrProperty = AttributeProperties(SUMO_ATTR_TO_TAZ,
3563 ATTRPROPERTY_STRING,
3564 "The name of the district the route ends at. TAZ edges are selected so that travel time is minimized");
3565 myTagProperties[currentTag].addAttribute(attrProperty);
3566
3567 attrProperty = AttributeProperties(SUMO_ATTR_COLOR,
3568 ATTRPROPERTY_COLOR | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_DEFAULTVALUE,
3569 "This generated vehicle's color",
3570 "yellow");
3571 myTagProperties[currentTag].addAttribute(attrProperty);
3572
3573 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTLANE,
3574 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3575 "The lane on which the vehicle shall be inserted",
3576 "first");
3577 myTagProperties[currentTag].addAttribute(attrProperty);
3578
3579 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS,
3580 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3581 "The position at which the vehicle shall enter the net",
3582 "base");
3583 myTagProperties[currentTag].addAttribute(attrProperty);
3584
3585 attrProperty = AttributeProperties(SUMO_ATTR_DEPARTSPEED,
3586 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3587 "The speed with which the vehicle shall enter the network",
3588 "0");
3589 myTagProperties[currentTag].addAttribute(attrProperty);
3590
3591 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALLANE,
3592 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3593 "The lane at which the vehicle shall leave the network",
3594 "current");
3595 myTagProperties[currentTag].addAttribute(attrProperty);
3596
3597 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS,
3598 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3599 "The position at which the vehicle shall leave the network",
3600 "max");
3601 myTagProperties[currentTag].addAttribute(attrProperty);
3602
3603 attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALSPEED,
3604 ATTRPROPERTY_STRING | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3605 "The speed with which the vehicle shall leave the network",
3606 "current");
3607 myTagProperties[currentTag].addAttribute(attrProperty);
3608 }
3609 */
3610 currentTag = SUMO_TAG_STOP_LANE;
3611 {
3612 // set values of tag
3613 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_MASKSTARTENDPOS, ICON_STOPELEMENT);
3614 // set values of attributes
3615 attrProperty = AttributeProperties(SUMO_ATTR_LANE,
3616 ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3617 "The name of the lane the stop shall be located at");
3618 myTagProperties[currentTag].addAttribute(attrProperty);
3619
3620 attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS,
3621 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
3622 "The begin position on the lane (the lower position on the lane) in meters");
3623 myTagProperties[currentTag].addAttribute(attrProperty);
3624
3625 attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS,
3626 ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY,
3627 "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m");
3628 myTagProperties[currentTag].addAttribute(attrProperty);
3629
3630 attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS,
3631 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3632 "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",
3633 "0");
3634 myTagProperties[currentTag].addAttribute(attrProperty);
3635
3636 attrProperty = AttributeProperties(SUMO_ATTR_DURATION,
3637 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3638 "Minimum duration for stopping",
3639 "0");
3640 myTagProperties[currentTag].addAttribute(attrProperty);
3641
3642 attrProperty = AttributeProperties(SUMO_ATTR_UNTIL,
3643 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3644 "The time step at which the route continues",
3645 "0");
3646 myTagProperties[currentTag].addAttribute(attrProperty);
3647
3648 attrProperty = AttributeProperties(SUMO_ATTR_INDEX,
3649 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3650 "Where to insert the stop in the vehicle's list of stops",
3651 "end");
3652 myTagProperties[currentTag].addAttribute(attrProperty);
3653
3654 attrProperty = AttributeProperties(SUMO_ATTR_TRIGGERED,
3655 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3656 "Whether a person may end the stop",
3657 "false");
3658 myTagProperties[currentTag].addAttribute(attrProperty);
3659
3660 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED,
3661 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3662 "List of persons that must board the vehicle before it may continue");
3663 myTagProperties[currentTag].addAttribute(attrProperty);
3664
3665 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED,
3666 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3667 "Whether a container may end the stop",
3668 "false");
3669 myTagProperties[currentTag].addAttribute(attrProperty);
3670
3671 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS,
3672 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3673 "List of containers that must be loaded onto the vehicle before it may continue");
3674 myTagProperties[currentTag].addAttribute(attrProperty);
3675
3676 attrProperty = AttributeProperties(SUMO_ATTR_PARKING,
3677 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3678 "whether the vehicle stops on the road or beside ",
3679 "false");
3680 myTagProperties[currentTag].addAttribute(attrProperty);
3681
3682 attrProperty = AttributeProperties(SUMO_ATTR_ACTTYPE,
3683 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3684 "Activity displayed for stopped person in GUI and output files ",
3685 "waiting");
3686 myTagProperties[currentTag].addAttribute(attrProperty);
3687
3688 attrProperty = AttributeProperties(SUMO_ATTR_TRIP_ID,
3689 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3690 "Value used for trips that uses this stop");
3691 myTagProperties[currentTag].addAttribute(attrProperty);
3692 }
3693 currentTag = SUMO_TAG_STOP_BUSSTOP;
3694 {
3695 // set values of tag
3696 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_STOPELEMENT);
3697 // set values of attributes
3698 attrProperty = AttributeProperties(SUMO_ATTR_BUS_STOP,
3699 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3700 "BusStop associated with this stop");
3701 myTagProperties[currentTag].addAttribute(attrProperty);
3702
3703 attrProperty = AttributeProperties(SUMO_ATTR_DURATION,
3704 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3705 "Minimum duration for stopping",
3706 "0");
3707 myTagProperties[currentTag].addAttribute(attrProperty);
3708
3709 attrProperty = AttributeProperties(SUMO_ATTR_UNTIL,
3710 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3711 "The time step at which the route continues",
3712 "0");
3713 myTagProperties[currentTag].addAttribute(attrProperty);
3714
3715 attrProperty = AttributeProperties(SUMO_ATTR_INDEX,
3716 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3717 "Where to insert the stop in the vehicle's list of stops",
3718 "end");
3719 myTagProperties[currentTag].addAttribute(attrProperty);
3720
3721 attrProperty = AttributeProperties(SUMO_ATTR_TRIGGERED,
3722 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3723 "Whether a person may end the stop",
3724 "false");
3725 myTagProperties[currentTag].addAttribute(attrProperty);
3726
3727 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED,
3728 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3729 "List of persons that must board the vehicle before it may continue");
3730 myTagProperties[currentTag].addAttribute(attrProperty);
3731
3732 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED,
3733 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3734 "Whether a container may end the stop",
3735 "false");
3736 myTagProperties[currentTag].addAttribute(attrProperty);
3737
3738 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS,
3739 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3740 "List of containers that must be loaded onto the vehicle before it may continue");
3741 myTagProperties[currentTag].addAttribute(attrProperty);
3742
3743 attrProperty = AttributeProperties(SUMO_ATTR_PARKING,
3744 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3745 "whether the vehicle stops on the road or beside ",
3746 "false");
3747 myTagProperties[currentTag].addAttribute(attrProperty);
3748
3749 attrProperty = AttributeProperties(SUMO_ATTR_ACTTYPE,
3750 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3751 "Activity displayed for stopped person in GUI and output files ",
3752 "waiting");
3753 myTagProperties[currentTag].addAttribute(attrProperty);
3754
3755 attrProperty = AttributeProperties(SUMO_ATTR_TRIP_ID,
3756 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3757 "Value used for trips that uses this stop");
3758 myTagProperties[currentTag].addAttribute(attrProperty);
3759 }
3760 currentTag = SUMO_TAG_STOP_CONTAINERSTOP;
3761 {
3762 // set values of tag
3763 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_STOPELEMENT);
3764 // set values of attributes
3765 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_STOP,
3766 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3767 "ContainerStop associated with this stop");
3768 myTagProperties[currentTag].addAttribute(attrProperty);
3769
3770 attrProperty = AttributeProperties(SUMO_ATTR_DURATION,
3771 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3772 "Minimum duration for stopping",
3773 "0");
3774 myTagProperties[currentTag].addAttribute(attrProperty);
3775
3776 attrProperty = AttributeProperties(SUMO_ATTR_UNTIL,
3777 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3778 "The time step at which the route continues",
3779 "0");
3780 myTagProperties[currentTag].addAttribute(attrProperty);
3781
3782 attrProperty = AttributeProperties(SUMO_ATTR_INDEX,
3783 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3784 "Where to insert the stop in the vehicle's list of stops",
3785 "end");
3786 myTagProperties[currentTag].addAttribute(attrProperty);
3787
3788 attrProperty = AttributeProperties(SUMO_ATTR_TRIGGERED,
3789 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3790 "Whether a person may end the stop",
3791 "false");
3792 myTagProperties[currentTag].addAttribute(attrProperty);
3793
3794 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED,
3795 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3796 "List of persons that must board the vehicle before it may continue");
3797 myTagProperties[currentTag].addAttribute(attrProperty);
3798
3799 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED,
3800 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3801 "Whether a container may end the stop",
3802 "false");
3803 myTagProperties[currentTag].addAttribute(attrProperty);
3804
3805 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS,
3806 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3807 "List of containers that must be loaded onto the vehicle before it may continue");
3808 myTagProperties[currentTag].addAttribute(attrProperty);
3809
3810 attrProperty = AttributeProperties(SUMO_ATTR_PARKING,
3811 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3812 "whether the vehicle stops on the road or beside ",
3813 "false");
3814 myTagProperties[currentTag].addAttribute(attrProperty);
3815
3816 attrProperty = AttributeProperties(SUMO_ATTR_ACTTYPE,
3817 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3818 "Activity displayed for stopped person in GUI and output files ",
3819 "waiting");
3820 myTagProperties[currentTag].addAttribute(attrProperty);
3821
3822 attrProperty = AttributeProperties(SUMO_ATTR_TRIP_ID,
3823 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3824 "Value used for trips that uses this stop");
3825 myTagProperties[currentTag].addAttribute(attrProperty);
3826 }
3827 currentTag = SUMO_TAG_STOP_CHARGINGSTATION;
3828 {
3829 // set values of tag
3830 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_STOPELEMENT);
3831 // set values of attributes
3832 attrProperty = AttributeProperties(SUMO_ATTR_CHARGING_STATION,
3833 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3834 "ChargingStation associated with this stop");
3835 myTagProperties[currentTag].addAttribute(attrProperty);
3836
3837 attrProperty = AttributeProperties(SUMO_ATTR_DURATION,
3838 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3839 "Minimum duration for stopping",
3840 "0");
3841 myTagProperties[currentTag].addAttribute(attrProperty);
3842
3843 attrProperty = AttributeProperties(SUMO_ATTR_UNTIL,
3844 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3845 "The time step at which the route continues",
3846 "0");
3847 myTagProperties[currentTag].addAttribute(attrProperty);
3848
3849 attrProperty = AttributeProperties(SUMO_ATTR_INDEX,
3850 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3851 "Where to insert the stop in the vehicle's list of stops",
3852 "end");
3853 myTagProperties[currentTag].addAttribute(attrProperty);
3854
3855 attrProperty = AttributeProperties(SUMO_ATTR_TRIGGERED,
3856 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3857 "Whether a person may end the stop",
3858 "false");
3859 myTagProperties[currentTag].addAttribute(attrProperty);
3860
3861 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED,
3862 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3863 "List of persons that must board the vehicle before it may continue");
3864 myTagProperties[currentTag].addAttribute(attrProperty);
3865
3866 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED,
3867 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3868 "Whether a container may end the stop",
3869 "false");
3870 myTagProperties[currentTag].addAttribute(attrProperty);
3871
3872 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS,
3873 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3874 "List of containers that must be loaded onto the vehicle before it may continue");
3875 myTagProperties[currentTag].addAttribute(attrProperty);
3876
3877 attrProperty = AttributeProperties(SUMO_ATTR_PARKING,
3878 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3879 "whether the vehicle stops on the road or beside ",
3880 "false");
3881 myTagProperties[currentTag].addAttribute(attrProperty);
3882
3883 attrProperty = AttributeProperties(SUMO_ATTR_ACTTYPE,
3884 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3885 "Activity displayed for stopped person in GUI and output files ",
3886 "waiting");
3887 myTagProperties[currentTag].addAttribute(attrProperty);
3888
3889 attrProperty = AttributeProperties(SUMO_ATTR_TRIP_ID,
3890 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3891 "Value used for trips that uses this stop");
3892 myTagProperties[currentTag].addAttribute(attrProperty);
3893 }
3894 currentTag = SUMO_TAG_STOP_PARKINGAREA;
3895 {
3896 // set values of tag
3897 myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_STOPELEMENT);
3898 // set values of attributes
3899 attrProperty = AttributeProperties(SUMO_ATTR_PARKING_AREA,
3900 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY,
3901 "ParkingArea associated with this stop");
3902 myTagProperties[currentTag].addAttribute(attrProperty);
3903
3904 attrProperty = AttributeProperties(SUMO_ATTR_DURATION,
3905 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3906 "Minimum duration for stopping",
3907 "0");
3908 myTagProperties[currentTag].addAttribute(attrProperty);
3909
3910 attrProperty = AttributeProperties(SUMO_ATTR_UNTIL,
3911 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE,
3912 "The time step at which the route continues",
3913 "0");
3914 myTagProperties[currentTag].addAttribute(attrProperty);
3915
3916 attrProperty = AttributeProperties(SUMO_ATTR_INDEX,
3917 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3918 "Where to insert the stop in the vehicle's list of stops",
3919 "end");
3920 myTagProperties[currentTag].addAttribute(attrProperty);
3921
3922 attrProperty = AttributeProperties(SUMO_ATTR_TRIGGERED,
3923 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3924 "Whether a person may end the stop",
3925 "false");
3926 myTagProperties[currentTag].addAttribute(attrProperty);
3927
3928 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED,
3929 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3930 "List of persons that must board the vehicle before it may continue");
3931 myTagProperties[currentTag].addAttribute(attrProperty);
3932
3933 attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED,
3934 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3935 "Whether a container may end the stop",
3936 "false");
3937 myTagProperties[currentTag].addAttribute(attrProperty);
3938
3939 attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS,
3940 ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3941 "List of containers that must be loaded onto the vehicle before it may continue");
3942 myTagProperties[currentTag].addAttribute(attrProperty);
3943
3944 attrProperty = AttributeProperties(SUMO_ATTR_PARKING,
3945 ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3946 "whether the vehicle stops on the road or beside ",
3947 "false");
3948 myTagProperties[currentTag].addAttribute(attrProperty);
3949
3950 attrProperty = AttributeProperties(SUMO_ATTR_ACTTYPE,
3951 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3952 "Activity displayed for stopped person in GUI and output files ",
3953 "waiting");
3954 myTagProperties[currentTag].addAttribute(attrProperty);
3955
3956 attrProperty = AttributeProperties(SUMO_ATTR_TRIP_ID,
3957 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3958 "Value used for trips that uses this stop");
3959 myTagProperties[currentTag].addAttribute(attrProperty);
3960 }
3961 }
3962
3963
3964 void
fillCarFollowingModelAttributes()3965 GNEAttributeCarrier::fillCarFollowingModelAttributes() {
3966 // declare empty AttributeProperties
3967 AttributeProperties attrProperty;
3968 attrProperty = AttributeProperties(SUMO_ATTR_ACCEL,
3969 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3970 "The acceleration ability of vehicles of this type [m/s^2]",
3971 "2.60");
3972 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
3973
3974 attrProperty = AttributeProperties(SUMO_ATTR_DECEL,
3975 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3976 "The deceleration ability of vehicles of this type [m/s^2]",
3977 "4.50");
3978 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
3979
3980 attrProperty = AttributeProperties(SUMO_ATTR_APPARENTDECEL,
3981 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3982 "The apparent deceleration of the vehicle as used by the standard model [m/s^2]",
3983 "4.50");
3984 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
3985
3986 attrProperty = AttributeProperties(SUMO_ATTR_EMERGENCYDECEL,
3987 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
3988 "The maximal physically possible deceleration for the vehicle [m/s^2]",
3989 "4.50");
3990 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
3991
3992 attrProperty = AttributeProperties(SUMO_ATTR_SIGMA,
3993 ATTRPROPERTY_FLOAT | ATTRPROPERTY_RANGE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
3994 "Car-following model parameter",
3995 "0.50");
3996 attrProperty.setRange(0, 1);
3997 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
3998
3999 attrProperty = AttributeProperties(SUMO_ATTR_TAU,
4000 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL,
4001 "Car-following model parameter",
4002 "1.00");
4003 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4004
4005 attrProperty = AttributeProperties(SUMO_ATTR_TMP1,
4006 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4007 "SKRAUSSX parameter 1",
4008 "");
4009 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4010
4011 attrProperty = AttributeProperties(SUMO_ATTR_TMP2,
4012 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4013 "SKRAUSSX parameter 2",
4014 "");
4015 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4016
4017 attrProperty = AttributeProperties(SUMO_ATTR_TMP3,
4018 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4019 "SKRAUSSX parameter 3",
4020 "");
4021 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4022
4023 attrProperty = AttributeProperties(SUMO_ATTR_TMP4,
4024 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4025 "SKRAUSSX parameter 4",
4026 "");
4027 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4028
4029 attrProperty = AttributeProperties(SUMO_ATTR_TMP5,
4030 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4031 "SKRAUSSX parameter 5",
4032 "");
4033 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4034
4035 attrProperty = AttributeProperties(SUMO_ATTR_CF_PWAGNER2009_TAULAST,
4036 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4037 "Peter Wagner 2009 parameter",
4038 "");
4039 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4040
4041 attrProperty = AttributeProperties(SUMO_ATTR_CF_PWAGNER2009_APPROB,
4042 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4043 "Peter Wagner 2009 parameter",
4044 "");
4045 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4046
4047 attrProperty = AttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR,
4048 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4049 "IDMM parameter",
4050 "");
4051 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4052
4053 attrProperty = AttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_TIME,
4054 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4055 "IDMM parameter",
4056 "");
4057 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4058
4059 attrProperty = AttributeProperties(SUMO_ATTR_CF_WIEDEMANN_SECURITY,
4060 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4061 "Wiedemann parameter",
4062 "");
4063 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4064
4065 attrProperty = AttributeProperties(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION,
4066 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4067 "Wiedemann parameter",
4068 "");
4069 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4070
4071 attrProperty = AttributeProperties(SUMO_ATTR_COLLISION_MINGAP_FACTOR,
4072 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4073 "MinGap factor parameter",
4074 "");
4075 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4076
4077 attrProperty = AttributeProperties(SUMO_ATTR_K,
4078 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4079 "K parameter",
4080 "");
4081 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4082
4083
4084 attrProperty = AttributeProperties(SUMO_ATTR_CF_KERNER_PHI,
4085 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4086 "Kerner Phi parameter",
4087 "");
4088 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4089
4090 attrProperty = AttributeProperties(SUMO_ATTR_CF_IDM_DELTA,
4091 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4092 "IDM Delta parameter",
4093 "");
4094 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4095
4096 attrProperty = AttributeProperties(SUMO_ATTR_CF_IDM_STEPPING,
4097 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4098 "IDM Stepping parameter",
4099 "");
4100 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4101
4102 attrProperty = AttributeProperties(SUMO_ATTR_TRAIN_TYPE,
4103 ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4104 "Train Types",
4105 "NGT400");
4106 attrProperty.setDiscreteValues(SUMOXMLDefinitions::TrainTypes.getStrings());
4107 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4108 }
4109
4110
4111 void
fillJunctionModelAttributes()4112 GNEAttributeCarrier::fillJunctionModelAttributes() {
4113 // declare empty AttributeProperties
4114 AttributeProperties attrProperty;
4115 attrProperty = AttributeProperties(SUMO_ATTR_JM_CROSSING_GAP,
4116 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4117 "Minimum distance to pedestrians that are walking towards the conflict point with the ego vehicle.",
4118 "10");
4119 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4120
4121 attrProperty = AttributeProperties(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME,
4122 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4123 "The accumulated waiting time after which a vehicle will drive onto an intersection even though this might cause jamming.",
4124 "-1");
4125 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4126
4127 attrProperty = AttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME,
4128 ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4129 "This value causes vehicles to violate a red light if the duration of the red phase is lower than the given threshold.",
4130 "-1");
4131 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4132
4133 attrProperty = AttributeProperties(SUMO_ATTR_JM_DRIVE_RED_SPEED,
4134 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4135 "This value causes vehicles affected by jmDriveAfterRedTime to slow down when violating a red light.",
4136 "maxSpeed");
4137 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4138
4139 attrProperty = AttributeProperties(SUMO_ATTR_JM_IGNORE_FOE_PROB,
4140 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4141 "This value causes vehicles to ignore foe vehicles that have right-of-way with the given probability.",
4142 "0");
4143 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4144
4145 attrProperty = AttributeProperties(SUMO_ATTR_JM_IGNORE_FOE_SPEED,
4146 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4147 "This value is used in conjunction with jmIgnoreFoeProb. Only vehicles with a speed below or equal to the given value may be ignored.",
4148 "0");
4149 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4150
4151 attrProperty = AttributeProperties(SUMO_ATTR_JM_SIGMA_MINOR,
4152 ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4153 "This value configures driving imperfection (dawdling) while passing a minor link.",
4154 "sigma");
4155 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4156
4157 attrProperty = AttributeProperties(SUMO_ATTR_JM_TIMEGAP_MINOR,
4158 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4159 "This value defines the minimum time gap when passing ahead of a prioritized vehicle. ",
4160 "1");
4161 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4162
4163 attrProperty = AttributeProperties(SUMO_ATTR_IMPATIENCE,
4164 ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED,
4165 "Willingess of drivers to impede vehicles with higher priority",
4166 "0.00");
4167 myTagProperties[SUMO_TAG_VTYPE].addAttribute(attrProperty);
4168 }
4169
4170
4171 bool
checkParsedAttribute(const TagProperties & tagProperties,const AttributeProperties & attrProperties,const SumoXMLAttr attribute,std::string & defaultValue,std::string & parsedAttribute,std::string & warningMessage)4172 GNEAttributeCarrier::checkParsedAttribute(const TagProperties& tagProperties,
4173 const AttributeProperties& attrProperties, const SumoXMLAttr attribute,
4174 std::string& defaultValue, std::string& parsedAttribute, std::string& warningMessage) {
4175 // declare a string for details about error formats
4176 std::string errorFormat;
4177 // set extra check for ID Values
4178 if (attribute == SUMO_ATTR_ID) {
4179 if (parsedAttribute.empty()) {
4180 errorFormat = "ID cannot be empty; ";
4181 } else if (tagProperties.isDetector()) {
4182 // special case for detectors (because in this case empty spaces are allowed)
4183 if (SUMOXMLDefinitions::isValidDetectorID(parsedAttribute) == false) {
4184 errorFormat = "Detector ID contains invalid characters; ";
4185 }
4186 } else if (tagProperties.isDemandElement()) {
4187 // special case for detectors (because in this case empty spaces are allowed)
4188 if (SUMOXMLDefinitions::isValidVehicleID(parsedAttribute) == false) {
4189 errorFormat = "Demand Element ID contains invalid characters; ";
4190 }
4191 } else if (SUMOXMLDefinitions::isValidNetID(parsedAttribute) == false) {
4192 errorFormat = "ID contains invalid characters; ";
4193 }
4194 }
4195 // Set extra checks for int values
4196 if (attrProperties.isInt()) {
4197 if (canParse<int>(parsedAttribute)) {
4198 // obtain int value
4199 int parsedIntAttribute = parse<int>(parsedAttribute);
4200 // check if attribute can be negative or zero
4201 if (attrProperties.isPositive() && (parsedIntAttribute < 0)) {
4202 errorFormat = "Cannot be negative; ";
4203 } else if (attrProperties.cannotBeZero() && (parsedIntAttribute == 0)) {
4204 errorFormat = "Cannot be zero; ";
4205 }
4206 } else if (canParse<double>(parsedAttribute)) {
4207 errorFormat = "Float cannot be reinterpreted as int; ";
4208 } else {
4209 errorFormat = "Cannot be parsed to int; ";
4210 }
4211 }
4212 // Set extra checks for float(double) values
4213 if (attrProperties.isFloat()) {
4214 if (canParse<double>(parsedAttribute)) {
4215 // obtain double value
4216 double parsedDoubleAttribute = parse<double>(parsedAttribute);
4217 //check if can be negative and Zero
4218 if (attrProperties.isPositive() && (parsedDoubleAttribute < 0)) {
4219 errorFormat = "Cannot be negative; ";
4220 } else if (attrProperties.cannotBeZero() && (parsedDoubleAttribute == 0)) {
4221 errorFormat = "Cannot be zero; ";
4222 }
4223 } else {
4224 errorFormat = "Cannot be parsed to float; ";
4225 }
4226 }
4227 // Set extra checks for bool values
4228 if (attrProperties.isBool()) {
4229 if (!canParse<bool>(parsedAttribute)) {
4230 errorFormat = "Cannot be parsed to boolean; ";
4231 }
4232 }
4233 // Set extra checks for position values
4234 if (attrProperties.isposition()) {
4235 // check if we're parsing a single position or an entire shape
4236 if (attrProperties.isList()) {
4237 // check if parsed attribute can be parsed to Position Vector
4238 if (!canParse<PositionVector>(parsedAttribute)) {
4239 errorFormat = "List of Positions aren't neither x,y nor x,y,z; ";
4240 }
4241 } else if (!canParse<Position>(parsedAttribute)) {
4242 errorFormat = "Position is neither x,y nor x,y,z; ";
4243 }
4244 }
4245 // set extra check for time(double) values
4246 if (attrProperties.isTime()) {
4247 if (canParse<double>(parsedAttribute)) {
4248 // parse to SUMO Real and check if is negative
4249 if (parse<double>(parsedAttribute) < 0) {
4250 errorFormat = "Time cannot be negative; ";
4251 }
4252 } else {
4253 errorFormat = "Cannot be parsed to time; ";
4254 }
4255 }
4256 // set extra check for probability values
4257 if (attrProperties.isProbability()) {
4258 if (canParse<double>(parsedAttribute)) {
4259 // parse to double and check if is between [0,1]
4260 double probability = parse<double>(parsedAttribute);
4261 if (probability < 0) {
4262 errorFormat = "Probability cannot be smaller than 0; ";
4263 } else if (probability > 1) {
4264 errorFormat = "Probability cannot be greather than 1; ";
4265 }
4266 } else {
4267 errorFormat = "Cannot be parsed to probability; ";
4268 }
4269 }
4270 // set extra check for range values
4271 if (attrProperties.hasAttrRange()) {
4272 if (canParse<double>(parsedAttribute)) {
4273 // parse to double and check if is in range
4274 double range = parse<double>(parsedAttribute);
4275 if (range < attrProperties.getMinimumRange()) {
4276 errorFormat = "Float cannot be smaller than " + toString(attrProperties.getMinimumRange()) + "; ";
4277 } else if (range > attrProperties.getMaximumRange()) {
4278 errorFormat = "Float cannot be greather than " + toString(attrProperties.getMaximumRange()) + "; ";
4279 }
4280 } else {
4281 errorFormat = "Cannot be parsed to float; ";
4282 }
4283 }
4284 // set extra check for discrete values
4285 if (attrProperties.isDiscrete()) {
4286 // search value in the list of discretes values of attribute properties
4287 auto finder = std::find(attrProperties.getDiscreteValues().begin(), attrProperties.getDiscreteValues().end(), parsedAttribute);
4288 // check if attribute is valid
4289 if (finder == attrProperties.getDiscreteValues().end()) {
4290 errorFormat = "value is not within the set of allowed values for attribute '" + toString(attribute) + "'";
4291 }
4292 }
4293 // set extra check for color values
4294 if (attrProperties.isColor() && !canParse<RGBColor>(parsedAttribute)) {
4295 errorFormat = "Invalid RGB format or named color; ";
4296 }
4297 // set extra check for filename values
4298 if (attrProperties.isFilename()) {
4299 if (SUMOXMLDefinitions::isValidFilename(parsedAttribute) == false) {
4300 errorFormat = "Filename contains invalid characters; ";
4301 } else if (parsedAttribute.empty() && !attrProperties.isOptional()) {
4302 errorFormat = "Filename cannot be empty; ";
4303 }
4304 }
4305 // set extra check for name values
4306 if ((attribute == SUMO_ATTR_NAME) && !SUMOXMLDefinitions::isValidAttribute(parsedAttribute)) {
4307 errorFormat = "name contains invalid characters; ";
4308 }
4309 // set extra check for SVCPermissions values
4310 if (attrProperties.isVClass()) {
4311 if (!canParseVehicleClasses(parsedAttribute)) {
4312 errorFormat = "List of VClasses isn't valid; ";
4313 parsedAttribute = defaultValue;
4314 }
4315 }
4316 // set extra check for RouteProbes
4317 if ((attribute == SUMO_ATTR_ROUTEPROBE) && !SUMOXMLDefinitions::isValidNetID(parsedAttribute)) {
4318 errorFormat = "RouteProbe ID contains invalid characters; ";
4319 }
4320 // set extra check for list of edges
4321 if ((attribute == SUMO_ATTR_EDGES) && parsedAttribute.empty()) {
4322 errorFormat = "List of edges cannot be empty; ";
4323 }
4324 // set extra check for list of lanes
4325 if ((attribute == SUMO_ATTR_LANES) && parsedAttribute.empty()) {
4326 errorFormat = "List of lanes cannot be empty; ";
4327 }
4328 // set extra check for list of VTypes
4329 if ((attribute == SUMO_ATTR_VTYPES) && !parsedAttribute.empty() && !SUMOXMLDefinitions::isValidListOfTypeID(parsedAttribute)) {
4330 errorFormat = "List of vTypes contains invalid characters; ";
4331 }
4332 // set extra check for list of RouteProbe
4333 if ((attribute == SUMO_ATTR_ROUTEPROBE) && !parsedAttribute.empty() && !SUMOXMLDefinitions::isValidNetID(parsedAttribute)) {
4334 errorFormat = "RouteProbe ID contains invalid characters; ";
4335 }
4336 // If attribute has an invalid format
4337 if (errorFormat.size() > 0) {
4338 // if attribute is optional and has a default value, obtain it as string. In other case, abort.
4339 if (attrProperties.isOptional() && attrProperties.hasDefaultValue()) {
4340 WRITE_DEBUG("Format of optional " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " +
4341 warningMessage + " is invalid; " + errorFormat + "Default value will be used.");
4342 // set default value defined in AttrProperties
4343 parsedAttribute = attrProperties.getDefaultValue();
4344 } else {
4345 WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " +
4346 warningMessage + " is invalid; " + errorFormat + tagProperties.getTagStr() + " cannot be created");
4347 // set default value (To avoid errors in parse<T>(parsedAttribute))
4348 parsedAttribute = defaultValue;
4349 // return false to abort creation of element
4350 return false;
4351 }
4352 }
4353 // return true to continue creation of element
4354 return true;
4355 }
4356
4357
4358 bool
parseMaskedPositionAttribute(const SUMOSAXAttributes & attrs,const std::string & objectID,const TagProperties & tagProperties,const AttributeProperties & attrProperties,std::string & parsedAttribute,std::string & warningMessage)4359 GNEAttributeCarrier::parseMaskedPositionAttribute(const SUMOSAXAttributes& attrs, const std::string& objectID, const TagProperties& tagProperties,
4360 const AttributeProperties& attrProperties, std::string& parsedAttribute, std::string& warningMessage) {
4361 // if element can mask their XYPosition, then must be extracted X Y coordiantes separeted
4362 std::string x, y, z;
4363 bool parsedOk = true;
4364 // give a default value to parsedAttribute to avoid problem parsing invalid positions
4365 parsedAttribute = "0,0";
4366 if (attrs.hasAttribute(SUMO_ATTR_X)) {
4367 x = attrs.get<std::string>(SUMO_ATTR_X, objectID.c_str(), parsedOk, false);
4368 // check that X attribute is valid
4369 if (!canParse<double>(x)) {
4370 WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_X) + "' of " +
4371 warningMessage + " is invalid; Cannot be parsed to float; " + tagProperties.getTagStr() + " cannot be created");
4372 // abort parsing (and creation) of element
4373 return false;
4374 }
4375 } else {
4376 WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_X) + "' of " +
4377 warningMessage + " is missing; " + tagProperties.getTagStr() + " cannot be created");
4378 // abort parsing (and creation) of element
4379 return false;
4380 }
4381 if (attrs.hasAttribute(SUMO_ATTR_Y)) {
4382 y = attrs.get<std::string>(SUMO_ATTR_Y, objectID.c_str(), parsedOk, false);
4383 // check that X attribute is valid
4384 if (!canParse<double>(y)) {
4385 WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Y) + "' of " +
4386 warningMessage + " is invalid; Cannot be parsed to float; " + tagProperties.getTagStr() + " cannot be created");
4387 // abort parsing (and creation) of element
4388 return false;
4389 }
4390 } else {
4391 WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Y) + "' of " +
4392 warningMessage + " is missing; " + tagProperties.getTagStr() + " cannot be created");
4393 // abort parsing (and creation) of element
4394 return false;
4395 }
4396 // Z attribute is optional
4397 if (attrs.hasAttribute(SUMO_ATTR_Z)) {
4398 z = attrs.get<std::string>(SUMO_ATTR_Z, objectID.c_str(), parsedOk, false);
4399 // check that Z attribute is valid
4400 if (!canParse<double>(z)) {
4401 WRITE_WARNING("Format of optional " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Z) + "' of " +
4402 warningMessage + " is invalid; Cannot be parsed to float; " + tagProperties.getTagStr() + " cannot be created");
4403 // leave Z attribute empty
4404 z.clear();
4405 }
4406 }
4407 // create Position attribute using parsed coordinates X, Y and, optionally, Z
4408 if (z.empty()) {
4409 parsedAttribute = x + "," + y;
4410 } else {
4411 parsedAttribute = x + "," + y + "," + z;
4412 }
4413 // continue creation of element
4414 return true;
4415 }
4416 /****************************************************************************/
4417