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-2020 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(SVS_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.8;
79  height = 1.7;
80  shape = SVS_MOPED;
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;
97  shape = SVS_TRUCK;
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;
119  shape = SVS_BUS;
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;
161  shape = SVS_RAIL;
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;
173  shape = SVS_RAIL;
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;
184  shape = SVS_RAIL;
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;
227  shape = SVS_SHIP;
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 
242 SUMOVTypeParameter::SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vclass) :
243  id(vtid), length(5./*4.3*/), minGap(2.5), maxSpeed(200. / 3.6),
245  speedFactor("normc", 1.0, 0.0, 0.2, 2.0),
246  emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)), color(RGBColor::DEFAULT_COLOR),
248  loadingDuration(90000), width(1.8), height(1.5), shape(SVS_UNKNOWN), osgFile("car-normal-citrus.obj"),
253  parametersSet(0), saved(false), onlyReferenced(false) {
254  const OptionsCont& oc = OptionsCont::getOptions();
255  if (oc.exists("carfollow.model")) {
256  // check for valid value has been performed in MSFrame
257  cfModel = SUMOXMLDefinitions::CarFollowModels.get(oc.getString("carfollow.model"));
258  }
259  // obtain default values depending of vclass
260  VClassDefaultValues defaultValues(vclass);
261  // overwritte SUMOVTypeParameter with VClassDefaultValues
262  length = defaultValues.length;
263  minGap = defaultValues.minGap;
264  maxSpeed = defaultValues.maxSpeed;
265  width = defaultValues.width;
266  height = defaultValues.height;
267  shape = defaultValues.shape;
268  emissionClass = defaultValues.emissionClass;
269  speedFactor = defaultValues.speedFactor;
270  personCapacity = defaultValues.personCapacity;
271  containerCapacity = defaultValues.containerCapacity;
272  osgFile = defaultValues.osgFile;
273  carriageLength = defaultValues.carriageLength;
274  locomotiveLength = defaultValues.locomotiveLength;
275  // check if default speeddev was defined
276  if (oc.exists("default.speeddev")) {
277  const double defaultSpeedDev = oc.getFloat("default.speeddev");
278  if (defaultSpeedDev >= 0) {
279  speedFactor.getParameter()[1] = defaultSpeedDev;
280  }
281  } else {
282  speedFactor.getParameter()[1] = 0;
283  }
284  setManoeuverAngleTimes(vclass);
285 }
286 
287 void
289 
290  myManoeuverAngleTimes.clear();
298  switch (vclass) {
299  case SVC_PASSENGER:
300  case SVC_HOV:
301  case SVC_TAXI:
302  case SVC_E_VEHICLE:
303  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
304  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
305  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
306  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
307  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
308  break;
309  case SVC_TRUCK:
310  case SVC_TRAILER:
311  case SVC_BUS:
312  case SVC_COACH:
313  case SVC_DELIVERY:
314  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
315  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(2000, 21000))); // straight in
316  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(21000, 2000))); // optional forwards/backwards
317  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(14000, 5000))); // backwards into obtuse space
318  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(6000, 8000))); // straight in but potentially needing parallel parking
319  break;
320  case SVC_PEDESTRIAN:
321  case SVC_MOPED:
322  case SVC_BICYCLE:
323  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(1000, 1000))); // no dependence on angle
324  break;
325  default:
326  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
327  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000))); // straight in
328  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000))); // optional forwards/backwards
329  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000))); // backwards into obtuse space
330  myManoeuverAngleTimes.insert(std::pair<int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000))); // straight in but potentially needing parallel parking
331  break;
332  }
333 }
334 
335 void
337  // first check if vehicle type can be written
338  if (onlyReferenced) {
339  return;
340  }
341  // open vehicle tag
342  dev.openTag(SUMO_TAG_VTYPE);
343  // write ID (always needed)
344  dev.writeAttr(SUMO_ATTR_ID, id);
345  // write parametes depending if is set
348  }
351  }
354  }
357  }
360  }
362  // Note: action step length is only exposed in seconds to the user
364  }
367  }
370  }
372  if (impatience == -std::numeric_limits<double>::max()) {
373  dev.writeAttr(SUMO_ATTR_IMPATIENCE, "off");
374  } else {
376  }
377  }
380  }
383  }
386  }
389  }
392  }
395  }
398  }
401  }
404  }
407  }
410  }
413  }
416  }
419  }
422  }
423  // Write Lane Change Model parameters
424  for (const auto& i : lcParameter) {
425  dev.writeAttr(i.first, i.second);
426  }
427  // Write Junction Model parameter
428  for (const auto& i : jmParameter) {
429  dev.writeAttr(i.first, i.second);
430  }
433  }
434  // Write Car Following Model parameters
435  for (const auto& i : cfParameter) {
436  dev.writeAttr(i.first, i.second);
437  }
438  // Write rest of parameters
439  writeParams(dev);
440  // close tag
441  dev.closeTag();
442 }
443 
444 
445 double
446 SUMOVTypeParameter::getCFParam(const SumoXMLAttr attr, const double defaultValue) const {
447  if (cfParameter.count(attr)) {
448  return StringUtils::toDouble(cfParameter.find(attr)->second);
449  } else {
450  return defaultValue;
451  }
452 }
453 
454 
455 std::string
456 SUMOVTypeParameter::getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
457  if (cfParameter.count(attr)) {
458  return cfParameter.find(attr)->second;
459  } else {
460  return defaultValue;
461  }
462 }
463 
464 
465 double
466 SUMOVTypeParameter::getLCParam(const SumoXMLAttr attr, const double defaultValue) const {
467  if (lcParameter.count(attr)) {
468  return StringUtils::toDouble(lcParameter.find(attr)->second);
469  } else {
470  return defaultValue;
471  }
472 }
473 
474 
475 std::string
476 SUMOVTypeParameter::getLCParamString(const SumoXMLAttr attr, const std::string& defaultValue) const {
477  if (lcParameter.count(attr)) {
478  return lcParameter.find(attr)->second;
479  } else {
480  return defaultValue;
481  }
482 }
483 
484 
487  return lcParameter;
488 }
489 
490 
491 double
492 SUMOVTypeParameter::getJMParam(const SumoXMLAttr attr, const double defaultValue) const {
493  if (jmParameter.count(attr)) {
494  return StringUtils::toDouble(jmParameter.find(attr)->second);
495  } else {
496  return defaultValue;
497  }
498 }
499 
500 
501 std::string
502 SUMOVTypeParameter::getJMParamString(const SumoXMLAttr attr, const std::string defaultValue) const {
503  if (jmParameter.count(attr)) {
504  return jmParameter.find(attr)->second;
505  } else {
506  return defaultValue;
507  }
508 }
509 
510 SUMOTime
512  SUMOTime last = 0;
513  for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
514  if (angle <= angleTime.first) {
515  return (angleTime.second.first);
516  } else {
517  last = angleTime.second.first;
518  }
519  }
520  return (last);
521 }
522 
523 SUMOTime
525  SUMOTime last = 0;
526  for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
527  if (angle <= angleTime.first) {
528  return (angleTime.second.second);
529  } else {
530  last = angleTime.second.second;
531  }
532  }
533  return (last);
534 }
535 
536 std::string
538  std::stringstream stream;
539 
540  stream << std::fixed << std::setprecision(1);
541  int count = 0;
542  for (std::pair<int, std::pair<SUMOTime, SUMOTime>> angleTime : myManoeuverAngleTimes) {
543  if (count++ > 0) {
544  stream << ",";
545  }
546  stream << toString(angleTime.first) + " " << STEPS2TIME(angleTime.second.first) << " " << STEPS2TIME(angleTime.second.second);
547  }
548  std::string triplets = stream.str();
549  return triplets;
550 }
551 
552 
553 void
554 SUMOVTypeParameter::cacheParamRestrictions(const std::vector<std::string>& restrictionKeys) {
555  for (const std::string& key : restrictionKeys) {
557  }
558 }
559 
560 
561 double
563  switch (vc) {
564  case SVC_PEDESTRIAN:
565  return 1.5;
566  case SVC_BICYCLE:
567  return 1.2;
568  case SVC_MOTORCYCLE:
569  return 6.;
570  case SVC_MOPED:
571  return 1.1;
572  case SVC_TRUCK:
573  return 1.3;
574  case SVC_TRAILER:
575  return 1.1;
576  case SVC_BUS:
577  return 1.2;
578  case SVC_COACH:
579  return 2.;
580  case SVC_TRAM:
581  return 1.;
582  case SVC_RAIL_URBAN:
583  return 1.;
584  case SVC_RAIL:
585  return 0.25;
586  case SVC_RAIL_ELECTRIC:
587  case SVC_RAIL_FAST:
588  return 0.5;
589  case SVC_SHIP:
590  return 0.1;
591  default:
592  return 2.6;//2.9;
593  }
594 }
595 
596 
597 double
599  switch (vc) {
600  case SVC_PEDESTRIAN:
601  return 2.;
602  case SVC_BICYCLE:
603  return 3.;
604  case SVC_MOPED:
605  return 7.;
606  case SVC_MOTORCYCLE:
607  return 10.;
608  case SVC_TRUCK:
609  case SVC_TRAILER:
610  case SVC_BUS:
611  case SVC_COACH:
612  return 4.;
613  case SVC_TRAM:
614  case SVC_RAIL_URBAN:
615  return 3.;
616  case SVC_RAIL:
617  case SVC_RAIL_ELECTRIC:
618  case SVC_RAIL_FAST:
619  return 1.3;
620  case SVC_SHIP:
621  return 0.15;
622  default:
623  return 4.5;//7.5;
624  }
625 }
626 
627 
628 double
629 SUMOVTypeParameter::getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption) {
630  if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT) {
631  double vcDecel;
632  switch (vc) {
633  case SVC_PEDESTRIAN:
634  vcDecel = 5.;
635  break;
636  case SVC_BICYCLE:
637  vcDecel = 7.;
638  break;
639  case SVC_MOPED:
640  case SVC_MOTORCYCLE:
641  vcDecel = 10.;
642  break;
643  case SVC_TRUCK:
644  case SVC_TRAILER:
645  case SVC_BUS:
646  case SVC_COACH:
647  case SVC_TRAM:
648  case SVC_RAIL_URBAN:
649  vcDecel = 7.;
650  break;
651  case SVC_RAIL:
652  case SVC_RAIL_ELECTRIC:
653  case SVC_RAIL_FAST:
654  vcDecel = 5.;
655  break;
656  case SVC_SHIP:
657  vcDecel = 1.;
658  break;
659  default:
660  vcDecel = 9.;
661  }
662  return MAX2(decel, vcDecel);
663  } else if (defaultOption == VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL) {
664  return decel;
665  } else {
666  // value already checked in MSFrame::checkOptions
667  return MAX2(decel, defaultOption);
668  }
669 }
670 
671 
672 
673 double
675  switch (vc) {
676  case SVC_TRAM:
677  case SVC_RAIL_URBAN:
678  case SVC_RAIL:
679  case SVC_RAIL_ELECTRIC:
680  case SVC_RAIL_FAST:
681  case SVC_SHIP:
682  return 0.;
683  default:
684  return 0.5;
685  }
686 }
687 
688 const SUMOVTypeParameter&
690  static SUMOVTypeParameter defaultParams("");
691  return defaultParams;
692 }
693 
694 
695 /****************************************************************************/
#define STEPS2TIME(x)
Definition: SUMOTime.h:53
long long int SUMOTime
Definition: SUMOTime.h:31
#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_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_OSGFILE_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
const int VTYPEPARS_CONTAINER_CAPACITY
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
@ SVS_BICYCLE
render as a bicycle
@ SVS_RAIL
render as a rail
@ SVS_DELIVERY
automated car (with cruise controllers)
@ SVS_MOTORCYCLE
render as a motorcycle
@ SVS_UNKNOWN
not defined
@ SVS_PASSENGER
render as a passenger vehicle
@ SVS_TRUCK
render as a transport vehicle
@ SVS_BUS
render as a bus
@ SVS_MOPED
render as a moped
@ SVS_E_VEHICLE
render as a (futuristic) e-vehicle
@ SVS_BUS_COACH
render as a coach
@ SVS_SHIP
render as a arbitrary ship
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
@ SVS_PEDESTRIAN
render as a pedestrian
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
const double DEFAULT_PEDESTRIAN_SPEED
@ SUMO_TAG_CF_KRAUSS
@ SUMO_TAG_VTYPE
description of a vehicle type
@ LATALIGN_CENTER
drive in the middle
@ LCM_DEFAULT
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:79
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
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:60
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:239
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
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
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.
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].
LateralAlignment latAlignment
The vehicles desired lateral alignment.
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.
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.
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 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