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-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 /****************************************************************************/
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"
45 #include "cfmodels/MSCFModel_W99.h"
46 #include "cfmodels/MSCFModel_ACC.h"
48 #include "MSVehicleControl.h"
49 #include "cfmodels/MSCFModel_CC.h"
50 #include "MSVehicleType.h"
51 
52 
53 // ===========================================================================
54 // static members
55 // ===========================================================================
57 
58 
59 // ===========================================================================
60 // method definitions
61 // ===========================================================================
63  myParameter(parameter),
64  myWarnedActionStepLengthTauOnce(false),
65  myWarnedActionStepLengthBallisticOnce(false),
66  myWarnedStepLengthTauOnce(false),
67  myIndex(myNextIndex++),
68  myCarFollowModel(nullptr),
69  myOriginalType(nullptr) {
70  assert(getLength() > 0);
71  assert(getMaxSpeed() > 0);
72 
73  // Check if actionStepLength was set by user, if not init to global default
76  }
78 }
79 
80 
82  delete myCarFollowModel;
83 }
84 
85 
86 double
87 MSVehicleType::computeChosenSpeedDeviation(SumoRNG* rng, const double minDev) const {
88  return MAX2(minDev, myParameter.speedFactor.sample(rng));
89 }
90 
91 
92 // ------------ Setter methods
93 void
94 MSVehicleType::setLength(const double& length) {
95  if (myOriginalType != nullptr && length < 0) {
97  } else {
98  myParameter.length = length;
99  }
101 }
102 
103 
104 void
105 MSVehicleType::setHeight(const double& height) {
106  if (myOriginalType != nullptr && height < 0) {
108  } else {
109  myParameter.height = height;
110  }
112 }
113 
114 
115 void
116 MSVehicleType::setMinGap(const double& minGap) {
117  if (myOriginalType != nullptr && minGap < 0) {
119  } else {
120  myParameter.minGap = minGap;
121  }
123 }
124 
125 
126 void
127 MSVehicleType::setMinGapLat(const double& minGapLat) {
128  if (myOriginalType != nullptr && minGapLat < 0) {
130  } else {
131  myParameter.minGapLat = minGapLat;
132  }
134 }
135 
136 
137 void
138 MSVehicleType::setMaxSpeed(const double& maxSpeed) {
139  if (myOriginalType != nullptr && maxSpeed < 0) {
141  } else {
142  myParameter.maxSpeed = maxSpeed;
143  }
145 }
146 
147 
148 void
149 MSVehicleType::setMaxSpeedLat(const double& maxSpeedLat) {
150  if (myOriginalType != nullptr && maxSpeedLat < 0) {
152  } else {
153  myParameter.maxSpeedLat = maxSpeedLat;
154  }
156 }
157 
158 
159 void
161  myParameter.vehicleClass = vclass;
163 }
164 
165 
166 void
167 MSVehicleType::setPreferredLateralAlignment(const LatAlignmentDefinition& latAlignment, double latAlignmentOffset) {
168  myParameter.latAlignmentProcedure = latAlignment;
169  myParameter.latAlignmentOffset = latAlignmentOffset;
171 }
172 
173 
174 void
176  if (myOriginalType != nullptr && prob < 0) {
178  } else {
180  }
182 }
183 
184 
185 void
186 MSVehicleType::setSpeedFactor(const double& factor) {
187  if (myOriginalType != nullptr && factor < 0) {
189  } else {
190  myParameter.speedFactor.getParameter()[0] = factor;
191  }
193 }
194 
195 
196 void
198  if (myOriginalType != nullptr && dev < 0) {
200  } else {
202  }
204 }
205 
206 
207 void
208 MSVehicleType::setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset) {
209  assert(actionStepLength >= 0.);
211 
212  if (myParameter.actionStepLength == actionStepLength) {
213  return;
214  }
215 
216  SUMOTime previousActionStepLength = myParameter.actionStepLength;
217  myParameter.actionStepLength = actionStepLength;
219  check();
220 
221  if (isVehicleSpecific()) {
222  // don't perform vehicle lookup for singular vtype
223  return;
224  }
225 
226  // For non-singular vType reset all vehicle's actionOffsets
227  // Iterate through vehicles
229  for (auto vehIt = vc.loadedVehBegin(); vehIt != vc.loadedVehEnd(); ++vehIt) {
230  MSVehicle* veh = static_cast<MSVehicle*>(vehIt->second);
231  if (&veh->getVehicleType() == this) {
232  // Found vehicle of this type. Perform requested actionOffsetReset
233  if (resetActionOffset) {
234  veh->resetActionOffset();
235  } else {
236  veh->updateActionOffset(previousActionStepLength, actionStepLength);
237  }
238  }
239  }
240 }
241 
242 
243 void
245  myParameter.emissionClass = eclass;
247 }
248 
249 
250 void
252  myParameter.color = color;
254 }
255 
256 
257 void
258 MSVehicleType::setWidth(const double& width) {
259  if (myOriginalType != nullptr && width < 0) {
261  } else {
262  myParameter.width = width;
263  }
265 }
266 
267 void
268 MSVehicleType::setImpatience(const double impatience) {
269  if (myOriginalType != nullptr && impatience < 0) {
271  } else {
272  myParameter.impatience = impatience;
273  }
275 }
276 
277 
278 void
280  myParameter.shape = shape;
282 }
283 
284 
285 
286 // ------------ Static methods for building vehicle types
289  MSVehicleType* vtype = new MSVehicleType(from);
292  // by default decel and apparentDecel are identical
293  const double apparentDecel = from.getCFParam(SUMO_ATTR_APPARENTDECEL, decel);
294 
295  if (emergencyDecel < decel) {
296  WRITE_WARNING("Value of 'emergencyDecel' (" + toString(emergencyDecel) + ") should be higher than 'decel' (" + toString(decel) + ") for vType '" + from.id + "'.");
297  }
298  if (emergencyDecel < apparentDecel) {
299  WRITE_WARNING("Value of 'emergencyDecel' (" + toString(emergencyDecel) + ") is lower than 'apparentDecel' (" + toString(apparentDecel) + ") for vType '" + from.id + "' may cause collisions.");
300  }
301 
302  switch (from.cfModel) {
303  case SUMO_TAG_CF_IDM:
304  vtype->myCarFollowModel = new MSCFModel_IDM(vtype, false);
305  break;
306  case SUMO_TAG_CF_IDMM:
307  vtype->myCarFollowModel = new MSCFModel_IDM(vtype, true);
308  break;
309  case SUMO_TAG_CF_BKERNER:
310  vtype->myCarFollowModel = new MSCFModel_Kerner(vtype);
311  break;
313  vtype->myCarFollowModel = new MSCFModel_KraussOrig1(vtype);
314  break;
316  vtype->myCarFollowModel = new MSCFModel_KraussPS(vtype);
317  break;
318  case SUMO_TAG_CF_KRAUSSX:
319  vtype->myCarFollowModel = new MSCFModel_KraussX(vtype);
320  break;
321  case SUMO_TAG_CF_EIDM:
322  vtype->myCarFollowModel = new MSCFModel_EIDM(vtype);
323  break;
325  vtype->myCarFollowModel = new MSCFModel_SmartSK(vtype);
326  break;
327  case SUMO_TAG_CF_DANIEL1:
328  vtype->myCarFollowModel = new MSCFModel_Daniel1(vtype);
329  break;
331  vtype->myCarFollowModel = new MSCFModel_PWag2009(vtype);
332  break;
334  vtype->myCarFollowModel = new MSCFModel_Wiedemann(vtype);
335  break;
336  case SUMO_TAG_CF_W99:
337  vtype->myCarFollowModel = new MSCFModel_W99(vtype);
338  break;
339  case SUMO_TAG_CF_RAIL:
340  vtype->myCarFollowModel = new MSCFModel_Rail(vtype);
341  break;
342  case SUMO_TAG_CF_ACC:
343  vtype->myCarFollowModel = new MSCFModel_ACC(vtype);
344  break;
345  case SUMO_TAG_CF_CACC:
346  vtype->myCarFollowModel = new MSCFModel_CACC(vtype);
347  break;
348  case SUMO_TAG_CF_CC:
349  vtype->myCarFollowModel = new MSCFModel_CC(vtype);
350  break;
351  case SUMO_TAG_CF_KRAUSS:
352  default:
353  vtype->myCarFollowModel = new MSCFModel_Krauss(vtype);
354  break;
355  }
356  // init Rail visualization parameters
358  return vtype;
359 }
360 
361 SUMOTime
362 MSVehicleType::getEntryManoeuvreTime(const int angle) const {
363  return (getParameter().getEntryManoeuvreTime(angle));
364 }
365 
366 SUMOTime
367 MSVehicleType::getExitManoeuvreTime(const int angle) const {
368  return (getParameter().getExitManoeuvreTime(angle));
369 }
370 
372 MSVehicleType::buildSingularType(const std::string& id) const {
373  return duplicateType(id, false);
374 }
375 
376 
378 MSVehicleType::duplicateType(const std::string& id, bool persistent) const {
380  vtype->myParameter.id = id;
382  if (!persistent) {
383  vtype->myOriginalType = this;
384  }
385  if (!MSNet::getInstance()->getVehicleControl().addVType(vtype)) {
386  std::string singular = persistent ? "" : "singular ";
387  throw ProcessError("could not add " + singular + "type " + vtype->getID());
388  }
389  return vtype;
390 }
391 
392 void
396  && STEPS2TIME(myParameter.actionStepLength) > getCarFollowModel().getHeadwayTime()) {
398  std::stringstream s;
399  s << "Given action step length " << STEPS2TIME(myParameter.actionStepLength) << " for vehicle type '" << getID()
400  << "' is larger than its parameter tau (=" << getCarFollowModel().getHeadwayTime() << ")!"
401  << " This may lead to collisions. (This warning is only issued once per vehicle type).";
402  WRITE_WARNING(s.str());
403  }
408  std::string warning2;
409  if (OptionsCont::getOptions().isDefault("step-method.ballistic")) {
410  warning2 = " Setting it now to avoid collisions.";
412  } else {
413  warning2 = " This may cause collisions.";
414  }
415  WRITE_WARNINGF("Action step length '%' is used for vehicle type '%' but step-method.ballistic was not set." + warning2
417  }
418  if (!myWarnedStepLengthTauOnce && TS > getCarFollowModel().getHeadwayTime()
421  WRITE_WARNINGF("Value of tau=% in vehicle type '%' lower than simulation step size may cause collisions.",
422  getCarFollowModel().getHeadwayTime(), getID());
423  }
424  if (MSGlobals::gUseMesoSim && getVehicleClass() != SVC_PEDESTRIAN && !OptionsCont::getOptions().getBool("meso-lane-queue")) {
425  SVCPermissions ignoreVClasses = parseVehicleClasses(OptionsCont::getOptions().getStringVector("meso-ignore-lanes-by-vclass"));
426  if ((ignoreVClasses & getVehicleClass()) != 0) {
427  WRITE_WARNINGF("Vehicle class '%' of vType '%' is set as ignored by option --meso-ignore-lanes-by-vclass to ensure default vehicle capacity. Set option --meso-lane-queue for multi-modal meso simulation",
429  }
430  }
431 }
432 
433 void
434 MSVehicleType::setAccel(double accel) {
435  if (myOriginalType != nullptr && accel < 0) {
437  }
440 }
441 
442 void
443 MSVehicleType::setDecel(double decel) {
444  if (myOriginalType != nullptr && decel < 0) {
446  }
449 }
450 
451 void
452 MSVehicleType::setEmergencyDecel(double emergencyDecel) {
453  if (myOriginalType != nullptr && emergencyDecel < 0) {
454  emergencyDecel = myOriginalType->getCarFollowModel().getEmergencyDecel();
455  }
456  myCarFollowModel->setEmergencyDecel(emergencyDecel);
458 }
459 
460 void
461 MSVehicleType::setApparentDecel(double apparentDecel) {
462  if (myOriginalType != nullptr && apparentDecel < 0) {
464  }
465  myCarFollowModel->setApparentDecel(apparentDecel);
467 }
468 
469 void
470 MSVehicleType::setImperfection(double imperfection) {
471  if (myOriginalType != nullptr && imperfection < 0) {
473  }
474  myCarFollowModel->setImperfection(imperfection);
476 }
477 
478 void
480  if (myOriginalType != nullptr && tau < 0) {
482  }
485 }
486 
487 /****************************************************************************/
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:281
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:280
SUMOTime DELTA_T
Definition: SUMOTime.cpp:37
#define STEPS2TIME(x)
Definition: SUMOTime.h:53
#define TS
Definition: SUMOTime.h:40
long long int SUMOTime
Definition: SUMOTime.h:32
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
LatAlignmentDefinition
Possible ways to choose the lateral alignment, i.e., how vehicles align themselves within their lane.
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
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
int SUMOEmissionClass
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ 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_EIDM
@ 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
@ 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:80
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
double sample(SumoRNG *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 Extended Intelligent Driver Model (EIDM) car-following model.
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:521
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
Definition: MSCFModel.h:247
virtual void setHeadwayTime(double headwayTime)
Sets a new value for desired headway [s].
Definition: MSCFModel.h:529
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:505
virtual void setMaxAccel(double accel)
Sets a new value for maximum acceleration [m/s^2].
Definition: MSCFModel.h:489
virtual void setMaxDecel(double decel)
Sets a new value for maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:497
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
Definition: MSCFModel.h:255
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Definition: MSCFModel.h:231
virtual double getImperfection() const
Get the driver's imperfection.
Definition: MSCFModel.h:272
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:239
virtual void setApparentDecel(double decel)
Sets a new value for the apparent deceleration [m/s^2].
Definition: MSCFModel.h:513
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
Definition: MSCFModel.h:280
static bool gUseMesoSim
Definition: MSGlobals.h:94
static double gDefaultEmergencyDecel
encoding of the string-option default.emergencydecel
Definition: MSGlobals.h:118
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:106
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:174
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:376
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:75
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
Definition: MSVehicle.cpp:1916
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:1922
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)
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
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
bool myWarnedStepLengthTauOnce
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
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.
void setPreferredLateralAlignment(const LatAlignmentDefinition &latAlignment, double latAlignmentOffset=0.0)
Set vehicle's preferred lateral alignment.
static int myNextIndex
next value for the running index
void setTau(double tau)
Set a new value for this type's headway.
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
double computeChosenSpeedDeviation(SumoRNG *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
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
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 latAlignmentOffset
(optional) The vehicle's desired lateral alignment as offset in m from center line
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.
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.
void initRailVisualizationParameters()
init Rail Visualization Parameters
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.
LatAlignmentDefinition latAlignmentProcedure
Information on how the vehicle shall choose the lateral alignment.
double impatience
The vehicle's impatience (willingness to obstruct others)