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