Eclipse SUMO - Simulation of Urban MObility
VehicleType.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2017-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 /****************************************************************************/
15 // C++ TraCI client API implementation
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <microsim/MSNet.h>
26 #include <microsim/MSVehicleType.h>
27 #include <libsumo/TraCIConstants.h>
30 #include "Helper.h"
31 #include "VehicleType.h"
32 
33 
34 namespace libsumo {
35 // ===========================================================================
36 // static member initializations
37 // ===========================================================================
40 
41 
42 // ===========================================================================
43 // static member definitions
44 // ===========================================================================
45 std::vector<std::string>
47  std::vector<std::string> ids;
49  return ids;
50 }
51 
52 
53 int
55  return (int)getIDList().size();
56 }
57 
58 
59 double
60 VehicleType::getLength(const std::string& typeID) {
61  return getVType(typeID)->getLength();
62 }
63 
64 
65 double
66 VehicleType::getMaxSpeed(const std::string& typeID) {
67  return getVType(typeID)->getMaxSpeed();
68 }
69 
70 
71 double
72 VehicleType::getActionStepLength(const std::string& typeID) {
73  return getVType(typeID)->getActionStepLengthSecs();
74 }
75 
76 
77 double
78 VehicleType::getSpeedFactor(const std::string& typeID) {
79  return getVType(typeID)->getSpeedFactor().getParameter()[0];
80 }
81 
82 
83 double
84 VehicleType::getSpeedDeviation(const std::string& typeID) {
85  return getVType(typeID)->getSpeedFactor().getParameter()[1];
86 }
87 
88 
89 double
90 VehicleType::getAccel(const std::string& typeID) {
91  return getVType(typeID)->getCarFollowModel().getMaxAccel();
92 }
93 
94 
95 double
96 VehicleType::getDecel(const std::string& typeID) {
97  return getVType(typeID)->getCarFollowModel().getMaxDecel();
98 }
99 
100 
101 double
102 VehicleType::getEmergencyDecel(const std::string& typeID) {
103  return getVType(typeID)->getCarFollowModel().getEmergencyDecel();
104 }
105 
106 
107 double
108 VehicleType::getApparentDecel(const std::string& typeID) {
109  return getVType(typeID)->getCarFollowModel().getApparentDecel();
110 }
111 
112 
113 double
114 VehicleType::getImperfection(const std::string& typeID) {
115  return getVType(typeID)->getCarFollowModel().getImperfection();
116 }
117 
118 
119 double
120 VehicleType::getTau(const std::string& typeID) {
121  return getVType(typeID)->getCarFollowModel().getHeadwayTime();
122 }
123 
124 
125 std::string
126 VehicleType::getVehicleClass(const std::string& typeID) {
127  return toString(getVType(typeID)->getVehicleClass());
128 }
129 
130 
131 std::string
132 VehicleType::getEmissionClass(const std::string& typeID) {
133  return PollutantsInterface::getName(getVType(typeID)->getEmissionClass());
134 }
135 
136 
137 std::string
138 VehicleType::getShapeClass(const std::string& typeID) {
139  return getVehicleShapeName(getVType(typeID)->getGuiShape());
140 }
141 
142 
143 double
144 VehicleType::getMinGap(const std::string& typeID) {
145  return getVType(typeID)->getMinGap();
146 }
147 
148 
149 double
150 VehicleType::getWidth(const std::string& typeID) {
151  return getVType(typeID)->getWidth();
152 }
153 
154 
155 double
156 VehicleType::getHeight(const std::string& typeID) {
157  return getVType(typeID)->getHeight();
158 }
159 
160 
161 TraCIColor
162 VehicleType::getColor(const std::string& typeID) {
163  return Helper::makeTraCIColor(getVType(typeID)->getColor());
164 }
165 
166 
167 double
168 VehicleType::getMinGapLat(const std::string& typeID) {
169  return getVType(typeID)->getMinGapLat();
170 }
171 
172 
173 double
174 VehicleType::getMaxSpeedLat(const std::string& typeID) {
175  return getVType(typeID)->getMaxSpeedLat();
176 }
177 
178 
179 std::string
180 VehicleType::getLateralAlignment(const std::string& typeID) {
181  return toString(getVType(typeID)->getPreferredLateralAlignment());
182 }
183 
184 
185 std::string
186 VehicleType::getParameter(const std::string& typeID, const std::string& key) {
187  return getVType(typeID)->getParameter().getParameter(key, "");
188 }
189 
190 int
191 VehicleType::getPersonCapacity(const std::string& typeID) {
192  return getVType(typeID)->getPersonCapacity();
193 }
194 
195 void
196 VehicleType::setLength(const std::string& typeID, double length) {
197  getVType(typeID)->setLength(length);
198 }
199 
200 
201 void
202 VehicleType::setMaxSpeed(const std::string& typeID, double speed) {
203  getVType(typeID)->setMaxSpeed(speed);
204 }
205 
206 
207 void
208 VehicleType::setActionStepLength(const std::string& typeID, double actionStepLength, bool resetActionOffset) {
209  getVType(typeID)->setActionStepLength(SUMOVehicleParserHelper::processActionStepLength(actionStepLength), resetActionOffset);
210 }
211 
212 
213 void
214 VehicleType::setVehicleClass(const std::string& typeID, const std::string& clazz) {
215  getVType(typeID)->setVClass(getVehicleClassID(clazz));
216 }
217 
218 
219 void
220 VehicleType::setSpeedFactor(const std::string& typeID, double factor) {
221  getVType(typeID)->setSpeedFactor(factor);
222 }
223 
224 
225 void
226 VehicleType::setSpeedDeviation(const std::string& typeID, double deviation) {
227  getVType(typeID)->setSpeedDeviation(deviation);
228 }
229 
230 
231 void
232 VehicleType::setEmissionClass(const std::string& typeID, const std::string& clazz) {
234 }
235 
236 
237 void
238 VehicleType::setShapeClass(const std::string& typeID, const std::string& shapeClass) {
239  getVType(typeID)->setShape(getVehicleShapeID(shapeClass));
240 }
241 
242 
243 void
244 VehicleType::setWidth(const std::string& typeID, double width) {
245  getVType(typeID)->setWidth(width);
246 }
247 
248 
249 void
250 VehicleType::setHeight(const std::string& typeID, double height) {
251  getVType(typeID)->setHeight(height);
252 }
253 
254 
255 void
256 VehicleType::setMinGap(const std::string& typeID, double minGap) {
257  getVType(typeID)->setMinGap(minGap);
258 }
259 
260 
261 void
262 VehicleType::setAccel(const std::string& typeID, double accel) {
263  getVType(typeID)->setAccel(accel);
264 }
265 
266 
267 void
268 VehicleType::setDecel(const std::string& typeID, double decel) {
269  MSVehicleType* v = getVType(typeID);
270  v->setDecel(decel);
271  // automatically raise emergencyDecel to ensure it is at least as high as decel
272  if (decel > v->getCarFollowModel().getEmergencyDecel()) {
273  if (v->getParameter().cfParameter.count(SUMO_ATTR_EMERGENCYDECEL) > 0) {
274  // notify user only if emergencyDecel was previously specified
275  WRITE_WARNING("Automatically setting emergencyDecel to " + toString(decel) + " for vType '" + typeID + "' to match decel.");
276  }
277  v->setEmergencyDecel(decel);
278  }
279 }
280 
281 
282 void
283 VehicleType::setEmergencyDecel(const std::string& typeID, double decel) {
284  MSVehicleType* v = getVType(typeID);
285  v->setEmergencyDecel(decel);
286  if (decel < v->getCarFollowModel().getMaxDecel()) {
287  WRITE_WARNING("New value of emergencyDecel (" + toString(decel) + ") is lower than decel (" + toString(v->getCarFollowModel().getMaxDecel()) + ")");
288  }
289 }
290 
291 
292 void
293 VehicleType::setApparentDecel(const std::string& typeID, double decel) {
294  getVType(typeID)->setApparentDecel(decel);
295 }
296 
297 
298 void
299 VehicleType::setImperfection(const std::string& typeID, double imperfection) {
300  getVType(typeID)->setImperfection(imperfection);
301 }
302 
303 
304 void
305 VehicleType::setTau(const std::string& typeID, double tau) {
306  getVType(typeID)->setTau(tau);
307 }
308 
309 
310 void
311 VehicleType::setColor(const std::string& typeID, const TraCIColor& c) {
313 }
314 
315 
316 void
317 VehicleType::setMinGapLat(const std::string& typeID, double minGapLat) {
318  getVType(typeID)->setMinGapLat(minGapLat);
319 }
320 
321 
322 void
323 VehicleType::setMaxSpeedLat(const std::string& typeID, double speed) {
324  getVType(typeID)->setMaxSpeedLat(speed);
325 }
326 
327 
328 void
329 VehicleType::setLateralAlignment(const std::string& typeID, const std::string& latAlignment) {
331 }
332 
333 
334 void
335 VehicleType::copy(const std::string& origTypeID, const std::string& newTypeID) {
336  getVType(origTypeID)->duplicateType(newTypeID, true);
337 }
338 
339 
340 void
341 VehicleType::setParameter(const std::string& typeID, const std::string& name, const std::string& value) {
342  ((SUMOVTypeParameter&)getVType(typeID)->getParameter()).setParameter(name, value);
343 }
344 
345 
347 
348 
350 VehicleType::getVType(std::string id) {
352  if (t == nullptr) {
353  throw TraCIException("Vehicle type '" + id + "' is not known");
354  }
355  return t;
356 }
357 
358 
359 std::shared_ptr<VariableWrapper>
361  return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
362 }
363 
364 
365 bool
366 VehicleType::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) {
367  switch (variable) {
368  case TRACI_ID_LIST:
369  return wrapper->wrapStringList(objID, variable, getIDList());
370  case ID_COUNT:
371  return wrapper->wrapInt(objID, variable, getIDCount());
372  case VAR_LENGTH:
373  return wrapper->wrapDouble(objID, variable, getLength(objID));
374  case VAR_HEIGHT:
375  return wrapper->wrapDouble(objID, variable, getHeight(objID));
376  case VAR_MINGAP:
377  return wrapper->wrapDouble(objID, variable, getMinGap(objID));
378  case VAR_MAXSPEED:
379  return wrapper->wrapDouble(objID, variable, getMaxSpeed(objID));
380  case VAR_ACCEL:
381  return wrapper->wrapDouble(objID, variable, getAccel(objID));
382  case VAR_DECEL:
383  return wrapper->wrapDouble(objID, variable, getDecel(objID));
384  case VAR_EMERGENCY_DECEL:
385  return wrapper->wrapDouble(objID, variable, getEmergencyDecel(objID));
386  case VAR_APPARENT_DECEL:
387  return wrapper->wrapDouble(objID, variable, getApparentDecel(objID));
389  return wrapper->wrapDouble(objID, variable, getActionStepLength(objID));
390  case VAR_IMPERFECTION:
391  return wrapper->wrapDouble(objID, variable, getImperfection(objID));
392  case VAR_TAU:
393  return wrapper->wrapDouble(objID, variable, getTau(objID));
394  case VAR_SPEED_FACTOR:
395  return wrapper->wrapDouble(objID, variable, getSpeedFactor(objID));
396  case VAR_SPEED_DEVIATION:
397  return wrapper->wrapDouble(objID, variable, getSpeedDeviation(objID));
398  case VAR_VEHICLECLASS:
399  return wrapper->wrapString(objID, variable, getVehicleClass(objID));
400  case VAR_EMISSIONCLASS:
401  return wrapper->wrapString(objID, variable, getEmissionClass(objID));
402  case VAR_SHAPECLASS:
403  return wrapper->wrapString(objID, variable, getShapeClass(objID));
404  case VAR_WIDTH:
405  return wrapper->wrapDouble(objID, variable, getWidth(objID));
406  case VAR_COLOR:
407  return wrapper->wrapColor(objID, variable, getColor(objID));
408  case VAR_MINGAP_LAT:
409  return wrapper->wrapDouble(objID, variable, getMinGapLat(objID));
410  case VAR_MAXSPEED_LAT:
411  return wrapper->wrapDouble(objID, variable, getMaxSpeedLat(objID));
412  case VAR_LATALIGNMENT:
413  return wrapper->wrapString(objID, variable, getLateralAlignment(objID));
414  case VAR_PERSON_CAPACITY:
415  return wrapper->wrapInt(objID, variable, getPersonCapacity(objID));
416  default:
417  return false;
418  }
419 }
420 
421 
422 }
423 
424 
425 /****************************************************************************/
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
libsumo::VAR_HEIGHT
TRACI_CONST int VAR_HEIGHT
Definition: TraCIConstants.h:770
libsumo::VehicleType::myContextSubscriptionResults
static ContextSubscriptionResults myContextSubscriptionResults
Definition: VehicleType.h:115
libsumo::VehicleType::getIDCount
static int getIDCount()
Definition: VehicleType.cpp:54
MSCFModel::getMaxAccel
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Definition: MSCFModel.h:210
MSVehicleType::setPreferredLateralAlignment
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
Definition: MSVehicleType.cpp:162
MSCFModel::getMaxDecel
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:218
libsumo::VehicleType
Definition: VehicleType.h:93
MSVehicleType::setMinGapLat
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
Definition: MSVehicleType.cpp:123
libsumo::VehicleType::mySubscriptionResults
static SubscriptionResults mySubscriptionResults
Definition: VehicleType.h:114
getVehicleClassID
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
Definition: SUMOVehicleClass.cpp:201
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
libsumo::VAR_EMISSIONCLASS
TRACI_CONST int VAR_EMISSIONCLASS
Definition: TraCIConstants.h:655
MSCFModel::getImperfection
virtual double getImperfection() const
Get the driver's imperfection.
Definition: MSCFModel.h:251
libsumo::VariableWrapper::wrapString
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
libsumo::VAR_MINGAP
TRACI_CONST int VAR_MINGAP
Definition: TraCIConstants.h:661
libsumo::Helper::makeTraCIColor
static TraCIColor makeTraCIColor(const RGBColor &color)
Definition: Helper.cpp:247
MSVehicleControl::getVType
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
Definition: MSVehicleControl.cpp:348
libsumo::VAR_MAXSPEED
TRACI_CONST int VAR_MAXSPEED
Definition: TraCIConstants.h:613
SUMOVehicleParserHelper.h
libsumo::VariableWrapper
Definition: Subscription.h:114
libsumo::VAR_COLOR
TRACI_CONST int VAR_COLOR
Definition: TraCIConstants.h:628
libsumo::VehicleType::getParameter
static LIBSUMO_VEHICLE_TYPE_GETTER std::string getParameter(const std::string &typeID, const std::string &key)
Definition: VehicleType.cpp:186
MSVehicleType::setVClass
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
Definition: MSVehicleType.cpp:156
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
libsumo::Helper::makeRGBColor
static RGBColor makeRGBColor(const TraCIColor &color)
Definition: Helper.cpp:258
MSVehicleType::getMaxSpeedLat
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
Definition: MSVehicleType.h:314
libsumo::VAR_WIDTH
TRACI_CONST int VAR_WIDTH
Definition: TraCIConstants.h:664
MSVehicleType::setEmergencyDecel
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
Definition: MSVehicleType.cpp:408
libsumo::VehicleType::getIDList
static std::vector< std::string > getIDList()
Definition: VehicleType.cpp:46
libsumo::VAR_VEHICLECLASS
TRACI_CONST int VAR_VEHICLECLASS
Definition: TraCIConstants.h:652
libsumo::ContextSubscriptionResults
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:205
libsumo::VAR_ACCEL
TRACI_CONST int VAR_ACCEL
Definition: TraCIConstants.h:631
libsumo::VehicleType::handleVariable
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
Definition: VehicleType.cpp:366
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
VehicleType.h
MSVehicleType::setMinGap
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
Definition: MSVehicleType.cpp:112
MSVehicleType::setWidth
void setWidth(const double &width)
Set a new value for this type's width.
Definition: MSVehicleType.cpp:252
PollutantsInterface::getName
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
Definition: PollutantsInterface.cpp:100
MSVehicleType::getPersonCapacity
int getPersonCapacity() const
Get this vehicle type's person capacity.
Definition: MSVehicleType.h:285
getVehicleShapeName
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
Definition: SUMOVehicleClass.cpp:359
MSVehicleType::getMinGapLat
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
Definition: MSVehicleType.h:133
libsumo::VariableWrapper::wrapColor
virtual bool wrapColor(const std::string &objID, const int variable, const TraCIColor &value)=0
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
libsumo::VehicleType::getVType
static MSVehicleType * getVType(std::string id)
Definition: VehicleType.cpp:350
MSVehicleType.h
libsumo::VehicleType::makeWrapper
static LIBSUMO_SUBSCRIPTION_API std::shared_ptr< VariableWrapper > makeWrapper()
Definition: VehicleType.cpp:360
libsumo
Definition: Edge.cpp:30
MSVehicleType::getHeight
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:254
libsumo::VAR_TAU
TRACI_CONST int VAR_TAU
Definition: TraCIConstants.h:649
MSVehicleType::setColor
void setColor(const RGBColor &color)
Set a new value for this type's color.
Definition: MSVehicleType.cpp:245
libsumo::VehicleType::copy
static LIBSUMO_VEHICLE_TYPE_SETTER void copy(const std::string &origTypeID, const std::string &newTypeID)
Definition: VehicleType.cpp:335
libsumo::VAR_MINGAP_LAT
TRACI_CONST int VAR_MINGAP_LAT
Definition: TraCIConstants.h:767
SUMOVehicleParserHelper::processActionStepLength
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
Definition: SUMOVehicleParserHelper.cpp:1390
libsumo::VariableWrapper::wrapDouble
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
Distribution_Parameterized::getParameter
std::vector< double > & getParameter()
Returns the parameters of this distribution.
Definition: Distribution_Parameterized.cpp:111
libsumo::VAR_LATALIGNMENT
TRACI_CONST int VAR_LATALIGNMENT
Definition: TraCIConstants.h:761
TraCIConstants.h
MSVehicleType::getCarFollowModel
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
Definition: MSVehicleType.h:141
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:247
PollutantsInterface.h
SUMOVTypeParameter
Structure representing possible vehicle parameter.
Definition: SUMOVTypeParameter.h:86
libsumo::VariableWrapper::wrapStringList
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
SUMOVTypeParameter::cfParameter
SubParams cfParameter
Car-following parameter.
Definition: SUMOVTypeParameter.h:282
MSVehicleType::setActionStepLength
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
Definition: MSVehicleType.cpp:202
Helper.h
libsumo::VehicleType::setSpeedDeviation
static void setSpeedDeviation(const std::string &typeID, double deviation)
Definition: VehicleType.cpp:226
libsumo::TRACI_ID_LIST
TRACI_CONST int TRACI_ID_LIST
Definition: TraCIConstants.h:496
MSVehicleType::setLength
void setLength(const double &length)
Set a new value for this type's length.
Definition: MSVehicleType.cpp:90
MSVehicleType::getMinGap
double getMinGap() const
Get the free space in front of vehicles of this class.
Definition: MSVehicleType.h:126
LIBSUMO_SUBSCRIPTION_IMPLEMENTATION
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
Definition: TraCIDefs.h:51
MSVehicleType::setDecel
void setDecel(double decel)
Set a new value for this type's deceleration.
Definition: MSVehicleType.cpp:399
libsumo::ID_COUNT
TRACI_CONST int ID_COUNT
Definition: TraCIConstants.h:499
libsumo::VAR_SPEED_FACTOR
TRACI_CONST int VAR_SPEED_FACTOR
Definition: TraCIConstants.h:727
libsumo::VAR_SPEED_DEVIATION
TRACI_CONST int VAR_SPEED_DEVIATION
Definition: TraCIConstants.h:730
libsumo::VAR_LENGTH
TRACI_CONST int VAR_LENGTH
Definition: TraCIConstants.h:625
libsumo::TraCIException
Definition: TraCIDefs.h:90
MSVehicleType::getSpeedFactor
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
Definition: MSVehicleType.h:210
libsumo::VAR_EMERGENCY_DECEL
TRACI_CONST int VAR_EMERGENCY_DECEL
Definition: TraCIConstants.h:637
MSVehicleType::setShape
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
Definition: MSVehicleType.cpp:273
MSVehicleType::setMaxSpeedLat
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
Definition: MSVehicleType.cpp:145
PollutantsInterface::getClassByName
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
Definition: PollutantsInterface.cpp:54
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
libsumo::VAR_SHAPECLASS
TRACI_CONST int VAR_SHAPECLASS
Definition: TraCIConstants.h:658
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
MSVehicleType::setSpeedDeviation
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
Definition: MSVehicleType.cpp:191
MSCFModel::getHeadwayTime
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
Definition: MSCFModel.h:259
MSVehicleType::getActionStepLengthSecs
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
Definition: MSVehicleType.h:226
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:110
MSVehicleType::setApparentDecel
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
Definition: MSVehicleType.cpp:417
libsumo::VariableWrapper::wrapInt
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:556
MSCFModel::getEmergencyDecel
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
Definition: MSCFModel.h:226
libsumo::VAR_DECEL
TRACI_CONST int VAR_DECEL
Definition: TraCIConstants.h:634
SUMO_ATTR_EMERGENCYDECEL
Definition: SUMOXMLDefinitions.h:448
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:162
getVehicleShapeID
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
Definition: SUMOVehicleClass.cpp:343
MSVehicleControl::insertVTypeIDs
void insertVTypeIDs(std::vector< std::string > &into) const
Inserts ids of all known vehicle types and vehicle type distributions to the given vector.
Definition: MSVehicleControl.cpp:367
config.h
libsumo::VehicleType::setParameter
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
Definition: VehicleType.cpp:341
MSVehicleType::setMaxSpeed
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
Definition: MSVehicleType.cpp:134
libsumo::VAR_IMPERFECTION
TRACI_CONST int VAR_IMPERFECTION
Definition: TraCIConstants.h:724
libsumo::VAR_APPARENT_DECEL
TRACI_CONST int VAR_APPARENT_DECEL
Definition: TraCIConstants.h:640
SUMOXMLDefinitions::LateralAlignments
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
Definition: SUMOXMLDefinitions.h:1396
libsumo::VAR_MAXSPEED_LAT
TRACI_CONST int VAR_MAXSPEED_LAT
Definition: TraCIConstants.h:764
MSVehicleType::setSpeedFactor
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
Definition: MSVehicleType.cpp:180
libsumo::VAR_PERSON_CAPACITY
TRACI_CONST int VAR_PERSON_CAPACITY
Definition: TraCIConstants.h:806
libsumo::VAR_ACTIONSTEPLENGTH
TRACI_CONST int VAR_ACTIONSTEPLENGTH
Definition: TraCIConstants.h:643
MSVehicleControl.h
MSNet::getVehicleControl
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:337
libsumo::SubscriptionResults
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:204
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