Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
SUMOVTypeParameter.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 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// static value definitions
39// ===========================================================================
40std::set<SumoXMLAttr> SUMOVTypeParameter::AllowedJMAttrs({
52});
53
54
55// ===========================================================================
56// member method definitions
57// ===========================================================================
58
60 length(getDefaultVehicleLength(vclass)),
61 minGap(2.5),
62 minGapLat(0.6),
63 maxSpeed(200. / 3.6),
64 desiredMaxSpeed(10000 / 3.6), // backward-compatibility: do not influence speeds by default
65 width(1.8),
66 height(1.5),
68 emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)),
69 mass(1500.),
70 speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
71 personCapacity(4),
72 containerCapacity(0),
73 osgFile("car-normal-citrus.obj"),
74 carriageLength(-1),
75 locomotiveLength(-1),
76 latAlignmentProcedure(LatAlignmentDefinition::CENTER) {
77 // update default values
78 switch (vclass) {
79 case SVC_PEDESTRIAN:
80 minGap = 0.25;
81 maxSpeed = 37.58 / 3.6; // Usain Bolt
83 width = 0.478;
84 height = 1.719;
86 osgFile = "humanResting.obj";
88 mass = 70.; // https://en.wikipedia.org/wiki/Human_body_weight for Europe
89 speedFactor.getParameter()[1] = 0.1;
90 break;
91 case SVC_BICYCLE:
92 minGap = 0.5;
93 minGapLat = 0.35;
94 maxSpeed = 50. / 3.6;
96 width = 0.65;
97 height = 1.7;
101 mass = 10.;
102 speedFactor.getParameter()[1] = 0.1;
104 break;
105 case SVC_MOPED:
106 maxSpeed = 60. / 3.6;
107 width = 0.78;
108 height = 1.7;
110 personCapacity = 1;
112 mass = 80.;
113 speedFactor.getParameter()[1] = 0.1;
114 break;
115 case SVC_MOTORCYCLE:
116 width = 0.9;
117 height = 1.5;
119 personCapacity = 1;
121 mass = 200.;
122 speedFactor.getParameter()[1] = 0.1;
123 break;
124 case SVC_TRUCK:
125 maxSpeed = 130. / 3.6;
126 width = 2.4;
127 height = 2.4;
129 osgFile = "car-microcargo-citrus.obj";
130 personCapacity = 2;
133 mass = 12000.;
134 speedFactor.getParameter()[1] = 0.05;
135 break;
136 case SVC_TRAILER:
137 maxSpeed = 130. / 3.6;
138 width = 2.55;
139 height = 4.;
141 osgFile = "car-microcargo-citrus.obj";
142 personCapacity = 2;
145 mass = 15000.;
146 speedFactor.getParameter()[1] = 0.05;
147 break;
148 case SVC_BUS:
149 maxSpeed = 100. / 3.6;
150 width = 2.5;
151 height = 3.4;
153 osgFile = "car-minibus-citrus.obj";
154 personCapacity = 85;
156 mass = 7500.;
157 break;
158 case SVC_COACH:
159 maxSpeed = 100. / 3.6;
160 width = 2.6;
161 height = 4.;
163 osgFile = "car-minibus-citrus.obj";
164 personCapacity = 70;
166 mass = 12000.;
167 speedFactor.getParameter()[1] = 0.05;
168 break;
169 case SVC_TRAM:
170 maxSpeed = 80. / 3.6;
171 width = 2.4;
172 height = 3.2;
174 osgFile = "tram.obj";
175 personCapacity = 120;
177 mass = 37900.;
178 break;
179 case SVC_RAIL_URBAN:
180 maxSpeed = 100. / 3.6;
181 minGap = 5;
182 width = 3.0;
183 height = 3.6;
185 personCapacity = 300;
187 mass = 59000.;
188 break;
189 case SVC_RAIL:
190 maxSpeed = 160. / 3.6;
191 minGap = 5;
192 width = 2.84;
193 height = 3.75;
195 personCapacity = 434;
196 // slight understatement (-:
198 mass = 79500.; // only locomotive
199 break;
201 maxSpeed = 220. / 3.6;
202 width = 0.78;
203 minGap = 5;
204 width = 2.95;
205 height = 3.89;
207 personCapacity = 425;
209 mass = 83000.; // only locomotive
210 break;
211 case SVC_RAIL_FAST:
212 maxSpeed = 330. / 3.6;
213 minGap = 5;
214 width = 2.95;
215 height = 3.89;
217 personCapacity = 425;
219 mass = 409000.;
220 break;
221 case SVC_DELIVERY:
222 width = 2.16;
223 height = 2.86;
225 personCapacity = 2;
227 mass = 5000.;
228 speedFactor.getParameter()[1] = 0.05;
229 break;
230 case SVC_EMERGENCY:
231 width = 2.16;
232 height = 2.86;
234 personCapacity = 2;
236 mass = 5000.;
237 break;
238 case SVC_PRIVATE:
239 case SVC_VIP:
240 case SVC_PASSENGER:
241 case SVC_HOV:
242 case SVC_CUSTOM1:
243 case SVC_CUSTOM2:
245 speedFactor.getParameter()[1] = 0.1;
246 break;
247 case SVC_TAXI:
249 speedFactor.getParameter()[1] = 0.05;
250 break;
251 case SVC_E_VEHICLE:
254 speedFactor.getParameter()[1] = 0.1;
255 break;
256 case SVC_SHIP:
257 width = 4;
258 maxSpeed = 8 / 1.94; // 8 knots
259 height = 4;
261 // slight understatement (-:
263 mass = 100000.;
264 speedFactor.getParameter()[1] = 0.1;
265 break;
266 default:
267 break;
268 }
269}
270
271
274
275SUMOVTypeParameter::SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vclass)
276 : id(vtid),
279 speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
280 emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)),
281 color(RGBColor::DEFAULT_COLOR),
282 vehicleClass(vclass),
283 impatience(0.0),
286 boardingDuration(500),
287 loadingDuration(90000),
288 scale(1),
289 width(1.8),
290 height(1.5),
292 osgFile("car-normal-citrus.obj"),
295 maxSpeedLat(1.0),
298 carriageLength(-1),
300 carriageGap(1),
304 frontSeatPos(1.7),
305 seatingWidth(-1),
306 parametersSet(0),
307 saved(false),
308 onlyReferenced(false) {
310 if (oc.exists("carfollow.model")) {
311 // check for valid value has been performed in MSFrame
313 }
314 // obtain default values depending of vclass
315 VClassDefaultValues defaultValues(vclass);
316 // overwrite SUMOVTypeParameter with VClassDefaultValues
317 length = defaultValues.length;
318 minGap = defaultValues.minGap;
319 minGapLat = defaultValues.minGapLat;
320 maxSpeed = defaultValues.maxSpeed;
321 desiredMaxSpeed = defaultValues.desiredMaxSpeed;
322 width = defaultValues.width;
323 height = defaultValues.height;
324 shape = defaultValues.shape;
325 emissionClass = defaultValues.emissionClass;
326 mass = defaultValues.mass;
327 speedFactor = defaultValues.speedFactor;
328 personCapacity = defaultValues.personCapacity;
329 containerCapacity = defaultValues.containerCapacity;
330 osgFile = defaultValues.osgFile;
331 carriageLength = defaultValues.carriageLength;
332 locomotiveLength = defaultValues.locomotiveLength;
334 // check if default speeddev was defined
335 if (oc.exists("default.speeddev")) {
336 const double defaultSpeedDev = oc.getFloat("default.speeddev");
337 if (defaultSpeedDev >= 0) {
338 speedFactor.getParameter()[1] = defaultSpeedDev;
339 }
340 } else {
341 speedFactor.getParameter()[1] = -1;
342 }
344}
345
346void
348
349 myManoeuverAngleTimes.clear();
357 switch (vclass) {
358 case SVC_PASSENGER:
359 case SVC_HOV:
360 case SVC_TAXI:
361 case SVC_E_VEHICLE:
362 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
363 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
364 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
365 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
366 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
367 break;
368 case SVC_TRUCK:
369 case SVC_TRAILER:
370 case SVC_BUS:
371 case SVC_COACH:
372 case SVC_DELIVERY:
373 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
374 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(2000, 21000))); // straight in
375 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(21000, 2000))); // optional forwards/backwards
376 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(14000, 5000))); // backwards into obtuse space
377 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
378 break;
379 case SVC_PEDESTRIAN:
380 case SVC_MOPED:
381 case SVC_BICYCLE:
382 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(1000, 1000))); // no dependence on angle
383 break;
384 default:
385 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
386 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
387 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
388 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
389 myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
390 break;
391 }
392}
393
394void
396 // first check if vehicle type can be written
397 if (onlyReferenced) {
398 return;
399 }
400 // open vehicle tag
402 // write ID (always needed)
403 dev.writeAttr(SUMO_ATTR_ID, id);
404 // write parameters depending if is set
407 }
410 }
413 }
416 }
419 }
422 }
424 // Note: action step length is only exposed in seconds to the user
426 }
429 }
432 }
435 }
437 if (impatience == -std::numeric_limits<double>::max()) {
439 } else {
441 }
442 }
445 }
448 }
451 }
454 }
457 }
460 }
463 }
466 }
469 }
472 }
475 }
477 switch (latAlignmentProcedure) {
480 break;
482 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "right");
483 break;
485 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "center");
486 break;
488 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "arbitrary");
489 break;
492 break;
494 dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "compact");
495 break;
498 break;
500 default:
501 break;
502 }
503 }
506 }
509 }
512 }
515 }
518 }
521 }
524 }
525 // Write Lane Change Model parameters
526 for (const auto& lcParam : lcParameter) {
527 dev.writeAttr(lcParam.first, lcParam.second);
528 }
529 // Write Junction Model parameter
530 for (const auto& jmParam : jmParameter) {
531 dev.writeAttr(jmParam.first, jmParam.second);
532 }
535 }
536 // Write Car Following Model parameters
537 for (const auto& cfParam : cfParameter) {
538 dev.writeAttr(cfParam.first, cfParam.second);
539 }
540 // Write carriage length
545 dev.closeTag();
546 }
547 // Write locomotive length
552 dev.closeTag();
553 }
554 // Write carriage gap
559 dev.closeTag();
560 }
561 // Write rest of parameters
562 writeParams(dev);
563 // close tag
564 dev.closeTag();
565}
566
567
568double
569SUMOVTypeParameter::getCFParam(const SumoXMLAttr attr, const double defaultValue) const {
570 if (cfParameter.count(attr)) {
571 return StringUtils::toDouble(cfParameter.find(attr)->second);
572 } else {
573 return defaultValue;
574 }
575}
576
577
578std::string
579SUMOVTypeParameter::getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
580 if (cfParameter.count(attr)) {
581 return cfParameter.find(attr)->second;
582 } else {
583 return defaultValue;
584 }
585}
586
587
588double
589SUMOVTypeParameter::getLCParam(const SumoXMLAttr attr, const double defaultValue) const {
590 if (lcParameter.count(attr)) {
591 return StringUtils::toDouble(lcParameter.find(attr)->second);
592 } else {
593 return defaultValue;
594 }
595}
596
597
598std::string
599SUMOVTypeParameter::getLCParamString(const SumoXMLAttr attr, const std::string& defaultValue) const {
600 if (lcParameter.count(attr)) {
601 return lcParameter.find(attr)->second;
602 } else {
603 return defaultValue;
604 }
605}
606
607
612
613
614double
615SUMOVTypeParameter::getJMParam(const SumoXMLAttr attr, const double defaultValue) const {
616 if (jmParameter.count(attr)) {
617 return StringUtils::toDouble(jmParameter.find(attr)->second);
618 } else {
619 return defaultValue;
620 }
621}
622
623
624std::string
625SUMOVTypeParameter::getJMParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
626 if (jmParameter.count(attr)) {
627 return jmParameter.find(attr)->second;
628 } else {
629 return defaultValue;
630 }
631}
632
635 SUMOTime last = 0;
636 for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
637 if (angle <= angleTime.first) {
638 return (angleTime.second.first);
639 } else {
640 last = angleTime.second.first;
641 }
642 }
643 return (last);
644}
645
648 SUMOTime last = 0;
649 for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
650 if (angle <= angleTime.first) {
651 return (angleTime.second.second);
652 } else {
653 last = angleTime.second.second;
654 }
655 }
656 return (last);
657}
658
659std::string
661 std::stringstream stream;
662
663 stream << std::fixed << std::setprecision(1);
664 int count = 0;
665 for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
666 if (count++ > 0) {
667 stream << ",";
668 }
669 stream << toString(angleTime.first) + " " << STEPS2TIME(angleTime.second.first) << " " << STEPS2TIME(angleTime.second.second);
670 }
671 std::string triplets = stream.str();
672 return triplets;
673}
674
675
676void
677SUMOVTypeParameter::cacheParamRestrictions(const std::vector<std::string>& restrictionKeys) {
678 for (const std::string& key : restrictionKeys) {
680 }
681}
682
683
684void
686 if (knowsParameter("carriageLength")) {
689 } else {
690 switch (shape) {
692 carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180
693 carriageGap = 0;
694 break;
697 carriageLength = 24.5;
698 locomotiveLength = 19.100; // https://en.wikipedia.org/wiki/DB_Class_101
699 } else if (vehicleClass == SVC_RAIL_FAST) {
700 carriageLength = 24.775; // http://de.wikipedia.org/wiki/ICE_3
701 locomotiveLength = 25.835;
702 } else {
703 carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
704 locomotiveLength = 16.4; // https://en.wikipedia.org/wiki/DB_Class_218
705 }
706 break;
708 if (vehicleClass == SVC_TRAM) {
709 carriageLength = 5.71; // http://de.wikipedia.org/wiki/Bombardier_Flexity_Berlin
710 locomotiveLength = 5.71;
711 } else if (vehicleClass == SVC_RAIL_URBAN) {
712 carriageLength = 18.4; // https://en.wikipedia.org/wiki/DBAG_Class_481
713 locomotiveLength = 18.4;
714 } else {
715 carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423
716 }
717 break;
719 carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen
720 break;
722 carriageLength = 13.5;
723 locomotiveLength = 2.5;
724 carriageGap = 0.5;
725 break;
727 carriageLength = 6.75;
728 locomotiveLength = 2.5 + 6.75;
729 carriageGap = 0.5;
730 break;
731 default:
732 break;
733 }
734 }
735 if (knowsParameter("locomotiveLength")) {
738 } else if (locomotiveLength <= 0) {
740 }
741 if (knowsParameter("carriageGap")) {
744 }
745 if (knowsParameter("frontSeatPos")) {
748 } else {
749 switch (shape) {
751 frontSeatPos = 5;
752 break;
754 frontSeatPos = 1.2;
755 break;
757 frontSeatPos = 0.6;
758 break;
761 frontSeatPos = 0.9;
762 break;
767 frontSeatPos = 0.5;
768 break;
772 frontSeatPos = 0.8;
773 break;
774 default:
775 break;
776 }
777 }
778
779 if (knowsParameter("seatingWidth")) {
782 }
783}
784
785
786double
788 switch (vc) {
789 case SVC_PEDESTRIAN:
790 return 1.5;
791 case SVC_BICYCLE:
792 return 1.2;
793 case SVC_MOTORCYCLE:
794 return 6.;
795 case SVC_MOPED:
796 return 1.1;
797 case SVC_TRUCK:
798 return 1.3;
799 case SVC_TRAILER:
800 return 1.1;
801 case SVC_BUS:
802 return 1.2;
803 case SVC_COACH:
804 return 2.;
805 case SVC_TRAM:
806 return 1.;
807 case SVC_RAIL_URBAN:
808 return 1.;
809 case SVC_RAIL:
810 return 0.25;
812 case SVC_RAIL_FAST:
813 return 0.5;
814 case SVC_SHIP:
815 return 0.1;
816 default:
817 return 2.6;//2.9;
818 }
819}
820
821
822double
824 switch (vc) {
825 case SVC_PEDESTRIAN:
826 return 2.;
827 case SVC_BICYCLE:
828 return 3.;
829 case SVC_MOPED:
830 return 7.;
831 case SVC_MOTORCYCLE:
832 return 10.;
833 case SVC_TRUCK:
834 case SVC_TRAILER:
835 case SVC_BUS:
836 case SVC_COACH:
837 return 4.;
838 case SVC_TRAM:
839 case SVC_RAIL_URBAN:
840 return 3.;
841 case SVC_RAIL:
843 case SVC_RAIL_FAST:
844 return 1.3;
845 case SVC_SHIP:
846 return 0.15;
847 default:
848 return 4.5;//7.5;
849 }
850}
851
852
853double
854SUMOVTypeParameter::getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption) {
855 if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT) {
856 double vcDecel;
857 switch (vc) {
858 case SVC_PEDESTRIAN:
859 vcDecel = 5.;
860 break;
861 case SVC_BICYCLE:
862 vcDecel = 7.;
863 break;
864 case SVC_MOPED:
865 case SVC_MOTORCYCLE:
866 vcDecel = 10.;
867 break;
868 case SVC_TRUCK:
869 case SVC_TRAILER:
870 case SVC_BUS:
871 case SVC_COACH:
872 case SVC_TRAM:
873 case SVC_RAIL_URBAN:
874 vcDecel = 7.;
875 break;
876 case SVC_RAIL:
878 case SVC_RAIL_FAST:
879 vcDecel = 5.;
880 break;
881 case SVC_SHIP:
882 vcDecel = 1.;
883 break;
884 default:
885 vcDecel = 9.;
886 }
887 return MAX2(decel, vcDecel);
888 } else if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL) {
889 return decel;
890 } else {
891 // value already checked in MSFrame::checkOptions
892 return MAX2(decel, defaultOption);
893 }
894}
895
896
897
898double
900 switch (vc) {
901 case SVC_TRAM:
902 case SVC_RAIL_URBAN:
903 case SVC_RAIL:
905 case SVC_RAIL_FAST:
906 case SVC_SHIP:
907 return 0.;
908 default:
909 return 0.5;
910 }
911}
912
915 static SUMOVTypeParameter defaultParams("");
916 return defaultParams;
917}
918
919bool
920SUMOVTypeParameter::parseLatAlignment(const std::string& val, double& lao, LatAlignmentDefinition& lad) {
921 bool ok = true;
922 lao = 0.0;
924 if (val == "right") {
926 } else if (val == "center") {
928 } else if (val == "arbitrary") {
930 } else if (val == "nice") {
932 } else if (val == "compact") {
934 } else if (val == "left") {
936 } else {
937 try {
938 lao = StringUtils::toDouble(val);
939 } catch (...) {
940 ok = false;
941 }
942 }
943 return ok;
944}
945
946
949 return timeToTeleport == TTT_UNSET ? defaultValue : timeToTeleport;
950}
951
956
957/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:69
#define STEPS2TIME(x)
Definition SUMOTime.h:55
#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_TTT_BIDI_SET
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_PREMATURE_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_SEATING_WIDTH_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
const double DEFAULT_BICYCLE_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
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_JM_STOPLINE_GAP
@ SUMO_ATTR_SCALE
@ SUMO_ATTR_MAXSPEED_LAT
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_MINGAP
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_MASS
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_MANEUVER_ANGLE_TIMES
Class specific timing values for vehicle maneuvering through angle ranges.
@ SUMO_ATTR_TIME_TO_TELEPORT_BIDI
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_GUISHAPE
@ SUMO_ATTR_DESIRED_MAXSPEED
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_MINGAP_LAT
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_LATALIGNMENT
@ SUMO_ATTR_IMPATIENCE
@ SUMO_ATTR_VCLASS
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_JM_SIGMA_MINOR
@ 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_SPEEDFACTOR_PREMATURE
@ SUMO_ATTR_OSGFILE
@ SUMO_ATTR_IMGFILE
@ SUMO_ATTR_WIDTH
@ SUMO_ATTR_JM_IGNORE_JUNCTION_FOE_PROB
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_KEY
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
@ SUMO_ATTR_JM_TIMEGAP_MINOR
@ SUMO_ATTR_CARRIAGE_GAP
T MAX2(T a, T b)
Definition StdDefs.h:82
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.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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
static std::set< SumoXMLAttr > AllowedJMAttrs
allowed attrs for the junction model
double seatingWidth
width to be used when comping seats
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].
double speedFactorPremature
the possible speed reduction when a train is ahead of schedule
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.
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.
double minGapLat
The vehicle type's minimum lateral gap [m].
LatAlignmentDefinition latAlignmentProcedure
the lateral alignment procedure
double locomotiveLength
the length of train locomotive