Eclipse SUMO - Simulation of Urban MObility
SUMOVTypeParameter.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// Structure representing possible vehicle parameter
21/****************************************************************************/
22#include <config.h>
23
24#include <algorithm>
33
34#define EMPREFIX std::string("HBEFA3/")
35#define TTT_UNSET SUMOTime_MIN
36
37// ===========================================================================
38// member method definitions
39// ===========================================================================
40
42 length(getDefaultVehicleLength(vclass)),
43 minGap(2.5),
44 maxSpeed(200. / 3.6),
45 desiredMaxSpeed(10000 / 3.6), // backward-compatibility: do not influence speeds by default
46 width(1.8),
47 height(1.5),
49 emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)),
50 mass(1500.),
51 speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
52 personCapacity(4),
53 containerCapacity(0),
54 osgFile("car-normal-citrus.obj"),
55 carriageLength(-1),
56 locomotiveLength(-1),
57 latAlignmentProcedure(LatAlignmentDefinition::CENTER) {
58 // update default values
59 switch (vclass) {
60 case SVC_PEDESTRIAN:
61 minGap = 0.25;
62 maxSpeed = 37.58 / 3.6; // Usain Bolt
64 width = 0.478;
65 height = 1.719;
68 mass = 70.; // https://en.wikipedia.org/wiki/Human_body_weight for Europe
69 speedFactor.getParameter()[1] = 0.1;
70 break;
71 case SVC_BICYCLE:
72 minGap = 0.5;
73 maxSpeed = 50. / 3.6;
74 desiredMaxSpeed = 20 / 3.6;
75 width = 0.65;
76 height = 1.7;
80 mass = 10.;
81 speedFactor.getParameter()[1] = 0.1;
83 break;
84 case SVC_MOPED:
85 maxSpeed = 60. / 3.6;
86 width = 0.78;
87 height = 1.7;
91 mass = 80.;
92 speedFactor.getParameter()[1] = 0.1;
93 break;
94 case SVC_MOTORCYCLE:
95 width = 0.9;
96 height = 1.5;
100 mass = 200.;
101 speedFactor.getParameter()[1] = 0.1;
102 break;
103 case SVC_TRUCK:
104 maxSpeed = 130. / 3.6;
105 width = 2.4;
106 height = 2.4;
108 osgFile = "car-microcargo-citrus.obj";
109 personCapacity = 2;
112 mass = 12000.;
113 speedFactor.getParameter()[1] = 0.05;
114 break;
115 case SVC_TRAILER:
116 maxSpeed = 130. / 3.6;
117 width = 2.55;
118 height = 4.;
120 osgFile = "car-microcargo-citrus.obj";
121 personCapacity = 2;
124 mass = 15000.;
125 speedFactor.getParameter()[1] = 0.05;
126 break;
127 case SVC_BUS:
128 maxSpeed = 100. / 3.6;
129 width = 2.5;
130 height = 3.4;
132 osgFile = "car-minibus-citrus.obj";
133 personCapacity = 85;
135 mass = 7500.;
136 break;
137 case SVC_COACH:
138 maxSpeed = 100. / 3.6;
139 width = 2.6;
140 height = 4.;
142 osgFile = "car-minibus-citrus.obj";
143 personCapacity = 70;
145 mass = 12000.;
146 speedFactor.getParameter()[1] = 0.05;
147 break;
148 case SVC_TRAM:
149 maxSpeed = 80. / 3.6;
150 width = 2.4;
151 height = 3.2;
153 osgFile = "tram.obj";
154 carriageLength = 5.71; // http://de.wikipedia.org/wiki/Bombardier_Flexity_Berlin
155 locomotiveLength = 5.71;
156 personCapacity = 120;
158 mass = 37900.;
159 break;
160 case SVC_RAIL_URBAN:
161 maxSpeed = 100. / 3.6;
162 minGap = 5;
163 width = 3.0;
164 height = 3.6;
166 carriageLength = 18.4; // https://en.wikipedia.org/wiki/DBAG_Class_481
167 locomotiveLength = 18.4;
168 personCapacity = 300;
170 mass = 59000.;
171 break;
172 case SVC_RAIL:
173 maxSpeed = 160. / 3.6;
174 minGap = 5;
175 width = 2.84;
176 height = 3.75;
178 carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
179 locomotiveLength = 16.4; // https://en.wikipedia.org/wiki/DB_Class_218
180 personCapacity = 434;
181 // slight understatement (-:
183 mass = 79500.; // only locomotive
184 break;
186 maxSpeed = 220. / 3.6;
187 width = 0.78;
188 minGap = 5;
189 width = 2.95;
190 height = 3.89;
192 carriageLength = 24.775;
193 locomotiveLength = 19.100; // https://en.wikipedia.org/wiki/DB_Class_101
194 personCapacity = 425;
196 mass = 83000.; // only locomotive
197 break;
198 case SVC_RAIL_FAST:
199 maxSpeed = 330. / 3.6;
200 minGap = 5;
201 width = 2.95;
202 height = 3.89;
204 carriageLength = 24.775; // http://de.wikipedia.org/wiki/ICE_3
205 locomotiveLength = 25.835;
206 personCapacity = 425;
208 mass = 409000.;
209 break;
210 case SVC_DELIVERY:
211 width = 2.16;
212 height = 2.86;
214 personCapacity = 2;
216 mass = 5000.;
217 speedFactor.getParameter()[1] = 0.05;
218 break;
219 case SVC_EMERGENCY:
220 width = 2.16;
221 height = 2.86;
223 personCapacity = 2;
225 mass = 5000.;
226 break;
227 case SVC_PRIVATE:
228 case SVC_VIP:
229 case SVC_PASSENGER:
230 case SVC_HOV:
231 case SVC_CUSTOM1:
232 case SVC_CUSTOM2:
234 speedFactor.getParameter()[1] = 0.1;
235 break;
236 case SVC_TAXI:
238 speedFactor.getParameter()[1] = 0.05;
239 break;
240 case SVC_E_VEHICLE:
243 speedFactor.getParameter()[1] = 0.1;
244 break;
245 case SVC_SHIP:
246 width = 4;
247 maxSpeed = 8 / 1.94; // 8 knots
248 height = 4;
250 // slight understatement (-:
252 mass = 100000.;
253 speedFactor.getParameter()[1] = 0.1;
254 break;
255 default:
256 break;
257 }
258}
259
260
262 speedFactor("normc", 1.0, 0.0, 0.2, 2.0) {}
263
264SUMOVTypeParameter::SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vclass)
265 : id(vtid),
266 length(5. /*4.3*/),
267 minGap(2.5),
268 maxSpeed(200. / 3.6),
269 desiredMaxSpeed(200. / 3.6),
272 speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
273 emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)),
274 mass(1500.),
275 color(RGBColor::DEFAULT_COLOR),
276 vehicleClass(vclass),
277 impatience(0.0),
280 boardingDuration(500),
281 loadingDuration(90000),
282 scale(1),
283 width(1.8),
284 height(1.5),
286 osgFile("car-normal-citrus.obj"),
289 maxSpeedLat(1.0),
292 minGapLat(0.6),
293 carriageLength(-1),
295 carriageGap(1),
298 frontSeatPos(1.7),
299 parametersSet(0),
300 saved(false),
301 onlyReferenced(false) {
303 if (oc.exists("carfollow.model")) {
304 // check for valid value has been performed in MSFrame
306 }
307 // obtain default values depending of vclass
308 VClassDefaultValues defaultValues(vclass);
309 // overwrite SUMOVTypeParameter with VClassDefaultValues
310 length = defaultValues.length;
311 minGap = defaultValues.minGap;
312 maxSpeed = defaultValues.maxSpeed;
313 desiredMaxSpeed = defaultValues.desiredMaxSpeed;
314 width = defaultValues.width;
315 height = defaultValues.height;
316 shape = defaultValues.shape;
317 emissionClass = defaultValues.emissionClass;
318 mass = defaultValues.mass;
319 speedFactor = defaultValues.speedFactor;
320 personCapacity = defaultValues.personCapacity;
321 containerCapacity = defaultValues.containerCapacity;
322 osgFile = defaultValues.osgFile;
323 carriageLength = defaultValues.carriageLength;
324 locomotiveLength = defaultValues.locomotiveLength;
326 // check if default speeddev was defined
327 if (oc.exists("default.speeddev")) {
328 const double defaultSpeedDev = oc.getFloat("default.speeddev");
329 if (defaultSpeedDev >= 0) {
330 speedFactor.getParameter()[1] = defaultSpeedDev;
331 }
332 } else {
333 speedFactor.getParameter()[1] = -1;
334 }
336}
337
338void
340
341 myManoeuverAngleTimes.clear();
349 switch (vclass) {
350 case SVC_PASSENGER:
351 case SVC_HOV:
352 case SVC_TAXI:
353 case SVC_E_VEHICLE:
354 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
355 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
356 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
357 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
358 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
359 break;
360 case SVC_TRUCK:
361 case SVC_TRAILER:
362 case SVC_BUS:
363 case SVC_COACH:
364 case SVC_DELIVERY:
365 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
366 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(2000, 21000))); // straight in
367 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(21000, 2000))); // optional forwards/backwards
368 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(14000, 5000))); // backwards into obtuse space
369 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
370 break;
371 case SVC_PEDESTRIAN:
372 case SVC_MOPED:
373 case SVC_BICYCLE:
374 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(1000, 1000))); // no dependence on angle
375 break;
376 default:
377 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
378 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
379 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
380 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
381 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
382 break;
383 }
384}
385
386void
388 // first check if vehicle type can be written
389 if (onlyReferenced) {
390 return;
391 }
392 // open vehicle tag
394 // write ID (always needed)
395 dev.writeAttr(SUMO_ATTR_ID, id);
396 // write parametes depending if is set
399 }
402 }
405 }
408 }
411 }
414 }
416 // Note: action step length is only exposed in seconds to the user
418 }
421 }
424 }
427 }
429 if (impatience == -std::numeric_limits<double>::max()) {
431 } else {
433 }
434 }
437 }
440 }
443 }
446 }
449 }
452 }
455 }
458 }
461 }
464 }
467 }
469 switch (latAlignmentProcedure) {
472 break;
474 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "right");
475 break;
477 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "center");
478 break;
480 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "arbitrary");
481 break;
484 break;
486 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "compact");
487 break;
490 break;
492 default:
493 break;
494 }
495 }
498 }
501 }
504 }
507 }
510 }
511 // Write Lane Change Model parameters
512 for (const auto& lcParam : lcParameter) {
513 dev.writeAttr(lcParam.first, lcParam.second);
514 }
515 // Write Junction Model parameter
516 for (const auto& jmParam : jmParameter) {
517 dev.writeAttr(jmParam.first, jmParam.second);
518 }
521 }
522 // Write Car Following Model parameters
523 for (const auto& cfParam : cfParameter) {
524 dev.writeAttr(cfParam.first, cfParam.second);
525 }
526 // Write carriage length
531 dev.closeTag();
532 }
533 // Write locomotive length
538 dev.closeTag();
539 }
540 // Write carriage gap
545 dev.closeTag();
546 }
547 // Write rest of parameters
548 writeParams(dev);
549 // close tag
550 dev.closeTag();
551}
552
553
554double
555SUMOVTypeParameter::getCFParam(const SumoXMLAttr attr, const double defaultValue) const {
556 if (cfParameter.count(attr)) {
557 return StringUtils::toDouble(cfParameter.find(attr)->second);
558 } else {
559 return defaultValue;
560 }
561}
562
563
564std::string
565SUMOVTypeParameter::getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
566 if (cfParameter.count(attr)) {
567 return cfParameter.find(attr)->second;
568 } else {
569 return defaultValue;
570 }
571}
572
573
574double
575SUMOVTypeParameter::getLCParam(const SumoXMLAttr attr, const double defaultValue) const {
576 if (lcParameter.count(attr)) {
577 return StringUtils::toDouble(lcParameter.find(attr)->second);
578 } else {
579 return defaultValue;
580 }
581}
582
583
584std::string
585SUMOVTypeParameter::getLCParamString(const SumoXMLAttr attr, const std::string& defaultValue) const {
586 if (lcParameter.count(attr)) {
587 return lcParameter.find(attr)->second;
588 } else {
589 return defaultValue;
590 }
591}
592
593
596 return lcParameter;
597}
598
599
600double
601SUMOVTypeParameter::getJMParam(const SumoXMLAttr attr, const double defaultValue) const {
602 if (jmParameter.count(attr)) {
603 return StringUtils::toDouble(jmParameter.find(attr)->second);
604 } else {
605 return defaultValue;
606 }
607}
608
609
610std::string
611SUMOVTypeParameter::getJMParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
612 if (jmParameter.count(attr)) {
613 return jmParameter.find(attr)->second;
614 } else {
615 return defaultValue;
616 }
617}
618
621 SUMOTime last = 0;
622 for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
623 if (angle <= angleTime.first) {
624 return (angleTime.second.first);
625 } else {
626 last = angleTime.second.first;
627 }
628 }
629 return (last);
630}
631
634 SUMOTime last = 0;
635 for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
636 if (angle <= angleTime.first) {
637 return (angleTime.second.second);
638 } else {
639 last = angleTime.second.second;
640 }
641 }
642 return (last);
643}
644
645std::string
647 std::stringstream stream;
648
649 stream << std::fixed << std::setprecision(1);
650 int count = 0;
651 for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
652 if (count++ > 0) {
653 stream << ",";
654 }
655 stream << toString(angleTime.first) + " " << STEPS2TIME(angleTime.second.first) << " " << STEPS2TIME(angleTime.second.second);
656 }
657 std::string triplets = stream.str();
658 return triplets;
659}
660
661
662void
663SUMOVTypeParameter::cacheParamRestrictions(const std::vector<std::string>& restrictionKeys) {
664 for (const std::string& key : restrictionKeys) {
666 }
667}
668
669
670void
672 if (knowsParameter("carriageLength")) {
675 } else {
676 switch (shape) {
678 carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180
679 carriageGap = 0;
680 break;
682 carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
683 break;
685 carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423
686 break;
688 carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen
689 break;
691 carriageLength = 13.5;
692 locomotiveLength = 2.5;
693 carriageGap = 0.5;
694 break;
696 carriageLength = 6.75;
697 locomotiveLength = 2.5 + 6.75;
698 carriageGap = 0.5;
699 break;
700 default:
701 break;
702 }
703 }
704 if (knowsParameter("locomotiveLength")) {
707 } else if (locomotiveLength <= 0) {
709 }
710 if (knowsParameter("carriageGap")) {
713 }
714 if (knowsParameter("frontSeatPos")) {
717 } else {
718 switch (shape) {
720 frontSeatPos = 5;
721 break;
723 frontSeatPos = 1.2;
724 break;
726 frontSeatPos = 0.6;
727 break;
730 frontSeatPos = 0.9;
731 break;
736 frontSeatPos = 0.5;
737 break;
741 frontSeatPos = 0.8;
742 break;
743 default:
744 break;
745 }
746 }
747}
748
749
750double
752 switch (vc) {
753 case SVC_PEDESTRIAN:
754 return 1.5;
755 case SVC_BICYCLE:
756 return 1.2;
757 case SVC_MOTORCYCLE:
758 return 6.;
759 case SVC_MOPED:
760 return 1.1;
761 case SVC_TRUCK:
762 return 1.3;
763 case SVC_TRAILER:
764 return 1.1;
765 case SVC_BUS:
766 return 1.2;
767 case SVC_COACH:
768 return 2.;
769 case SVC_TRAM:
770 return 1.;
771 case SVC_RAIL_URBAN:
772 return 1.;
773 case SVC_RAIL:
774 return 0.25;
776 case SVC_RAIL_FAST:
777 return 0.5;
778 case SVC_SHIP:
779 return 0.1;
780 default:
781 return 2.6;//2.9;
782 }
783}
784
785
786double
788 switch (vc) {
789 case SVC_PEDESTRIAN:
790 return 2.;
791 case SVC_BICYCLE:
792 return 3.;
793 case SVC_MOPED:
794 return 7.;
795 case SVC_MOTORCYCLE:
796 return 10.;
797 case SVC_TRUCK:
798 case SVC_TRAILER:
799 case SVC_BUS:
800 case SVC_COACH:
801 return 4.;
802 case SVC_TRAM:
803 case SVC_RAIL_URBAN:
804 return 3.;
805 case SVC_RAIL:
807 case SVC_RAIL_FAST:
808 return 1.3;
809 case SVC_SHIP:
810 return 0.15;
811 default:
812 return 4.5;//7.5;
813 }
814}
815
816
817double
818SUMOVTypeParameter::getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption) {
819 if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT) {
820 double vcDecel;
821 switch (vc) {
822 case SVC_PEDESTRIAN:
823 vcDecel = 5.;
824 break;
825 case SVC_BICYCLE:
826 vcDecel = 7.;
827 break;
828 case SVC_MOPED:
829 case SVC_MOTORCYCLE:
830 vcDecel = 10.;
831 break;
832 case SVC_TRUCK:
833 case SVC_TRAILER:
834 case SVC_BUS:
835 case SVC_COACH:
836 case SVC_TRAM:
837 case SVC_RAIL_URBAN:
838 vcDecel = 7.;
839 break;
840 case SVC_RAIL:
842 case SVC_RAIL_FAST:
843 vcDecel = 5.;
844 break;
845 case SVC_SHIP:
846 vcDecel = 1.;
847 break;
848 default:
849 vcDecel = 9.;
850 }
851 return MAX2(decel, vcDecel);
852 } else if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL) {
853 return decel;
854 } else {
855 // value already checked in MSFrame::checkOptions
856 return MAX2(decel, defaultOption);
857 }
858}
859
860
861
862double
864 switch (vc) {
865 case SVC_TRAM:
866 case SVC_RAIL_URBAN:
867 case SVC_RAIL:
869 case SVC_RAIL_FAST:
870 case SVC_SHIP:
871 return 0.;
872 default:
873 return 0.5;
874 }
875}
876
879 static SUMOVTypeParameter defaultParams("");
880 return defaultParams;
881}
882
883bool
884SUMOVTypeParameter::parseLatAlignment(const std::string& val, double& lao, LatAlignmentDefinition& lad) {
885 bool ok = true;
886 lao = 0.0;
888 if (val == "right") {
890 } else if (val == "center") {
892 } else if (val == "arbitrary") {
894 } else if (val == "nice") {
896 } else if (val == "compact") {
898 } else if (val == "left") {
900 } else {
901 try {
902 lao = StringUtils::toDouble(val);
903 } catch (...) {
904 ok = false;
905 }
906 }
907 return ok;
908}
909
910
913 return timeToTeleport == TTT_UNSET ? defaultValue : timeToTeleport;
914}
915
918 return timeToTeleportBidi == TTT_UNSET ? defaultValue : timeToTeleportBidi;
919}
920
921/****************************************************************************/
long long int SUMOTime
Definition: GUI.h:36
@ DEFAULT
default cursor
#define STEPS2TIME(x)
Definition: SUMOTime.h:54
#define TTT_UNSET
#define EMPREFIX
const long long int VTYPEPARS_TTT_SET
const long long int VTYPEPARS_SHAPE_SET
const long long int VTYPEPARS_LOADING_DURATION
const long long int VTYPEPARS_SCALE_SET
const long long int VTYPEPARS_PERSON_CAPACITY
const long long int VTYPEPARS_CAR_FOLLOW_MODEL
const long long int VTYPEPARS_FRONT_SEAT_POS_SET
const long long int VTYPEPARS_WIDTH_SET
const long long int VTYPEPARS_CARRIAGE_LENGTH_SET
const long long int VTYPEPARS_ACTIONSTEPLENGTH_SET
const long long int VTYPEPARS_MAXSPEED_LAT_SET
const long long int VTYPEPARS_MAXSPEED_SET
const long long int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT
const long long int VTYPEPARS_LATALIGNMENT_SET
const long long int VTYPEPARS_COLOR_SET
const long long int VTYPEPARS_LANE_CHANGE_MODEL_SET
const long long int VTYPEPARS_DESIRED_MAXSPEED_SET
const long long int VTYPEPARS_OSGFILE_SET
const long long int VTYPEPARS_MANEUVER_ANGLE_TIMES_SET
const long long int VTYPEPARS_SPEEDFACTOR_SET
const long long int VTYPEPARS_CARRIAGE_GAP_SET
const long long int VTYPEPARS_MINGAP_SET
const long long int VTYPEPARS_PROBABILITY_SET
const long long int VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL
const long long int VTYPEPARS_MASS_SET
const long long int VTYPEPARS_BOARDING_DURATION
LatAlignmentDefinition
Possible ways to choose the lateral alignment, i.e., how vehicles align themselves within their lane.
@ RIGHT
drive on the right side
@ GIVEN
The alignment as offset is given.
@ DEFAULT
No information given; use default.
@ LEFT
drive on the left side
@ ARBITRARY
maintain the current alignment
@ NICE
align with the closest sublane border
@ COMPACT
align with the rightmost sublane that allows keeping the current speed
@ CENTER
drive in the middle
const long long int VTYPEPARS_VEHICLECLASS_SET
const long long int VTYPEPARS_IMPATIENCE_SET
const long long int VTYPEPARS_LENGTH_SET
const long long int VTYPEPARS_IMGFILE_SET
const long long int VTYPEPARS_CONTAINER_CAPACITY
const long long int VTYPEPARS_MINGAP_LAT_SET
const long long int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
double getDefaultVehicleLength(const SUMOVehicleClass vc)
Returns the default vehicle length This put into a function so it can be used by NBVehicle.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_SHIP
is an arbitrary ship
@ SVC_PRIVATE
private vehicles
@ SVC_VIP
vip vehicles
@ SVC_HOV
vehicle is a HOV
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_CUSTOM2
is a user-defined type
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_COACH
vehicle is a coach
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_TRAILER
vehicle is a large transport vehicle
@ SVC_CUSTOM1
is a user-defined type
@ SVC_RAIL_ELECTRIC
rail vehicle that requires electrified tracks
@ SVC_DELIVERY
vehicle is a small delivery vehicle
@ SVC_RAIL_URBAN
vehicle is a city rail
@ SVC_MOTORCYCLE
vehicle is a motorcycle
@ SVC_EMERGENCY
public emergency vehicles
@ SVC_MOPED
vehicle is a moped
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_E_VEHICLE
is an electric vehicle
@ SVC_PEDESTRIAN
pedestrian
const double DEFAULT_VEH_PROB
SUMOVehicleShape
Definition of vehicle classes to differ between different appearances.
@ BUS
render as a bus
@ RAIL_CARGO
render as a cargo train
@ RAIL
render as a rail
@ PASSENGER
render as a passenger vehicle
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ DELIVERY
render as a delivery vehicle
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ UNKNOWN
not defined
@ BUS_TROLLEY
render as a trolley bus
@ TAXI
automated car (with cruise controllers)
@ E_VEHICLE
render as a (futuristic) e-vehicle
@ TRUCK
render as a transport vehicle
@ MOPED
render as a moped
@ BUS_FLEXIBLE
render as a flexible city bus
@ TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ BUS_COACH
render as a coach
@ TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ PEDESTRIAN
render as a pedestrian
const double DEFAULT_PEDESTRIAN_SPEED
@ CENTER
At the center of the lane.
@ SUMO_TAG_CF_KRAUSS
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_PARAM
parameter associated to a certain key
LaneChangeModel
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_SCALE
@ SUMO_ATTR_MAXSPEED_LAT
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_MINGAP
@ SUMO_ATTR_MASS
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_MANEUVER_ANGLE_TIMES
Class specific timing values for vehicle manoeuvering through angle ranges.
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_GUISHAPE
@ SUMO_ATTR_DESIRED_MAXSPEED
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_MINGAP_LAT
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_LATALIGNMENT
@ SUMO_ATTR_IMPATIENCE
@ SUMO_ATTR_VCLASS
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_PROB
@ SUMO_ATTR_TIME_TO_TELEPORT
@ SUMO_ATTR_SPEEDFACTOR
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_MAXSPEED
@ SUMO_ATTR_ID
@ SUMO_ATTR_OSGFILE
@ SUMO_ATTR_IMGFILE
@ SUMO_ATTR_WIDTH
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_KEY
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_CARRIAGE_GAP
T MAX2(T a, T b)
Definition: StdDefs.h:77
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
std::vector< double > & getParameter()
Returns the parameters of this distribution.
A storage for options typed value containers)
Definition: OptionsCont.h:89
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool exists(const std::string &name) const
Returns the information whether the named option is known.
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:59
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
Helper methods for PHEMlight-based emission computation.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
Structure representing possible vehicle parameter.
SUMOTime getExitManoeuvreTime(const int angle) const
Returns the time that will be needed for the vehicle type to execute the (exit) manoeuvre (and be blo...
double width
This class' width.
SubParams cfParameter
Car-following parameter.
void write(OutputDevice &dev) const
Writes the vtype.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions....
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
bool saved
Information whether this type was already saved (needed by routers)
SUMOTime getTimeToTeleport(SUMOTime defaultValue) const
return time-to-teleport (either custom or default)
bool wasSet(long long int what) const
Returns whether the given parameter was set.
double height
This class' height.
double desiredMaxSpeed
The vehicle type's desired maximum speed [m/s].
SUMOEmissionClass emissionClass
The emission class of this vehicle.
double frontSeatPos
the offset of the first person seat from the front of the vehicle
double latAlignmentOffset
(optional) The vehicle's desired lateral alignment as offset in m from center line
std::string getJMParamString(const SumoXMLAttr attr, const std::string defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
double carriageLength
the length of train carriages and locomotive
SUMOTime getTimeToTeleportBidi(SUMOTime defaultValue) const
return time-to-teleport.bidi (either custom or default)
double length
The physical vehicle length.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
std::vector< double > paramRestrictions
cached value of parameters which may restrict access to certain edges
static double getDefaultDecel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default deceleration for the given vehicle class This needs to be a function because the ...
SUMOTime getEntryManoeuvreTime(const int angle) const
Returns the time that will be needed for the vehicle type to execute the (entry) manoeuvre (and be bl...
RGBColor color
The color.
long long int parametersSet
Information for the router which parameter were set.
double minGap
This class' free space in front of the vehicle itself.
std::map< SumoXMLAttr, std::string > SubParams
sub-model parameters
std::string imgFile
Image file for this class.
void initRailVisualizationParameters()
init Rail Visualization Parameters
SUMOVehicleShape shape
This class' shape.
int personCapacity
The person capacity of the vehicle.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
bool onlyReferenced
Information whether this is a type-stub, being only referenced but not defined (needed by routers)
double scale
individual scaling factor (-1 for undefined)
double getLCParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SUMOTime timeToTeleport
the custom time-to-teleport for this type
std::string osgFile
3D model file for this class
double maxSpeed
The vehicle type's (technical) maximum speed [m/s].
static double getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption)
Returns the default emergency deceleration for the given vehicle class This needs to be a function be...
SUMOTime timeToTeleportBidi
the custom time-to-teleport.bidi for this type
void setManoeuverAngleTimes(const SUMOVehicleClass vclass)
Initialise the default mapping between manoeuver angle and times dependant on vehicle class.
int containerCapacity
The container capacity of the vehicle.
static const SUMOVTypeParameter & getDefault()
return the default parameters, this is a function due to the http://www.parashift....
SUMOTime boardingDuration
The time a person needs to board the vehicle.
double getCFParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
double minGapLat
The vehicle type's minimum lateral gap [m].
SUMOVehicleClass vehicleClass
The vehicle's class.
SUMOVTypeParameter(const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING)
Constructor.
double getJMParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
double mass
The mass.
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
std::string getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
std::string id
The vehicle type's id.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
const SubParams & getLCParams() const
Returns the LC parameter.
std::string getLCParamString(const SumoXMLAttr attr, const std::string &defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SubParams lcParameter
Lane-changing parameter.
LatAlignmentDefinition latAlignmentProcedure
Information on how the vehicle shall choose the lateral alignment.
static double getDefaultImperfection(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle c...
SubParams jmParameter
Junction-model parameter.
double impatience
The vehicle's impatience (willingness to obstruct others)
std::string getManoeuverAngleTimesS() const
Returns myManoeuverAngleTimes as a string for xml output.
std::map< int, std::pair< SUMOTime, SUMOTime > > myManoeuverAngleTimes
Map of manoeuver angles versus the times (entry, exit) to execute the manoeuver.
LaneChangeModel lcModel
The lane-change model to use.
static bool parseLatAlignment(const std::string &val, double &lao, LatAlignmentDefinition &lad)
Parses and validates a given latAlignment value.
static double getDefaultAccel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default acceleration for the given vehicle class This needs to be a function because the ...
static StringBijection< SumoXMLTag > CarFollowModels
car following models
T get(const std::string &str) const
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
struct for default values that depend of VClass
int personCapacity
The person capacity of the vehicle.
double carriageLength
the length of train carriages
double desiredMaxSpeed
The vehicle type's desired maximum speed [m/s].
std::string osgFile
3D model file for this class
SUMOEmissionClass emissionClass
The emission class of this vehicle.
double minGap
This class' free space in front of the vehicle itself.
int containerCapacity
The container capacity of the vehicle.
double maxSpeed
The vehicle type's maximum speed [m/s] (technical limit, not subject to speed deviation)
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
double length
The physical vehicle length.
SUMOVehicleShape shape
This class' shape.
LatAlignmentDefinition latAlignmentProcedure
the lateral alignment procedure
double locomotiveLength
the length of train locomotive