Eclipse SUMO - Simulation of Urban MObility
MSVehicleType.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 /****************************************************************************/
22 // The car-following model and parameter
23 /****************************************************************************/
24 #include <config.h>
25 
26 #include <cassert>
33 #include "MSNet.h"
34 #include "cfmodels/MSCFModel_IDM.h"
44 #include "cfmodels/MSCFModel_W99.h"
45 #include "cfmodels/MSCFModel_ACC.h"
47 #include "MSVehicleControl.h"
48 #include "cfmodels/MSCFModel_CC.h"
49 #include "MSVehicleType.h"
50 
51 
52 // ===========================================================================
53 // static members
54 // ===========================================================================
56 
57 
58 // ===========================================================================
59 // method definitions
60 // ===========================================================================
62  myParameter(parameter),
63  myWarnedActionStepLengthTauOnce(false),
64  myWarnedActionStepLengthBallisticOnce(false),
65  myIndex(myNextIndex++),
66  myCarFollowModel(nullptr),
67  myOriginalType(nullptr) {
68  assert(getLength() > 0);
69  assert(getMaxSpeed() > 0);
70 
71  // Check if actionStepLength was set by user, if not init to global default
74  }
76 }
77 
78 
80  delete myCarFollowModel;
81 }
82 
83 
84 double
85 MSVehicleType::computeChosenSpeedDeviation(std::mt19937* rng, const double minDev) const {
86  return MAX2(minDev, myParameter.speedFactor.sample(rng));
87 }
88 
89 
90 // ------------ Setter methods
91 void
92 MSVehicleType::setLength(const double& length) {
93  if (myOriginalType != nullptr && length < 0) {
95  } else {
96  myParameter.length = length;
97  }
99 }
100 
101 
102 void
103 MSVehicleType::setHeight(const double& height) {
104  if (myOriginalType != nullptr && height < 0) {
106  } else {
107  myParameter.height = height;
108  }
110 }
111 
112 
113 void
114 MSVehicleType::setMinGap(const double& minGap) {
115  if (myOriginalType != nullptr && minGap < 0) {
117  } else {
118  myParameter.minGap = minGap;
119  }
121 }
122 
123 
124 void
125 MSVehicleType::setMinGapLat(const double& minGapLat) {
126  if (myOriginalType != nullptr && minGapLat < 0) {
128  } else {
129  myParameter.minGapLat = minGapLat;
130  }
132 }
133 
134 
135 void
136 MSVehicleType::setMaxSpeed(const double& maxSpeed) {
137  if (myOriginalType != nullptr && maxSpeed < 0) {
139  } else {
140  myParameter.maxSpeed = maxSpeed;
141  }
143 }
144 
145 
146 void
147 MSVehicleType::setMaxSpeedLat(const double& maxSpeedLat) {
148  if (myOriginalType != nullptr && maxSpeedLat < 0) {
150  } else {
151  myParameter.maxSpeedLat = maxSpeedLat;
152  }
154 }
155 
156 
157 void
159  myParameter.vehicleClass = vclass;
161 }
162 
163 void
165  myParameter.latAlignment = latAlignment;
167 }
168 
169 
170 void
172  if (myOriginalType != nullptr && prob < 0) {
174  } else {
176  }
178 }
179 
180 
181 void
182 MSVehicleType::setSpeedFactor(const double& factor) {
183  if (myOriginalType != nullptr && factor < 0) {
185  } else {
186  myParameter.speedFactor.getParameter()[0] = factor;
187  }
189 }
190 
191 
192 void
194  if (myOriginalType != nullptr && dev < 0) {
196  } else {
198  }
200 }
201 
202 
203 void
204 MSVehicleType::setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset) {
205  assert(actionStepLength >= 0.);
207 
208  if (myParameter.actionStepLength == actionStepLength) {
209  return;
210  }
211 
212  SUMOTime previousActionStepLength = myParameter.actionStepLength;
213  myParameter.actionStepLength = actionStepLength;
215  check();
216 
217  if (isVehicleSpecific()) {
218  // don't perform vehicle lookup for singular vtype
219  return;
220  }
221 
222  // For non-singular vType reset all vehicle's actionOffsets
223  // Iterate through vehicles
225  for (auto vehIt = vc.loadedVehBegin(); vehIt != vc.loadedVehEnd(); ++vehIt) {
226  MSVehicle* veh = static_cast<MSVehicle*>(vehIt->second);
227  if (&veh->getVehicleType() == this) {
228  // Found vehicle of this type. Perform requested actionOffsetReset
229  if (resetActionOffset) {
230  veh->resetActionOffset();
231  } else {
232  veh->updateActionOffset(previousActionStepLength, actionStepLength);
233  }
234  }
235  }
236 }
237 
238 
239 void
241  myParameter.emissionClass = eclass;
243 }
244 
245 
246 void
248  myParameter.color = color;
250 }
251 
252 
253 void
254 MSVehicleType::setWidth(const double& width) {
255  if (myOriginalType != nullptr && width < 0) {
257  } else {
258  myParameter.width = width;
259  }
261 }
262 
263 void
264 MSVehicleType::setImpatience(const double impatience) {
265  if (myOriginalType != nullptr && impatience < 0) {
267  } else {
268  myParameter.impatience = impatience;
269  }
271 }
272 
273 
274 void
276  myParameter.shape = shape;
278 }
279 
280 
281 
282 // ------------ Static methods for building vehicle types
285  MSVehicleType* vtype = new MSVehicleType(from);
288  // by default decel and apparentDecel are identical
289  const double apparentDecel = from.getCFParam(SUMO_ATTR_APPARENTDECEL, decel);
290 
291  if (emergencyDecel < decel) {
292  WRITE_WARNING("Value of 'emergencyDecel' (" + toString(emergencyDecel) + ") should be higher than 'decel' (" + toString(decel) + ") for vType '" + from.id + "'.");
293  }
294  if (emergencyDecel < apparentDecel) {
295  WRITE_WARNING("Value of 'emergencyDecel' (" + toString(emergencyDecel) + ") is lower than 'apparentDecel' (" + toString(apparentDecel) + ") for vType '" + from.id + "' may cause collisions.");
296  }
297 
298  switch (from.cfModel) {
299  case SUMO_TAG_CF_IDM:
300  vtype->myCarFollowModel = new MSCFModel_IDM(vtype, false);
301  break;
302  case SUMO_TAG_CF_IDMM:
303  vtype->myCarFollowModel = new MSCFModel_IDM(vtype, true);
304  break;
305  case SUMO_TAG_CF_BKERNER:
306  vtype->myCarFollowModel = new MSCFModel_Kerner(vtype);
307  break;
309  vtype->myCarFollowModel = new MSCFModel_KraussOrig1(vtype);
310  break;
312  vtype->myCarFollowModel = new MSCFModel_KraussPS(vtype);
313  break;
314  case SUMO_TAG_CF_KRAUSSX:
315  vtype->myCarFollowModel = new MSCFModel_KraussX(vtype);
316  break;
318  vtype->myCarFollowModel = new MSCFModel_SmartSK(vtype);
319  break;
320  case SUMO_TAG_CF_DANIEL1:
321  vtype->myCarFollowModel = new MSCFModel_Daniel1(vtype);
322  break;
324  vtype->myCarFollowModel = new MSCFModel_PWag2009(vtype);
325  break;
327  vtype->myCarFollowModel = new MSCFModel_Wiedemann(vtype);
328  break;
329  case SUMO_TAG_CF_W99:
330  vtype->myCarFollowModel = new MSCFModel_W99(vtype);
331  break;
332  case SUMO_TAG_CF_RAIL:
333  vtype->myCarFollowModel = new MSCFModel_Rail(vtype);
334  break;
335  case SUMO_TAG_CF_ACC:
336  vtype->myCarFollowModel = new MSCFModel_ACC(vtype);
337  break;
338  case SUMO_TAG_CF_CACC:
339  vtype->myCarFollowModel = new MSCFModel_CACC(vtype);
340  break;
341  case SUMO_TAG_CF_CC:
342  vtype->myCarFollowModel = new MSCFModel_CC(vtype);
343  break;
344  case SUMO_TAG_CF_KRAUSS:
345  default:
346  vtype->myCarFollowModel = new MSCFModel_Krauss(vtype);
347  break;
348  }
349  // init Rail visualization parameters
351  vtype->check();
352  return vtype;
353 }
354 
355 SUMOTime
356 MSVehicleType::getEntryManoeuvreTime(const int angle) const {
357  return (getParameter().getEntryManoeuvreTime(angle));
358 }
359 
360 SUMOTime
361 MSVehicleType::getExitManoeuvreTime(const int angle) const {
362  return (getParameter().getExitManoeuvreTime(angle));
363 }
364 
366 MSVehicleType::buildSingularType(const std::string& id) const {
367  return duplicateType(id, false);
368 }
369 
370 
372 MSVehicleType::duplicateType(const std::string& id, bool persistent) const {
374  vtype->myParameter.id = id;
376  if (!persistent) {
377  vtype->myOriginalType = this;
378  }
379  if (!MSNet::getInstance()->getVehicleControl().addVType(vtype)) {
380  std::string singular = persistent ? "" : "singular ";
381  throw ProcessError("could not add " + singular + "type " + vtype->getID());
382  }
383  return vtype;
384 }
385 
386 void
390  && STEPS2TIME(myParameter.actionStepLength) > getCarFollowModel().getHeadwayTime()) {
392  std::stringstream s;
393  s << "Given action step length " << STEPS2TIME(myParameter.actionStepLength) << " for vehicle type '" << getID()
394  << "' is larger than its parameter tau (=" << getCarFollowModel().getHeadwayTime() << ")!"
395  << " This may lead to collisions. (This warning is only issued once per vehicle type).";
396  WRITE_WARNING(s.str());
397  }
402  std::string warning2;
403  if (OptionsCont::getOptions().isDefault("step-method.ballistic")) {
404  warning2 = " Setting it now to avoid collisions.";
406  } else {
407  warning2 = " This may cause collisions.";
408  }
409  WRITE_WARNINGF("Action step length '%' is used for vehicle type '%' but step-method.ballistic was not set." + warning2
411  }
412 }
413 
414 void
415 MSVehicleType::setAccel(double accel) {
416  if (myOriginalType != nullptr && accel < 0) {
418  }
421 }
422 
423 void
424 MSVehicleType::setDecel(double decel) {
425  if (myOriginalType != nullptr && decel < 0) {
427  }
430 }
431 
432 void
433 MSVehicleType::setEmergencyDecel(double emergencyDecel) {
434  if (myOriginalType != nullptr && emergencyDecel < 0) {
435  emergencyDecel = myOriginalType->getCarFollowModel().getEmergencyDecel();
436  }
437  myCarFollowModel->setEmergencyDecel(emergencyDecel);
439 }
440 
441 void
442 MSVehicleType::setApparentDecel(double apparentDecel) {
443  if (myOriginalType != nullptr && apparentDecel < 0) {
445  }
446  myCarFollowModel->setApparentDecel(apparentDecel);
448 }
449 
450 void
451 MSVehicleType::setImperfection(double imperfection) {
452  if (myOriginalType != nullptr && imperfection < 0) {
454  }
455  myCarFollowModel->setImperfection(imperfection);
457 }
458 
459 void
461  if (myOriginalType != nullptr && tau < 0) {
463  }
466 }
467 
468 
469 void
471  if (myParameter.knowsParameter("carriageLength")) {
473  } else if (myParameter.wasSet(VTYPEPARS_SHAPE_SET)) {
474  switch (myParameter.shape) {
475  case SVS_BUS_FLEXIBLE:
476  myParameter.carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180
478  break;
479  case SVS_RAIL:
480  myParameter.carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
481  break;
482  case SVS_RAIL_CAR:
483  myParameter.carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423
484  break;
485  case SVS_RAIL_CARGO:
486  myParameter.carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen
487  break;
491  myParameter.carriageGap = 0.5;
492  break;
493  case SVS_TRUCK_1TRAILER:
495  myParameter.locomotiveLength = 2.5 + 6.75;
496  myParameter.carriageGap = 0.5;
497  break;
498  default:
499  break;
500  }
501  }
502  if (myParameter.knowsParameter("locomotiveLength")) {
504  } else if (myParameter.locomotiveLength <= 0) {
506  }
507  if (myParameter.knowsParameter("carriageGap")) {
509  }
510 }
511 
512 
513 /****************************************************************************/
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:277
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
SUMOTime DELTA_T
Definition: SUMOTime.cpp:37
#define STEPS2TIME(x)
Definition: SUMOTime.h:53
long long int SUMOTime
Definition: SUMOTime.h:31
const int VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_VEHICLECLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SPEEDFACTOR_SET
const int VTYPEPARS_IMPATIENCE_SET
const int VTYPEPARS_LATALIGNMENT_SET
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_MINGAP_SET
const int VTYPEPARS_SHAPE_SET
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_PROBABILITY_SET
const int VTYPEPARS_MINGAP_LAT_SET
const int VTYPEPARS_WIDTH_SET
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
int SUMOEmissionClass
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ SVS_RAIL
render as a rail
@ SVS_BUS_FLEXIBLE
render as a flexible city bus
@ SVS_RAIL_CARGO
render as a cargo train
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ SUMO_TAG_CF_KRAUSS
@ SUMO_TAG_CF_BKERNER
@ SUMO_TAG_CF_KRAUSSX
@ SUMO_TAG_CF_CACC
@ SUMO_TAG_CF_CC
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_TAG_CF_IDM
@ SUMO_TAG_CF_W99
@ SUMO_TAG_CF_RAIL
@ SUMO_TAG_CF_SMART_SK
@ SUMO_TAG_CF_PWAGNER2009
@ SUMO_TAG_CF_KRAUSS_ORIG1
@ SUMO_TAG_CF_WIEDEMANN
@ SUMO_TAG_CF_IDMM
@ SUMO_TAG_CF_DANIEL1
@ SUMO_TAG_CF_ACC
LateralAlignment
Numbers representing special SUMO-XML-attribute values Information how vehicles align themselves with...
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_DECEL
@ SUMO_ATTR_EMERGENCYDECEL
@ SUMO_ATTR_ACCEL
@ SUMO_ATTR_SIGMA
@ SUMO_ATTR_TAU
T MAX2(T a, T b)
Definition: StdDefs.h:79
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
The ACC car-following model.
Definition: MSCFModel_ACC.h:47
The CACC car-following model.
A set of automatic Cruise Controllers, including classic Cruise Control (CC), Adaptive Cruise Control...
Definition: MSCFModel_CC.h:56
The original Krauss (1998) car-following model and parameter.
The Intelligent Driver Model (IDM) car-following model.
Definition: MSCFModel_IDM.h:39
car-following model by B. Kerner
Krauss car-following model, with acceleration decrease and faster start.
The original Krauss (1998) car-following model and parameter.
Krauss car-following model, changing accel and speed by slope.
Krauss car-following model, changing accel and speed by slope.
Scalable model based on Krauss by Peter Wagner.
The original Krauss (1998) car-following model and parameter.
The W99 Model car-following model.
Definition: MSCFModel_W99.h:40
The Wiedemann Model car-following model.
virtual void setImperfection(double imperfection)
Sets a new value for driver imperfection.
Definition: MSCFModel.h:498
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
Definition: MSCFModel.h:224
virtual void setHeadwayTime(double headwayTime)
Sets a new value for desired headway [s].
Definition: MSCFModel.h:506
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const =0
Duplicates the car-following model.
virtual void setEmergencyDecel(double decel)
Sets a new value for maximal physically possible deceleration [m/s^2].
Definition: MSCFModel.h:482
virtual void setMaxAccel(double accel)
Sets a new value for maximum acceleration [m/s^2].
Definition: MSCFModel.h:466
virtual void setMaxDecel(double decel)
Sets a new value for maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:474
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
Definition: MSCFModel.h:232
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Definition: MSCFModel.h:208
virtual double getImperfection() const
Get the driver's imperfection.
Definition: MSCFModel.h:249
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:216
virtual void setApparentDecel(double decel)
Sets a new value for the apparent deceleration [m/s^2].
Definition: MSCFModel.h:490
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
Definition: MSCFModel.h:257
static double gDefaultEmergencyDecel
encoding of the string-option default.emergencydecel
Definition: MSGlobals.h:106
static bool gSemiImplicitEulerUpdate
Definition: MSGlobals.h:53
static SUMOTime gActionStepLength
default value for the interval between two action points for MSVehicle (defaults to DELTA_T)
Definition: MSGlobals.h:100
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:171
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:371
The class responsible for building and deletion of vehicles.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
Definition: MSVehicle.cpp:1843
void updateActionOffset(const SUMOTime oldActionStepLength, const SUMOTime newActionStepLength)
Process an updated action step length value (only affects the vehicle's action offset,...
Definition: MSVehicle.cpp:1849
The car-following model and parameter.
Definition: MSVehicleType.h:62
void setHeight(const double &height)
Set a new value for this type's height.
double getDefaultProbability() const
Get the default probability of this vehicle type.
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double myCachedActionStepLengthSecs
the vtypes actionsStepLength in seconds (cached because needed very often)
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
static MSVehicleType * build(SUMOVTypeParameter &from)
Builds the microsim vehicle type described by the given parameter.
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
MSVehicleType(const SUMOVTypeParameter &parameter)
Constructor.
void setDefaultProbability(const double &prob)
Set a new value for this type's default probability.
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
bool myWarnedActionStepLengthTauOnce
Indicator whether the user was already warned once about an action step length larger than the desire...
MSCFModel * myCarFollowModel
instance of the car following model.
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
double getMinGap() const
Get the free space in front of vehicles of this class.
MSVehicleType * duplicateType(const std::string &id, bool persistent) const
Duplicates the microsim vehicle type giving the newly created type the given id.
SUMOVTypeParameter myParameter
the parameter container
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
void initRailVisualizationParameters()
init Rail Visualization Parameters
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
const MSVehicleType * myOriginalType
The original type.
void setLength(const double &length)
Set a new value for this type's length.
void setDecel(double decel)
Set a new value for this type's deceleration.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
SUMOTime getExitManoeuvreTime(const int angle) const
Accessor function for parameter equivalent returning exit time for a specific manoeuver angle.
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
void setAccel(double accel)
Set a new value for this type's acceleration.
void setWidth(const double &width)
Set a new value for this type's width.
void setColor(const RGBColor &color)
Set a new value for this type's color.
bool isVehicleSpecific() const
Returns whether this type belongs to a single vehicle only (was modified)
void setImpatience(const double impatience)
Set a new value for this type's impatience.
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
static int myNextIndex
next value for the running index
void setTau(double tau)
Set a new value for this type's headway.
double computeChosenSpeedDeviation(std::mt19937 *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:90
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
double getLength() const
Get vehicle's length [m].
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
SUMOTime getEntryManoeuvreTime(const int angle) const
Accessor function for parameter equivalent returning entry time for a specific manoeuver angle.
double getImpatience() const
Returns this type's impatience.
const SUMOVTypeParameter & getParameter() const
virtual ~MSVehicleType()
Destructor.
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
void check()
Checks whether vehicle type parameters may be problematic (Currently, only the value for the action s...
bool myWarnedActionStepLengthBallisticOnce
MSVehicleType * buildSingularType(const std::string &id) const
Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicl...
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
Structure representing possible vehicle parameter.
double width
This class' width.
SubParams cfParameter
Car-following parameter.
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....
double height
This class' height.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
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.
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 ...
RGBColor color
The color.
double minGap
This class' free space in front of the vehicle itself.
SUMOVehicleShape shape
This class' shape.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
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.
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.
std::string id
The vehicle type's id.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
double impatience
The vehicle's impatience (willingness to obstruct others)
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter