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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // The car-following model and parameter
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <cassert>
35 #include "MSNet.h"
36 #include "cfmodels/MSCFModel_IDM.h"
46 #include "cfmodels/MSCFModel_W99.h"
47 #include "cfmodels/MSCFModel_ACC.h"
49 #include "MSVehicleControl.h"
50 #include "cfmodels/MSCFModel_CC.h"
51 #include "MSVehicleType.h"
52 
53 
54 // ===========================================================================
55 // static members
56 // ===========================================================================
58 
59 
60 // ===========================================================================
61 // method definitions
62 // ===========================================================================
64  : myParameter(parameter), myWarnedActionStepLengthTauOnce(false), myIndex(myNextIndex++), myCarFollowModel(nullptr), myOriginalType(nullptr) {
65  assert(getLength() > 0);
66  assert(getMaxSpeed() > 0);
67 
68  // Check if actionStepLength was set by user, if not init to global default
71  }
73 }
74 
75 
77  delete myCarFollowModel;
78 }
79 
80 
81 double
82 MSVehicleType::computeChosenSpeedDeviation(std::mt19937* rng, const double minDev) const {
83  return MAX2(minDev, myParameter.speedFactor.sample(rng));
84 }
85 
86 
87 // ------------ Setter methods
88 void
89 MSVehicleType::setLength(const double& length) {
90  if (myOriginalType != nullptr && length < 0) {
92  } else {
93  myParameter.length = length;
94  }
96 }
97 
98 
99 void
100 MSVehicleType::setHeight(const double& height) {
101  if (myOriginalType != nullptr && height < 0) {
103  } else {
104  myParameter.height = height;
105  }
107 }
108 
109 
110 void
111 MSVehicleType::setMinGap(const double& minGap) {
112  if (myOriginalType != nullptr && minGap < 0) {
114  } else {
115  myParameter.minGap = minGap;
116  }
118 }
119 
120 
121 void
122 MSVehicleType::setMinGapLat(const double& minGapLat) {
123  if (myOriginalType != nullptr && minGapLat < 0) {
125  } else {
126  myParameter.minGapLat = minGapLat;
127  }
129 }
130 
131 
132 void
133 MSVehicleType::setMaxSpeed(const double& maxSpeed) {
134  if (myOriginalType != nullptr && maxSpeed < 0) {
136  } else {
137  myParameter.maxSpeed = maxSpeed;
138  }
140 }
141 
142 
143 void
144 MSVehicleType::setMaxSpeedLat(const double& maxSpeedLat) {
145  if (myOriginalType != nullptr && maxSpeedLat < 0) {
147  } else {
148  myParameter.maxSpeedLat = maxSpeedLat;
149  }
151 }
152 
153 
154 void
156  myParameter.vehicleClass = vclass;
158 }
159 
160 void
162  myParameter.latAlignment = latAlignment;
164 }
165 
166 
167 void
169  if (myOriginalType != nullptr && prob < 0) {
171  } else {
173  }
175 }
176 
177 
178 void
179 MSVehicleType::setSpeedFactor(const double& factor) {
180  if (myOriginalType != nullptr && factor < 0) {
182  } else {
183  myParameter.speedFactor.getParameter()[0] = factor;
184  }
186 }
187 
188 
189 void
191  if (myOriginalType != nullptr && dev < 0) {
193  } else {
195  }
197 }
198 
199 
200 void
201 MSVehicleType::setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset) {
202  assert(actionStepLength >= 0.);
204 
205  if (myParameter.actionStepLength == actionStepLength) {
206  return;
207  }
208 
209  SUMOTime previousActionStepLength = myParameter.actionStepLength;
210  myParameter.actionStepLength = actionStepLength;
212  check();
213 
214  if (isVehicleSpecific()) {
215  // don't perform vehicle lookup for singular vtype
216  return;
217  }
218 
219  // For non-singular vType reset all vehicle's actionOffsets
220  // Iterate through vehicles
222  for (auto vehIt = vc.loadedVehBegin(); vehIt != vc.loadedVehEnd(); ++vehIt) {
223  MSVehicle* veh = static_cast<MSVehicle*>(vehIt->second);
224  if (&veh->getVehicleType() == this) {
225  // Found vehicle of this type. Perform requested actionOffsetReset
226  if (resetActionOffset) {
227  veh->resetActionOffset();
228  } else {
229  veh->updateActionOffset(previousActionStepLength, actionStepLength);
230  }
231  }
232  }
233 }
234 
235 
236 void
238  myParameter.emissionClass = eclass;
240 }
241 
242 
243 void
245  myParameter.color = color;
247 }
248 
249 
250 void
251 MSVehicleType::setWidth(const double& width) {
252  if (myOriginalType != nullptr && width < 0) {
254  } else {
255  myParameter.width = width;
256  }
258 }
259 
260 void
261 MSVehicleType::setImpatience(const double impatience) {
262  if (myOriginalType != nullptr && impatience < 0) {
264  } else {
265  myParameter.impatience = impatience;
266  }
268 }
269 
270 
271 void
273  myParameter.shape = shape;
275 }
276 
277 
278 
279 // ------------ Static methods for building vehicle types
282  MSVehicleType* vtype = new MSVehicleType(from);
285  // by default decel and apparentDecel are identical
286  const double apparentDecel = from.getCFParam(SUMO_ATTR_APPARENTDECEL, decel);
287 
288  if (emergencyDecel < decel) {
289  WRITE_WARNING("Value of 'emergencyDecel' (" + toString(emergencyDecel) + ") should be higher than 'decel' (" + toString(decel) + ") for vType '" + from.id + "'.");
290  }
291  if (emergencyDecel < apparentDecel) {
292  WRITE_WARNING("Value of 'emergencyDecel' (" + toString(emergencyDecel) + ") is lower than 'apparentDecel' (" + toString(apparentDecel) + ") for vType '" + from.id + "' may cause collisions.");
293  }
294 
295  switch (from.cfModel) {
296  case SUMO_TAG_CF_IDM:
297  vtype->myCarFollowModel = new MSCFModel_IDM(vtype, false);
298  break;
299  case SUMO_TAG_CF_IDMM:
300  vtype->myCarFollowModel = new MSCFModel_IDM(vtype, true);
301  break;
302  case SUMO_TAG_CF_BKERNER:
303  vtype->myCarFollowModel = new MSCFModel_Kerner(vtype);
304  break;
306  vtype->myCarFollowModel = new MSCFModel_KraussOrig1(vtype);
307  break;
309  vtype->myCarFollowModel = new MSCFModel_KraussPS(vtype);
310  break;
311  case SUMO_TAG_CF_KRAUSSX:
312  vtype->myCarFollowModel = new MSCFModel_KraussX(vtype);
313  break;
315  vtype->myCarFollowModel = new MSCFModel_SmartSK(vtype);
316  break;
317  case SUMO_TAG_CF_DANIEL1:
318  vtype->myCarFollowModel = new MSCFModel_Daniel1(vtype);
319  break;
321  vtype->myCarFollowModel = new MSCFModel_PWag2009(vtype);
322  break;
324  vtype->myCarFollowModel = new MSCFModel_Wiedemann(vtype);
325  break;
326  case SUMO_TAG_CF_W99:
327  vtype->myCarFollowModel = new MSCFModel_W99(vtype);
328  break;
329  case SUMO_TAG_CF_RAIL:
330  vtype->myCarFollowModel = new MSCFModel_Rail(vtype);
331  break;
332  case SUMO_TAG_CF_ACC:
333  vtype->myCarFollowModel = new MSCFModel_ACC(vtype);
334  break;
335  case SUMO_TAG_CF_CACC:
336  vtype->myCarFollowModel = new MSCFModel_CACC(vtype);
337  break;
338  case SUMO_TAG_CF_CC:
339  vtype->myCarFollowModel = new MSCFModel_CC(vtype);
340  break;
341  case SUMO_TAG_CF_KRAUSS:
342  default:
343  vtype->myCarFollowModel = new MSCFModel_Krauss(vtype);
344  break;
345  }
346  // init Rail visualization parameters
348  vtype->check();
349  return vtype;
350 }
351 
352 SUMOTime
353 MSVehicleType::getEntryManoeuvreTime(const int angle) const {
354  return (getParameter().getEntryManoeuvreTime(angle));
355 }
356 
357 SUMOTime
358 MSVehicleType::getExitManoeuvreTime(const int angle) const {
359  return (getParameter().getExitManoeuvreTime(angle));
360 }
361 
363 MSVehicleType::buildSingularType(const std::string& id) const {
364  return duplicateType(id, false);
365 }
366 
367 
369 MSVehicleType::duplicateType(const std::string& id, bool persistent) const {
371  vtype->myParameter.id = id;
373  if (!persistent) {
374  vtype->myOriginalType = this;
375  }
376  if (!MSNet::getInstance()->getVehicleControl().addVType(vtype)) {
377  std::string singular = persistent ? "" : "singular ";
378  throw ProcessError("could not add " + singular + "type " + vtype->getID());
379  }
380  return vtype;
381 }
382 
383 void
387  && STEPS2TIME(myParameter.actionStepLength) > getCarFollowModel().getHeadwayTime()) {
389  std::stringstream s;
390  s << "Given action step length " << STEPS2TIME(myParameter.actionStepLength) << " for vehicle type '" << getID()
391  << "' is larger than its parameter tau (=" << getCarFollowModel().getHeadwayTime() << ")!"
392  << " This may lead to collisions. (This warning is only issued once per vehicle type).";
393  WRITE_WARNING(s.str());
394  }
395 }
396 
397 void
398 MSVehicleType::setAccel(double accel) {
399  if (myOriginalType != nullptr && accel < 0) {
401  }
404 }
405 
406 void
407 MSVehicleType::setDecel(double decel) {
408  if (myOriginalType != nullptr && decel < 0) {
410  }
413 }
414 
415 void
416 MSVehicleType::setEmergencyDecel(double emergencyDecel) {
417  if (myOriginalType != nullptr && emergencyDecel < 0) {
418  emergencyDecel = myOriginalType->getCarFollowModel().getEmergencyDecel();
419  }
420  myCarFollowModel->setEmergencyDecel(emergencyDecel);
422 }
423 
424 void
425 MSVehicleType::setApparentDecel(double apparentDecel) {
426  if (myOriginalType != nullptr && apparentDecel < 0) {
428  }
429  myCarFollowModel->setApparentDecel(apparentDecel);
431 }
432 
433 void
434 MSVehicleType::setImperfection(double imperfection) {
435  if (myOriginalType != nullptr && imperfection < 0) {
437  }
438  myCarFollowModel->setImperfection(imperfection);
440 }
441 
442 void
444  if (myOriginalType != nullptr && tau < 0) {
446  }
449 }
450 
451 
452 void
454  if (myParameter.knowsParameter("carriageLength")) {
456  } else if (myParameter.wasSet(VTYPEPARS_SHAPE_SET)) {
457  switch (myParameter.shape) {
458  case SVS_BUS_FLEXIBLE:
459  myParameter.carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180
461  break;
462  case SVS_RAIL:
463  myParameter.carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
464  break;
465  case SVS_RAIL_CAR:
466  myParameter.carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423
467  break;
468  case SVS_RAIL_CARGO:
469  myParameter.carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen
470  break;
474  myParameter.carriageGap = 0.5;
475  break;
476  case SVS_TRUCK_1TRAILER:
478  myParameter.locomotiveLength = 2.5 + 6.75;
479  myParameter.carriageGap = 0.5;
480  break;
481  default:
482  break;
483  }
484  }
485  if (myParameter.knowsParameter("locomotiveLength")) {
487  } else if (myParameter.locomotiveLength <= 0) {
489  }
490  if (myParameter.knowsParameter("carriageGap")) {
492  }
493 }
494 
495 /****************************************************************************/
496 
VTYPEPARS_LATALIGNMENT_SET
const int VTYPEPARS_LATALIGNMENT_SET
Definition: SUMOVTypeParameter.h:66
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
MSVehicleType::setHeight
void setHeight(const double &height)
Set a new value for this type's height.
Definition: MSVehicleType.cpp:100
MSCFModel_Rail
Definition: MSCFModel_Rail.h:24
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
MSVehicleType::buildSingularType
MSVehicleType * buildSingularType(const std::string &id) const
Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicl...
Definition: MSVehicleType.cpp:363
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:93
MSCFModel::getMaxAccel
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Definition: MSCFModel.h:209
SUMOVTypeParameter::locomotiveLength
double locomotiveLength
Definition: SUMOVTypeParameter.h:303
MSVehicleType::setPreferredLateralAlignment
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
Definition: MSVehicleType.cpp:161
SUMOVTypeParameter::length
double length
The physical vehicle length.
Definition: SUMOVTypeParameter.h:215
MSCFModel::getMaxDecel
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:217
MSVehicleType::setMinGapLat
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
Definition: MSVehicleType.cpp:122
VTYPEPARS_MINGAP_SET
const int VTYPEPARS_MINGAP_SET
Definition: SUMOVTypeParameter.h:46
MSVehicleType::setAccel
void setAccel(double accel)
Set a new value for this type's acceleration.
Definition: MSVehicleType.cpp:398
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
MSNet.h
MSCFModel::getImperfection
virtual double getImperfection() const
Get the driver's imperfection.
Definition: MSCFModel.h:250
MSVehicleType::isVehicleSpecific
bool isVehicleSpecific() const
Returns whether this type belongs to a single vehicle only (was modified)
Definition: MSVehicleType.h:547
Distribution_Parameterized::sample
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
Definition: Distribution_Parameterized.cpp:84
MSCFModel::setEmergencyDecel
virtual void setEmergencyDecel(double decel)
Sets a new value for maximal physically possible deceleration [m/s^2].
Definition: MSCFModel.h:483
MSVehicleType::myWarnedActionStepLengthTauOnce
bool myWarnedActionStepLengthTauOnce
Indicator whether the user was already warned once about an action step length larger than the desire...
Definition: MSVehicleType.h:583
SUMO_TAG_CF_KRAUSS_ORIG1
@ SUMO_TAG_CF_KRAUSS_ORIG1
Definition: SUMOXMLDefinitions.h:277
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:36
SUMOVTypeParameter::actionStepLength
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions....
Definition: SUMOVTypeParameter.h:225
LateralAlignment
LateralAlignment
Numbers representing special SUMO-XML-attribute values Information how vehicles align themselves with...
Definition: SUMOXMLDefinitions.h:1328
MSCFModel_Daniel1.h
OptionsCont.h
SUMOVTypeParameter::cfModel
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
Definition: SUMOVTypeParameter.h:278
StringUtils::toDouble
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition: StringUtils.cpp:345
MSCFModel::setImperfection
virtual void setImperfection(double imperfection)
Sets a new value for driver imperfection.
Definition: MSCFModel.h:499
SUMO_TAG_CF_CACC
@ SUMO_TAG_CF_CACC
Definition: SUMOXMLDefinitions.h:288
MSVehicleType::setVClass
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
Definition: MSVehicleType.cpp:155
SUMOVTypeParameter::impatience
double impatience
The vehicle's impatience (willingness to obstruct others)
Definition: SUMOVTypeParameter.h:243
MSCFModel::getApparentDecel
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
Definition: MSCFModel.h:233
SUMO_TAG_CF_RAIL
@ SUMO_TAG_CF_RAIL
Definition: SUMOXMLDefinitions.h:289
MSCFModel_Rail.h
MSVehicleType::getMaxSpeedLat
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
Definition: MSVehicleType.h:313
SUMO_TAG_CF_IDMM
@ SUMO_TAG_CF_IDMM
Definition: SUMOXMLDefinitions.h:282
FileHelpers.h
MSCFModel_Krauss
Krauss car-following model, with acceleration decrease and faster start.
Definition: MSCFModel_Krauss.h:38
MSVehicleType::setEmergencyDecel
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
Definition: MSVehicleType.cpp:416
VTYPEPARS_MINGAP_LAT_SET
const int VTYPEPARS_MINGAP_LAT_SET
Definition: SUMOVTypeParameter.h:67
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSVehicleType::getImpatience
double getImpatience() const
Returns this type's impatience.
Definition: MSVehicleType.h:233
MSCFModel_W99.h
SUMO_TAG_CF_KRAUSS
@ SUMO_TAG_CF_KRAUSS
Definition: SUMOXMLDefinitions.h:275
MSCFModel_CACC
The CACC car-following model.
Definition: MSCFModel_CACC.h:48
MSVehicle::updateActionOffset
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:2127
MSVehicleType::~MSVehicleType
virtual ~MSVehicleType()
Destructor.
Definition: MSVehicleType.cpp:76
MSCFModel::setApparentDecel
virtual void setApparentDecel(double decel)
Sets a new value for the apparent deceleration [m/s^2].
Definition: MSCFModel.h:491
MSCFModel_W99
The W99 Model car-following model.
Definition: MSCFModel_W99.h:41
SUMOEmissionClass
int SUMOEmissionClass
Definition: SUMOVehicleClass.h:231
SUMOVTypeParameter::carriageLength
double carriageLength
the length of train carriages and locomotive
Definition: SUMOVTypeParameter.h:302
MSVehicleType::duplicateType
MSVehicleType * duplicateType(const std::string &id, bool persistent) const
Duplicates the microsim vehicle type giving the newly created type the given id.
Definition: MSVehicleType.cpp:369
SUMOVTypeParameter::shape
SUMOVehicleShape shape
This class' shape.
Definition: SUMOVTypeParameter.h:267
VTYPEPARS_PROBABILITY_SET
const int VTYPEPARS_PROBABILITY_SET
Definition: SUMOVTypeParameter.h:48
MSVehicleType::setMinGap
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
Definition: MSVehicleType.cpp:111
MSCFModel_CC.h
MSVehicleType::setWidth
void setWidth(const double &width)
Set a new value for this type's width.
Definition: MSVehicleType.cpp:251
MSCFModel_Wiedemann.h
MSCFModel_KraussX
Krauss car-following model, changing accel and speed by slope.
Definition: MSCFModel_KraussX.h:36
MSVehicleType::getMinGapLat
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
Definition: MSVehicleType.h:132
MSCFModel::setHeadwayTime
virtual void setHeadwayTime(double headwayTime)
Sets a new value for desired headway [s].
Definition: MSCFModel.h:507
MSCFModel_KraussOrig1.h
SUMO_TAG_CF_IDM
@ SUMO_TAG_CF_IDM
Definition: SUMOXMLDefinitions.h:281
SVS_BUS_FLEXIBLE
@ SVS_BUS_FLEXIBLE
render as a flexible city bus
Definition: SUMOVehicleClass.h:86
SUMO_TAG_CF_KRAUSSX
@ SUMO_TAG_CF_KRAUSSX
Definition: SUMOXMLDefinitions.h:278
Parameterised::getParameter
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Definition: Parameterised.cpp:72
MSVehicleType.h
SUMO_TAG_CF_CC
@ SUMO_TAG_CF_CC
Definition: SUMOXMLDefinitions.h:290
MSVehicleType::initRailVisualizationParameters
void initRailVisualizationParameters()
init Rail Visualization Parameters
Definition: MSVehicleType.cpp:453
MSCFModel_Daniel1
The original Krauss (1998) car-following model and parameter.
Definition: MSCFModel_Daniel1.h:36
MSVehicleType::getHeight
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:253
MSCFModel_KraussPS
Krauss car-following model, changing accel and speed by slope.
Definition: MSCFModel_KraussPS.h:39
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
MSVehicleType::setColor
void setColor(const RGBColor &color)
Set a new value for this type's color.
Definition: MSVehicleType.cpp:244
SUMOVTypeParameter::wasSet
bool wasSet(int what) const
Returns whether the given parameter was set.
Definition: SUMOVTypeParameter.h:150
SUMOVTypeParameter::parametersSet
int parametersSet
Information for the router which parameter were set.
Definition: SUMOVTypeParameter.h:307
VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_MAXSPEED_LAT_SET
Definition: SUMOVTypeParameter.h:65
MSVehicleType::MSVehicleType
MSVehicleType(const SUMOVTypeParameter &parameter)
Constructor.
Definition: MSVehicleType.cpp:63
BinaryInputDevice.h
RGBColor
Definition: RGBColor.h:39
MSVehicleType::check
void check()
Checks whether vehicle type parameters may be problematic (Currently, only the value for the action s...
Definition: MSVehicleType.cpp:384
SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_APPARENTDECEL
Definition: SUMOXMLDefinitions.h:448
Distribution_Parameterized::getParameter
std::vector< double > & getParameter()
Returns the parameters of this distribution.
Definition: Distribution_Parameterized.cpp:110
MSCFModel::setMaxDecel
virtual void setMaxDecel(double decel)
Sets a new value for maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:475
MSVehicleType::computeChosenSpeedDeviation
double computeChosenSpeedDeviation(std::mt19937 *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
Definition: MSVehicleType.cpp:82
SUMO_ATTR_DECEL
@ SUMO_ATTR_DECEL
Definition: SUMOXMLDefinitions.h:446
MSVehicleType::myOriginalType
const MSVehicleType * myOriginalType
The original type.
Definition: MSVehicleType.h:592
MSVehicleType::getCarFollowModel
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
Definition: MSVehicleType.h:140
SUMO_ATTR_ACCEL
@ SUMO_ATTR_ACCEL
Definition: SUMOXMLDefinitions.h:445
SUMOVTypeParameter::height
double height
This class' height.
Definition: SUMOVTypeParameter.h:264
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:246
SUMO_TAG_CF_ACC
@ SUMO_TAG_CF_ACC
Definition: SUMOXMLDefinitions.h:287
MSGlobals::gDefaultEmergencyDecel
static double gDefaultEmergencyDecel
encoding of the string-option default.emergencydecel
Definition: MSGlobals.h:114
MSCFModel_ACC.h
SUMOVTypeParameter
Structure representing possible vehicle parameter.
Definition: SUMOVTypeParameter.h:86
SUMOVehicleShape
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
Definition: SUMOVehicleClass.h:50
SUMOVTypeParameter::cfParameter
SubParams cfParameter
Car-following parameter.
Definition: SUMOVTypeParameter.h:281
SUMOVTypeParameter::defaultProbability
double defaultProbability
The probability when being added to a distribution without an explicit probability.
Definition: SUMOVTypeParameter.h:228
MSVehicleControl::loadedVehEnd
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Definition: MSVehicleControl.h:185
STEPS2TIME
#define STEPS2TIME(x)
Definition: SUMOTime.h:56
SUMOVTypeParameter::getDefaultDecel
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 ...
Definition: SUMOVTypeParameter.cpp:610
MSVehicleType::setActionStepLength
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
Definition: MSVehicleType.cpp:201
VTYPEPARS_ACTIONSTEPLENGTH_SET
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
Definition: SUMOVTypeParameter.h:68
SVS_RAIL_CARGO
@ SVS_RAIL_CARGO
render as a cargo train
Definition: SUMOVehicleClass.h:94
MSVehicleType::myParameter
SUMOVTypeParameter myParameter
the parameter container
Definition: MSVehicleType.h:576
ProcessError
Definition: UtilExceptions.h:39
SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
Definition: SUMOXMLDefinitions.h:276
SUMOVTypeParameter::minGap
double minGap
This class' free space in front of the vehicle itself.
Definition: SUMOVTypeParameter.h:218
MSCFModel_KraussOrig1
The original Krauss (1998) car-following model and parameter.
Definition: MSCFModel_KraussOrig1.h:38
MSCFModel_ACC
The ACC car-following model.
Definition: MSCFModel_ACC.h:48
MSVehicleType::setLength
void setLength(const double &length)
Set a new value for this type's length.
Definition: MSVehicleType.cpp:89
SUMOVTypeParameter::width
double width
This class' width.
Definition: SUMOVTypeParameter.h:261
MSVehicleType::getMinGap
double getMinGap() const
Get the free space in front of vehicles of this class.
Definition: MSVehicleType.h:125
SUMOVTypeParameter::maxSpeedLat
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
Definition: SUMOVTypeParameter.h:293
MSCFModel_PWag2009.h
MSCFModel::setMaxAccel
virtual void setMaxAccel(double accel)
Sets a new value for maximum acceleration [m/s^2].
Definition: MSCFModel.h:467
SUMOVTypeParameter::getCFParam
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.
Definition: SUMOVTypeParameter.cpp:458
SUMOVTypeParameter::maxSpeed
double maxSpeed
The vehicle type's maximum speed [m/s].
Definition: SUMOVTypeParameter.h:221
MSVehicleType::setDecel
void setDecel(double decel)
Set a new value for this type's deceleration.
Definition: MSVehicleType.cpp:407
MSCFModel_CC
A set of automatic Cruise Controllers, including classic Cruise Control (CC), Adaptive Cruise Control...
Definition: MSCFModel_CC.h:57
MSBaseVehicle::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:123
SUMO_TAG_CF_PWAGNER2009
@ SUMO_TAG_CF_PWAGNER2009
Definition: SUMOXMLDefinitions.h:283
VTYPEPARS_SPEEDFACTOR_SET
const int VTYPEPARS_SPEEDFACTOR_SET
Definition: SUMOVTypeParameter.h:49
SVS_RAIL_CAR
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
Definition: SUMOVehicleClass.h:92
MSVehicleType::setDefaultProbability
void setDefaultProbability(const double &prob)
Set a new value for this type's default probability.
Definition: MSVehicleType.cpp:168
MSVehicleType::getEntryManoeuvreTime
SUMOTime getEntryManoeuvreTime(const int angle) const
Accessor function for parameter equivalent returning entry time for a specific manoeuver angle.
Definition: MSVehicleType.cpp:353
MSCFModel::duplicate
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const =0
Duplicates the car-following model.
SUMO_TAG_CF_W99
@ SUMO_TAG_CF_W99
Definition: SUMOXMLDefinitions.h:286
MSVehicleType::setShape
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
Definition: MSVehicleType.cpp:272
MSGlobals::gActionStepLength
static SUMOTime gActionStepLength
default value for the interval between two action points for MSVehicle (defaults to DELTA_T)
Definition: MSGlobals.h:111
SUMOVTypeParameter::speedFactor
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
Definition: SUMOVTypeParameter.h:231
MSCFModel_IDM
The Intelligent Driver Model (IDM) car-following model.
Definition: MSCFModel_IDM.h:40
MSCFModel_Krauss.h
MSVehicleType::myCachedActionStepLengthSecs
double myCachedActionStepLengthSecs
the vtypes actionsStepLength in seconds (cached because needed very often)
Definition: MSVehicleType.h:579
MSVehicleType::setMaxSpeedLat
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
Definition: MSVehicleType.cpp:144
SUMO_TAG_CF_WIEDEMANN
@ SUMO_TAG_CF_WIEDEMANN
Definition: SUMOXMLDefinitions.h:285
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
StringUtils.h
SUMOVTypeParameter::carriageGap
double carriageGap
Definition: SUMOVTypeParameter.h:304
MSVehicleType::getExitManoeuvreTime
SUMOTime getExitManoeuvreTime(const int angle) const
Accessor function for parameter equivalent returning exit time for a specific manoeuver angle.
Definition: MSVehicleType.cpp:358
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
SUMO_ATTR_SIGMA
@ SUMO_ATTR_SIGMA
Definition: SUMOXMLDefinitions.h:548
MSVehicleType::setSpeedDeviation
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
Definition: MSVehicleType.cpp:190
SUMOVTypeParameter::getDefaultEmergencyDecel
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...
Definition: SUMOVTypeParameter.cpp:641
MSCFModel::getHeadwayTime
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
Definition: MSCFModel.h:258
SUMOVTypeParameter::latAlignment
LateralAlignment latAlignment
The vehicles desired lateral alignment.
Definition: SUMOVTypeParameter.h:296
SUMOVTypeParameter::id
std::string id
The vehicle type's id.
Definition: SUMOVTypeParameter.h:212
MSVehicleType::build
static MSVehicleType * build(SUMOVTypeParameter &from)
Builds the microsim vehicle type described by the given parameter.
Definition: MSVehicleType.cpp:281
MSCFModel_Kerner.h
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:109
MSCFModel_SmartSK
The original Krauss (1998) car-following model and parameter.
Definition: MSCFModel_SmartSK.h:37
SUMO_TAG_CF_DANIEL1
@ SUMO_TAG_CF_DANIEL1
Definition: SUMOXMLDefinitions.h:280
MSVehicleType::setApparentDecel
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
Definition: MSVehicleType.cpp:425
MSVehicle::resetActionOffset
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
Definition: MSVehicle.cpp:2121
MSVehicleType::myNextIndex
static int myNextIndex
next value for the running index
Definition: MSVehicleType.h:595
MSCFModel_Wiedemann
The Wiedemann Model car-following model.
Definition: MSCFModel_Wiedemann.h:40
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:560
MSCFModel::getEmergencyDecel
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
Definition: MSCFModel.h:225
VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_HEIGHT_SET
Definition: SUMOVTypeParameter.h:54
SUMO_ATTR_EMERGENCYDECEL
@ SUMO_ATTR_EMERGENCYDECEL
Definition: SUMOXMLDefinitions.h:447
SVS_TRUCK_SEMITRAILER
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
Definition: SUMOVehicleClass.h:78
MSCFModel_KraussPS.h
SUMO_TAG_CF_BKERNER
@ SUMO_TAG_CF_BKERNER
Definition: SUMOXMLDefinitions.h:284
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:161
MSCFModel_Kerner
car-following model by B. Kerner
Definition: MSCFModel_Kerner.h:36
MSCFModel_SmartSK.h
MSCFModel_CACC.h
config.h
MSVehicleType::setMaxSpeed
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
Definition: MSVehicleType.cpp:133
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:71
MSVehicleType::myCarFollowModel
MSCFModel * myCarFollowModel
instance of the car following model.
Definition: MSVehicleType.h:589
RandHelper.h
SUMOVTypeParameter::color
RGBColor color
The color.
Definition: SUMOVTypeParameter.h:237
SVS_TRUCK_1TRAILER
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
Definition: SUMOVehicleClass.h:80
VTYPEPARS_LENGTH_SET
const int VTYPEPARS_LENGTH_SET
Definition: SUMOVTypeParameter.h:45
SUMO_TAG_CF_SMART_SK
@ SUMO_TAG_CF_SMART_SK
Definition: SUMOXMLDefinitions.h:279
MSVehicleControl::loadedVehBegin
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
Definition: MSVehicleControl.h:177
SUMOVTypeParameter::emissionClass
SUMOEmissionClass emissionClass
The emission class of this vehicle.
Definition: SUMOVTypeParameter.h:234
MSVehicleType::setSpeedFactor
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
Definition: MSVehicleType.cpp:179
VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_EMISSIONCLASS_SET
Definition: SUMOVTypeParameter.h:50
VTYPEPARS_COLOR_SET
const int VTYPEPARS_COLOR_SET
Definition: SUMOVTypeParameter.h:51
VTYPEPARS_SHAPE_SET
const int VTYPEPARS_SHAPE_SET
Definition: SUMOVTypeParameter.h:55
MSVehicleType::getDefaultProbability
double getDefaultProbability() const
Get the default probability of this vehicle type.
Definition: MSVehicleType.h:175
SUMOVTypeParameter.h
VTYPEPARS_WIDTH_SET
const int VTYPEPARS_WIDTH_SET
Definition: SUMOVTypeParameter.h:53
MSCFModel_IDM.h
MSVehicleControl.h
SUMOVTypeParameter::vehicleClass
SUMOVehicleClass vehicleClass
The vehicle's class.
Definition: SUMOVTypeParameter.h:240
VTYPEPARS_IMPATIENCE_SET
const int VTYPEPARS_IMPATIENCE_SET
Definition: SUMOVTypeParameter.h:58
MSCFModel_KraussX.h
VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_MAXSPEED_SET
Definition: SUMOVTypeParameter.h:47
MSNet::getVehicleControl
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:336
MSVehicleType::setImpatience
void setImpatience(const double impatience)
Set a new value for this type's impatience.
Definition: MSVehicleType.cpp:261
MSVehicleType::setTau
void setTau(double tau)
Set a new value for this type's headway.
Definition: MSVehicleType.cpp:443
MSVehicleType::setEmissionClass
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
Definition: MSVehicleType.cpp:237
MSVehicleType::setImperfection
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
Definition: MSVehicleType.cpp:434
Parameterised::knowsParameter
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
Definition: Parameterised.cpp:66
VTYPEPARS_VEHICLECLASS_SET
const int VTYPEPARS_VEHICLECLASS_SET
Definition: SUMOVTypeParameter.h:52
SUMO_ATTR_TAU
@ SUMO_ATTR_TAU
Definition: SUMOXMLDefinitions.h:549
SUMOVTypeParameter::minGapLat
double minGapLat
The vehicle type's minimum lateral gap [m].
Definition: SUMOVTypeParameter.h:299
SVS_RAIL
@ SVS_RAIL
render as a rail
Definition: SUMOVehicleClass.h:90
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
MSCFModel_PWag2009
Scalable model based on Krauss by Peter Wagner.
Definition: MSCFModel_PWag2009.h:37