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>
26 #include <utils/common/ToString.h>
33 
34 #define EMPREFIX std::string("HBEFA3/")
35 
36 
37 // ===========================================================================
38 // member method definitions
39 // ===========================================================================
40 
42  length(getDefaultVehicleLength(vclass)),
43  minGap(2.5),
44  maxSpeed(200. / 3.6),
45  width(1.8),
46  height(1.5),
47  shape(SUMOVehicleShape::UNKNOWN),
48  emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)),
49  speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
50  personCapacity(4),
51  containerCapacity(0),
52  osgFile("car-normal-citrus.obj"),
53  carriageLength(-1),
54  locomotiveLength(-1) {
55  // update default values
56  switch (vclass) {
57  case SVC_PEDESTRIAN:
58  minGap = 0.25;
60  width = 0.478;
61  height = 1.719;
64  speedFactor.getParameter()[1] = 0.1;
65  break;
66  case SVC_BICYCLE:
67  minGap = 0.5;
68  maxSpeed = 20. / 3.6;
69  width = 0.65;
70  height = 1.7;
72  personCapacity = 1;
74  speedFactor.getParameter()[1] = 0.1;
75  break;
76  case SVC_MOPED:
77  maxSpeed = 60. / 3.6;
78  width = 0.78;
79  height = 1.7;
81  personCapacity = 1;
83  speedFactor.getParameter()[1] = 0.1;
84  break;
85  case SVC_MOTORCYCLE:
86  width = 0.9;
87  height = 1.5;
89  personCapacity = 1;
91  speedFactor.getParameter()[1] = 0.1;
92  break;
93  case SVC_TRUCK:
94  maxSpeed = 130. / 3.6;
95  width = 2.4;
96  height = 2.4;
98  osgFile = "car-microcargo-citrus.obj";
99  personCapacity = 2;
100  containerCapacity = 1;
102  speedFactor.getParameter()[1] = 0.05;
103  break;
104  case SVC_TRAILER:
105  maxSpeed = 130. / 3.6;
106  width = 2.55;
107  height = 4.;
109  osgFile = "car-microcargo-citrus.obj";
110  personCapacity = 2;
111  containerCapacity = 2;
113  speedFactor.getParameter()[1] = 0.05;
114  break;
115  case SVC_BUS:
116  maxSpeed = 100. / 3.6;
117  width = 2.5;
118  height = 3.4;
120  osgFile = "car-minibus-citrus.obj";
121  personCapacity = 85;
123  break;
124  case SVC_COACH:
125  maxSpeed = 100. / 3.6;
126  width = 2.6;
127  height = 4.;
129  osgFile = "car-minibus-citrus.obj";
130  personCapacity = 70;
132  speedFactor.getParameter()[1] = 0.05;
133  break;
134  case SVC_TRAM:
135  maxSpeed = 80. / 3.6;
136  width = 2.4;
137  height = 3.2;
139  osgFile = "tram.obj";
140  carriageLength = 5.71; // http://de.wikipedia.org/wiki/Bombardier_Flexity_Berlin
141  locomotiveLength = 5.71;
142  personCapacity = 120;
144  break;
145  case SVC_RAIL_URBAN:
146  maxSpeed = 100. / 3.6;
147  minGap = 5;
148  width = 3.0;
149  height = 3.6;
151  carriageLength = 18.4; // https://en.wikipedia.org/wiki/DBAG_Class_481
152  locomotiveLength = 18.4;
153  personCapacity = 300;
155  break;
156  case SVC_RAIL:
157  maxSpeed = 160. / 3.6;
158  minGap = 5;
159  width = 2.84;
160  height = 3.75;
162  carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
163  locomotiveLength = 16.4; // https://en.wikipedia.org/wiki/DB_Class_218
164  personCapacity = 434;
165  // slight understatement (-:
167  break;
168  case SVC_RAIL_ELECTRIC:
169  maxSpeed = 220. / 3.6;
170  minGap = 5;
171  width = 2.95;
172  height = 3.89;
174  carriageLength = 24.775;
175  locomotiveLength = 19.100; // https://en.wikipedia.org/wiki/DB_Class_101
176  personCapacity = 425;
178  break;
179  case SVC_RAIL_FAST:
180  maxSpeed = 330. / 3.6;
181  minGap = 5;
182  width = 2.95;
183  height = 3.89;
185  carriageLength = 24.775; // http://de.wikipedia.org/wiki/ICE_3
186  locomotiveLength = 25.835;
187  personCapacity = 425;
189  break;
190  case SVC_DELIVERY:
191  width = 2.16;
192  height = 2.86;
194  personCapacity = 2;
196  speedFactor.getParameter()[1] = 0.05;
197  break;
198  case SVC_EMERGENCY:
199  width = 2.16;
200  height = 2.86;
202  personCapacity = 2;
204  break;
205  case SVC_PRIVATE:
206  case SVC_VIP:
207  case SVC_PASSENGER:
208  case SVC_HOV:
209  case SVC_CUSTOM1:
210  case SVC_CUSTOM2:
212  speedFactor.getParameter()[1] = 0.1;
213  break;
214  case SVC_TAXI:
216  speedFactor.getParameter()[1] = 0.05;
217  break;
218  case SVC_E_VEHICLE:
221  speedFactor.getParameter()[1] = 0.1;
222  break;
223  case SVC_SHIP:
224  width = 4;
225  maxSpeed = 8 / 1.94; // 8 knots
226  height = 4;
228  // slight understatement (-:
230  speedFactor.getParameter()[1] = 0.1;
231  break;
232  default:
233  break;
234  }
235 }
236 
237 
239  speedFactor("normc", 1.0, 0.0, 0.2, 2.0) {}
240 
241 SUMOVTypeParameter::SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vclass)
242  : id(vtid),
243  length(5. /*4.3*/),
244  minGap(2.5),
245  maxSpeed(200. / 3.6),
246  actionStepLength(0),
248  speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
249  emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)),
250  color(RGBColor::DEFAULT_COLOR),
251  vehicleClass(vclass),
252  impatience(0.0),
253  personCapacity(4),
255  boardingDuration(500),
256  loadingDuration(90000),
257  width(1.8),
258  height(1.5),
260  osgFile("car-normal-citrus.obj"),
263  maxSpeedLat(1.0),
264  latAlignmentOffset(0.0),
266  minGapLat(0.6),
267  carriageLength(-1),
268  locomotiveLength(-1),
269  carriageGap(1),
270  frontSeatPos(1.7),
271  parametersSet(0),
272  saved(false),
273  onlyReferenced(false) {
274  const OptionsCont& oc = OptionsCont::getOptions();
275  if (oc.exists("carfollow.model")) {
276  // check for valid value has been performed in MSFrame
277  cfModel = SUMOXMLDefinitions::CarFollowModels.get(oc.getString("carfollow.model"));
278  }
279  // obtain default values depending of vclass
280  VClassDefaultValues defaultValues(vclass);
281  // overwritte SUMOVTypeParameter with VClassDefaultValues
282  length = defaultValues.length;
283  minGap = defaultValues.minGap;
284  maxSpeed = defaultValues.maxSpeed;
285  width = defaultValues.width;
286  height = defaultValues.height;
287  shape = defaultValues.shape;
288  emissionClass = defaultValues.emissionClass;
289  speedFactor = defaultValues.speedFactor;
290  personCapacity = defaultValues.personCapacity;
291  containerCapacity = defaultValues.containerCapacity;
292  osgFile = defaultValues.osgFile;
293  carriageLength = defaultValues.carriageLength;
294  locomotiveLength = defaultValues.locomotiveLength;
295  // check if default speeddev was defined
296  if (oc.exists("default.speeddev")) {
297  const double defaultSpeedDev = oc.getFloat("default.speeddev");
298  if (defaultSpeedDev >= 0) {
299  speedFactor.getParameter()[1] = defaultSpeedDev;
300  }
301  } else {
302  speedFactor.getParameter()[1] = -1;
303  }
304  setManoeuverAngleTimes(vclass);
305 }
306 
307 void
309 
310  myManoeuverAngleTimes.clear();
318  switch (vclass) {
319  case SVC_PASSENGER:
320  case SVC_HOV:
321  case SVC_TAXI:
322  case SVC_E_VEHICLE:
323  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
324  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
325  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
326  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
327  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
328  break;
329  case SVC_TRUCK:
330  case SVC_TRAILER:
331  case SVC_BUS:
332  case SVC_COACH:
333  case SVC_DELIVERY:
334  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
335  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(2000, 21000))); // straight in
336  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(21000, 2000))); // optional forwards/backwards
337  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(14000, 5000))); // backwards into obtuse space
338  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
339  break;
340  case SVC_PEDESTRIAN:
341  case SVC_MOPED:
342  case SVC_BICYCLE:
343  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(1000, 1000))); // no dependence on angle
344  break;
345  default:
346  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
347  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
348  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
349  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
350  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
351  break;
352  }
353 }
354 
355 void
357  // first check if vehicle type can be written
358  if (onlyReferenced) {
359  return;
360  }
361  // open vehicle tag
362  dev.openTag(SUMO_TAG_VTYPE);
363  // write ID (always needed)
364  dev.writeAttr(SUMO_ATTR_ID, id);
365  // write parametes depending if is set
368  }
371  }
374  }
377  }
380  }
382  // Note: action step length is only exposed in seconds to the user
384  }
387  }
390  }
392  if (impatience == -std::numeric_limits<double>::max()) {
393  dev.writeAttr(SUMO_ATTR_IMPATIENCE, "off");
394  } else {
396  }
397  }
400  }
403  }
406  }
409  }
412  }
415  }
418  }
421  }
424  }
427  }
430  }
432  switch (latAlignmentProcedure) {
435  break;
437  dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "right");
438  break;
440  dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "center");
441  break;
443  dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "arbitrary");
444  break;
446  dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "nice");
447  break;
449  dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "compact");
450  break;
452  dev.writeAttr(SUMO_ATTR_LATALIGNMENT, "left");
453  break;
455  default:
456  break;
457  }
458  }
461  }
464  }
467  }
468  // Write Lane Change Model parameters
469  for (const auto& i : lcParameter) {
470  dev.writeAttr(i.first, i.second);
471  }
472  // Write Junction Model parameter
473  for (const auto& i : jmParameter) {
474  dev.writeAttr(i.first, i.second);
475  }
478  }
479  // Write Car Following Model parameters
480  for (const auto& i : cfParameter) {
481  dev.writeAttr(i.first, i.second);
482  }
483  // Write rest of parameters
484  writeParams(dev);
485  // close tag
486  dev.closeTag();
487 }
488 
489 
490 double
491 SUMOVTypeParameter::getCFParam(const SumoXMLAttr attr, const double defaultValue) const {
492  if (cfParameter.count(attr)) {
493  return StringUtils::toDouble(cfParameter.find(attr)->second);
494  } else {
495  return defaultValue;
496  }
497 }
498 
499 
500 std::string
501 SUMOVTypeParameter::getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
502  if (cfParameter.count(attr)) {
503  return cfParameter.find(attr)->second;
504  } else {
505  return defaultValue;
506  }
507 }
508 
509 
510 double
511 SUMOVTypeParameter::getLCParam(const SumoXMLAttr attr, const double defaultValue) const {
512  if (lcParameter.count(attr)) {
513  return StringUtils::toDouble(lcParameter.find(attr)->second);
514  } else {
515  return defaultValue;
516  }
517 }
518 
519 
520 std::string
521 SUMOVTypeParameter::getLCParamString(const SumoXMLAttr attr, const std::string& defaultValue) const {
522  if (lcParameter.count(attr)) {
523  return lcParameter.find(attr)->second;
524  } else {
525  return defaultValue;
526  }
527 }
528 
529 
532  return lcParameter;
533 }
534 
535 
536 double
537 SUMOVTypeParameter::getJMParam(const SumoXMLAttr attr, const double defaultValue) const {
538  if (jmParameter.count(attr)) {
539  return StringUtils::toDouble(jmParameter.find(attr)->second);
540  } else {
541  return defaultValue;
542  }
543 }
544 
545 
546 std::string
547 SUMOVTypeParameter::getJMParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
548  if (jmParameter.count(attr)) {
549  return jmParameter.find(attr)->second;
550  } else {
551  return defaultValue;
552  }
553 }
554 
555 SUMOTime
557  SUMOTime last = 0;
558  for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
559  if (angle <= angleTime.first) {
560  return (angleTime.second.first);
561  } else {
562  last = angleTime.second.first;
563  }
564  }
565  return (last);
566 }
567 
568 SUMOTime
570  SUMOTime last = 0;
571  for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
572  if (angle <= angleTime.first) {
573  return (angleTime.second.second);
574  } else {
575  last = angleTime.second.second;
576  }
577  }
578  return (last);
579 }
580 
581 std::string
583  std::stringstream stream;
584 
585  stream << std::fixed << std::setprecision(1);
586  int count = 0;
587  for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
588  if (count++ > 0) {
589  stream << ",";
590  }
591  stream << toString(angleTime.first) + " " << STEPS2TIME(angleTime.second.first) << " " << STEPS2TIME(angleTime.second.second);
592  }
593  std::string triplets = stream.str();
594  return triplets;
595 }
596 
597 
598 void
599 SUMOVTypeParameter::cacheParamRestrictions(const std::vector<std::string>& restrictionKeys) {
600  for (const std::string& key : restrictionKeys) {
602  }
603 }
604 
605 
606 void
608  if (knowsParameter("carriageLength")) {
611  } else {
612  switch (shape) {
614  carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180
615  carriageGap = 0;
616  break;
618  carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
619  break;
621  carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423
622  break;
624  carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen
625  break;
627  carriageLength = 13.5;
628  locomotiveLength = 2.5;
629  carriageGap = 0.5;
630  break;
632  carriageLength = 6.75;
633  locomotiveLength = 2.5 + 6.75;
634  carriageGap = 0.5;
635  break;
636  default:
637  break;
638  }
639  }
640  if (knowsParameter("locomotiveLength")) {
641  locomotiveLength = StringUtils::toDouble(getParameter("locomotiveLength"));
643  } else if (locomotiveLength <= 0) {
645  }
646  if (knowsParameter("carriageGap")) {
649  }
650  if (knowsParameter("frontSeatPos")) {
653  } else {
654  switch (shape) {
656  frontSeatPos = 5;
657  break;
659  frontSeatPos = 1.2;
660  break;
662  frontSeatPos = 0.6;
663  break;
666  frontSeatPos = 0.9;
667  break;
672  frontSeatPos = 0.5;
673  break;
677  frontSeatPos = 0.8;
678  break;
679  default:
680  break;
681  }
682  }
683 }
684 
685 
686 double
688  switch (vc) {
689  case SVC_PEDESTRIAN:
690  return 1.5;
691  case SVC_BICYCLE:
692  return 1.2;
693  case SVC_MOTORCYCLE:
694  return 6.;
695  case SVC_MOPED:
696  return 1.1;
697  case SVC_TRUCK:
698  return 1.3;
699  case SVC_TRAILER:
700  return 1.1;
701  case SVC_BUS:
702  return 1.2;
703  case SVC_COACH:
704  return 2.;
705  case SVC_TRAM:
706  return 1.;
707  case SVC_RAIL_URBAN:
708  return 1.;
709  case SVC_RAIL:
710  return 0.25;
711  case SVC_RAIL_ELECTRIC:
712  case SVC_RAIL_FAST:
713  return 0.5;
714  case SVC_SHIP:
715  return 0.1;
716  default:
717  return 2.6;//2.9;
718  }
719 }
720 
721 
722 double
724  switch (vc) {
725  case SVC_PEDESTRIAN:
726  return 2.;
727  case SVC_BICYCLE:
728  return 3.;
729  case SVC_MOPED:
730  return 7.;
731  case SVC_MOTORCYCLE:
732  return 10.;
733  case SVC_TRUCK:
734  case SVC_TRAILER:
735  case SVC_BUS:
736  case SVC_COACH:
737  return 4.;
738  case SVC_TRAM:
739  case SVC_RAIL_URBAN:
740  return 3.;
741  case SVC_RAIL:
742  case SVC_RAIL_ELECTRIC:
743  case SVC_RAIL_FAST:
744  return 1.3;
745  case SVC_SHIP:
746  return 0.15;
747  default:
748  return 4.5;//7.5;
749  }
750 }
751 
752 
753 double
754 SUMOVTypeParameter::getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption) {
755  if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT) {
756  double vcDecel;
757  switch (vc) {
758  case SVC_PEDESTRIAN:
759  vcDecel = 5.;
760  break;
761  case SVC_BICYCLE:
762  vcDecel = 7.;
763  break;
764  case SVC_MOPED:
765  case SVC_MOTORCYCLE:
766  vcDecel = 10.;
767  break;
768  case SVC_TRUCK:
769  case SVC_TRAILER:
770  case SVC_BUS:
771  case SVC_COACH:
772  case SVC_TRAM:
773  case SVC_RAIL_URBAN:
774  vcDecel = 7.;
775  break;
776  case SVC_RAIL:
777  case SVC_RAIL_ELECTRIC:
778  case SVC_RAIL_FAST:
779  vcDecel = 5.;
780  break;
781  case SVC_SHIP:
782  vcDecel = 1.;
783  break;
784  default:
785  vcDecel = 9.;
786  }
787  return MAX2(decel, vcDecel);
788  } else if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL) {
789  return decel;
790  } else {
791  // value already checked in MSFrame::checkOptions
792  return MAX2(decel, defaultOption);
793  }
794 }
795 
796 
797 
798 double
800  switch (vc) {
801  case SVC_TRAM:
802  case SVC_RAIL_URBAN:
803  case SVC_RAIL:
804  case SVC_RAIL_ELECTRIC:
805  case SVC_RAIL_FAST:
806  case SVC_SHIP:
807  return 0.;
808  default:
809  return 0.5;
810  }
811 }
812 
813 const SUMOVTypeParameter&
815  static SUMOVTypeParameter defaultParams("");
816  return defaultParams;
817 }
818 
819 bool
820 SUMOVTypeParameter::parseLatAlignment(const std::string& val, double& lao, LatAlignmentDefinition& lad) {
821  bool ok = true;
822  lao = 0.0;
824  if (val == "right") {
826  } else if (val == "center") {
828  } else if (val == "arbitrary") {
830  } else if (val == "nice") {
832  } else if (val == "compact") {
834  } else if (val == "left") {
836  } else {
837  try {
838  lao = StringUtils::toDouble(val);
839  } catch (...) {
840  ok = false;
841  }
842  }
843  return ok;
844 }
845 
846 /****************************************************************************/
@ DEFAULT
default cursor
#define STEPS2TIME(x)
Definition: SUMOTime.h:53
long long int SUMOTime
Definition: SUMOTime.h:32
#define EMPREFIX
const int VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_MANEUVER_ANGLE_TIMES_SET
const int VTYPEPARS_PERSON_CAPACITY
const int VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_VEHICLECLASS_SET
const int VTYPEPARS_FRONT_SEAT_POS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT
const int VTYPEPARS_SPEEDFACTOR_SET
const int VTYPEPARS_BOARDING_DURATION
const int VTYPEPARS_IMPATIENCE_SET
const int VTYPEPARS_LATALIGNMENT_SET
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_CARRIAGE_LENGTH_SET
const int VTYPEPARS_OSGFILE_SET
const int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
const int VTYPEPARS_MINGAP_SET
const int VTYPEPARS_IMGFILE_SET
const int VTYPEPARS_SHAPE_SET
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
const int VTYPEPARS_LOADING_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 int VTYPEPARS_CONTAINER_CAPACITY
const int VTYPEPARS_CARRIAGE_GAP_SET
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_PROBABILITY_SET
const int VTYPEPARS_CAR_FOLLOW_MODEL
const int VTYPEPARS_MINGAP_LAT_SET
const int VTYPEPARS_WIDTH_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 appearences.
@ 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
automated car (with cruise controllers)
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ UNKNOWN
not defined
@ BUS_TROLLEY
render as a trolley bus
@ 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
LaneChangeModel
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_MAXSPEED_LAT
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_MINGAP
@ 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_CONTAINER_CAPACITY
@ SUMO_ATTR_MINGAP_LAT
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_LATALIGNMENT
@ SUMO_ATTR_IMPATIENCE
@ SUMO_ATTR_VCLASS
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_PROB
@ 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
T MAX2(T a, T b)
Definition: StdDefs.h:80
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:58
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:248
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)
double height
This class' height.
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
double length
The physical vehicle length.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
bool wasSet(int what) const
Returns whether the given parameter was set.
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.
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 getLCParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
std::string osgFile
3D model file for this class
double maxSpeed
The vehicle type's 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...
int parametersSet
Information for the router which parameter were set.
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
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].
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 locomotiveLength
the length of train locomotive