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