SUMO - Simulation of Urban MObility
TraCIServerAPI_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) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
22 // APIs for getting/setting vehicle type values via TraCI
23 /****************************************************************************/
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #ifndef NO_TRACI
36 
37 #include <limits>
39 #include <microsim/MSNet.h>
40 #include <microsim/MSVehicleType.h>
41 #include <libsumo/VehicleType.h>
42 #include "TraCIConstants.h"
44 
45 
46 // ===========================================================================
47 // method definitions
48 // ===========================================================================
49 bool
51  tcpip::Storage& outputStorage) {
52  // variable & id
53  int variable = inputStorage.readUnsignedByte();
54  std::string id = inputStorage.readString();
55  // check variable
56  if (variable != ID_LIST && variable != VAR_LENGTH && variable != VAR_MAXSPEED && variable != VAR_ACCEL
57  && variable != VAR_DECEL && variable != VAR_EMERGENCY_DECEL && variable != VAR_APPARENT_DECEL
58  && variable != VAR_TAU && variable != VAR_VEHICLECLASS && variable != VAR_EMISSIONCLASS
59  && variable != VAR_SHAPECLASS && variable != VAR_ACTIONSTEPLENGTH
60  && variable != VAR_SPEED_FACTOR && variable != VAR_SPEED_DEVIATION && variable != VAR_IMPERFECTION
61  && variable != VAR_MINGAP && variable != VAR_WIDTH && variable != VAR_COLOR && variable != ID_COUNT
62  && variable != VAR_HEIGHT
63  && variable != VAR_MINGAP_LAT
64  && variable != VAR_MAXSPEED_LAT
65  && variable != VAR_LATALIGNMENT
66  && variable != VAR_PARAMETER) {
68  "Get Vehicle Type Variable: unsupported variable " + toHex(variable, 2)
69  + " specified", outputStorage);
70  }
71  // begin response building
72  tcpip::Storage tempMsg;
73  // response-code, variableID, objectID
75  tempMsg.writeUnsignedByte(variable);
76  tempMsg.writeString(id);
77  // process request
78  if (variable == ID_LIST) {
79  std::vector<std::string> ids = libsumo::VehicleType::getIDList();
81  tempMsg.writeStringList(ids);
82  } else if (variable == ID_COUNT) {
83  std::vector<std::string> ids = libsumo::VehicleType::getIDList();
85  tempMsg.writeInt((int) ids.size());
86  } else {
87  try {
88  switch (variable) {
89  case VAR_PARAMETER: {
90  std::string paramName = "";
91  if (!server.readTypeCheckingString(inputStorage, paramName)) {
93  "Retrieval of a parameter requires its name.", outputStorage);
94  }
96  tempMsg.writeString(libsumo::VehicleType::getParameter(id, paramName));
97  }
98  break;
99  default:
100  getVariable(variable, id, tempMsg);
101  break;
102  }
103  } catch (libsumo::TraCIException& e) {
104  return server.writeErrorStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, e.what(), outputStorage);
105  }
106  }
107  server.writeStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, RTYPE_OK, "", outputStorage);
108  server.writeResponseWithLength(outputStorage, tempMsg);
109  return true;
110 }
111 
112 bool
113 TraCIServerAPI_VehicleType::getVariable(const int variable, const std::string& id, tcpip::Storage& tempMsg) {
114  switch (variable) {
115  case VAR_LENGTH: {
118  }
119  break;
120  case VAR_HEIGHT: {
123  }
124  break;
125  case VAR_MINGAP: {
128  }
129  break;
130  case VAR_MAXSPEED: {
133  }
134  break;
135  case VAR_ACCEL: {
138  }
139  break;
140  case VAR_DECEL: {
143  }
144  break;
145  case VAR_EMERGENCY_DECEL: {
148  }
149  break;
150  case VAR_APPARENT_DECEL: {
153  }
154  break;
155  case VAR_ACTIONSTEPLENGTH: {
158  }
159  break;
160  case VAR_IMPERFECTION: {
163  }
164  break;
165  case VAR_TAU: {
168  }
169  break;
170  case VAR_SPEED_FACTOR: {
173  }
174  break;
175  case VAR_SPEED_DEVIATION: {
178  }
179  break;
180  case VAR_VEHICLECLASS: {
183  }
184  break;
185  case VAR_EMISSIONCLASS: {
188  }
189  break;
190  case VAR_SHAPECLASS: {
193  }
194  break;
195  case VAR_WIDTH: {
198  }
199  break;
200  case VAR_COLOR: {
201  tempMsg.writeUnsignedByte(TYPE_COLOR);
203  tempMsg.writeUnsignedByte(col.r);
204  tempMsg.writeUnsignedByte(col.g);
205  tempMsg.writeUnsignedByte(col.b);
206  tempMsg.writeUnsignedByte(col.a);
207  }
208  break;
209  case VAR_MINGAP_LAT: {
212  }
213  break;
214  case VAR_MAXSPEED_LAT: {
217  }
218  break;
219  case VAR_LATALIGNMENT: {
222  }
223  break;
224  default:
225  break;
226  }
227  return true;
228 }
229 
230 bool
232  tcpip::Storage& outputStorage) {
233  std::string warning = ""; // additional description for response
234  // variable
235  int variable = inputStorage.readUnsignedByte();
236  if (variable != VAR_LENGTH && variable != VAR_MAXSPEED && variable != VAR_VEHICLECLASS
237  && variable != VAR_SPEED_FACTOR && variable != VAR_SPEED_DEVIATION && variable != VAR_EMISSIONCLASS
238  && variable != VAR_WIDTH && variable != VAR_MINGAP && variable != VAR_SHAPECLASS
239  && variable != VAR_ACCEL && variable != VAR_IMPERFECTION
240  && variable != VAR_DECEL && variable != VAR_EMERGENCY_DECEL && variable != VAR_APPARENT_DECEL
241  && variable != VAR_TAU && variable != VAR_COLOR && variable != VAR_ACTIONSTEPLENGTH
242  && variable != VAR_HEIGHT
243  && variable != VAR_MINGAP_LAT
244  && variable != VAR_MAXSPEED_LAT
245  && variable != VAR_LATALIGNMENT
246  && variable != VAR_PARAMETER
247  && variable != COPY
248  ) {
250  "Change Vehicle Type State: unsupported variable " + toHex(variable, 2)
251  + " specified", outputStorage);
252  }
253  // id
254  std::string id = inputStorage.readString();
255 // MSVehicleType* v = libsumo::VehicleType::getVType(id);
256 // if (v == 0) {
257 // return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, "Vehicle type '" + id + "' is not known",
258 // outputStorage);
259 // }
260  // process
261  try {
262  if (setVariable(CMD_SET_VEHICLETYPE_VARIABLE, variable, id, server, inputStorage, outputStorage)) {
263  server.writeStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, RTYPE_OK, warning, outputStorage);
264  return true;
265  }
266  } catch (ProcessError& e) {
267  return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, e.what(), outputStorage);
268  } catch (libsumo::TraCIException& e) {
269  return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, e.what(), outputStorage);
270  }
271  return false;
272 }
273 
274 
275 bool
276 TraCIServerAPI_VehicleType::setVariable(const int cmd, const int variable,
277  const std::string& id, TraCIServer& server,
278  tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) {
279  switch (variable) {
280  case VAR_LENGTH: {
281  double value = 0;
282  if (!server.readTypeCheckingDouble(inputStorage, value)) {
283  return server.writeErrorStatusCmd(cmd, "Setting length requires a double.", outputStorage);
284  }
285  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
286  return server.writeErrorStatusCmd(cmd, "Invalid length.", outputStorage);
287  }
289  }
290  break;
291  case VAR_HEIGHT: {
292  double value = 0;
293  if (!server.readTypeCheckingDouble(inputStorage, value)) {
294  return server.writeErrorStatusCmd(cmd, "Setting height requires a double.", outputStorage);
295  }
296  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
297  return server.writeErrorStatusCmd(cmd, "Invalid height.", outputStorage);
298  }
300  }
301  break;
302  case VAR_MAXSPEED: {
303  double value = 0;
304  if (!server.readTypeCheckingDouble(inputStorage, value)) {
305  return server.writeErrorStatusCmd(cmd, "Setting maximum speed requires a double.", outputStorage);
306  }
307  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
308  return server.writeErrorStatusCmd(cmd, "Invalid maximum speed.", outputStorage);
309  }
311  }
312  break;
313  case VAR_VEHICLECLASS: {
314  std::string vclass;
315  if (!server.readTypeCheckingString(inputStorage, vclass)) {
316  return server.writeErrorStatusCmd(cmd, "Setting vehicle class requires a string.", outputStorage);
317  }
318  try {
320  } catch (InvalidArgument e) {
321  return server.writeErrorStatusCmd(cmd, "Unknown vehicle class '" + vclass + "'.", outputStorage);
322  }
323  }
324  break;
325  case VAR_SPEED_FACTOR: {
326  double value = 0;
327  if (!server.readTypeCheckingDouble(inputStorage, value)) {
328  return server.writeErrorStatusCmd(cmd, "Setting speed factor requires a double.", outputStorage);
329  }
330  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
331  return server.writeErrorStatusCmd(cmd, "Invalid speed factor.", outputStorage);
332  }
334  }
335  break;
336  case VAR_SPEED_DEVIATION: {
337  double value = 0;
338  if (!server.readTypeCheckingDouble(inputStorage, value)) {
339  return server.writeErrorStatusCmd(cmd, "Setting speed deviation requires a double.", outputStorage);
340  }
341  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
342  return server.writeErrorStatusCmd(cmd, "Invalid speed deviation.", outputStorage);
343  }
345  }
346  break;
347  case VAR_EMISSIONCLASS: {
348  std::string eclass;
349  if (!server.readTypeCheckingString(inputStorage, eclass)) {
350  return server.writeErrorStatusCmd(cmd, "Setting emission class requires a string.", outputStorage);
351  }
352  try {
354  } catch (InvalidArgument e) {
355  return server.writeErrorStatusCmd(cmd, "Unknown emission class '" + eclass + "'.", outputStorage);
356  }
357  }
358  break;
359  case VAR_WIDTH: {
360  double value = 0;
361  if (!server.readTypeCheckingDouble(inputStorage, value)) {
362  return server.writeErrorStatusCmd(cmd, "Setting width requires a double.", outputStorage);
363  }
364  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
365  return server.writeErrorStatusCmd(cmd, "Invalid width.", outputStorage);
366  }
368  }
369  break;
370  case VAR_MINGAP: {
371  double value = 0;
372  if (!server.readTypeCheckingDouble(inputStorage, value)) {
373  return server.writeErrorStatusCmd(cmd, "Setting minimum gap requires a double.", outputStorage);
374  }
375  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
376  return server.writeErrorStatusCmd(cmd, "Invalid minimum gap.", outputStorage);
377  }
379  }
380  break;
381  case VAR_MINGAP_LAT: {
382  double value = 0;
383  if (!server.readTypeCheckingDouble(inputStorage, value)) {
384  return server.writeErrorStatusCmd(cmd, "Setting minimum lateral gap requires a double.", outputStorage);
385  }
386  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
387  return server.writeErrorStatusCmd(cmd, "Invalid minimum lateral gap.", outputStorage);
388  }
390  }
391  break;
392  case VAR_MAXSPEED_LAT: {
393  double value = 0;
394  if (!server.readTypeCheckingDouble(inputStorage, value)) {
395  return server.writeErrorStatusCmd(cmd, "Setting maximum lateral speed requires a double.", outputStorage);
396  }
397  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
398  return server.writeErrorStatusCmd(cmd, "Invalid maximum lateral speed.", outputStorage);
399  }
401  }
402  break;
403  case VAR_LATALIGNMENT: {
404  std::string latAlign;
405  if (!server.readTypeCheckingString(inputStorage, latAlign)) {
406  return server.writeErrorStatusCmd(cmd, "Setting preferred lateral alignment requires a string.",
407  outputStorage);
408  }
409  if (SUMOXMLDefinitions::LateralAlignments.hasString(latAlign)) {
411  } else {
412  return server.writeErrorStatusCmd(cmd, "Unknown lateral alignment " + latAlign + "'.", outputStorage);
413  }
414  }
415  break;
416  case VAR_SHAPECLASS: {
417  std::string sclass;
418  if (!server.readTypeCheckingString(inputStorage, sclass)) {
419  return server.writeErrorStatusCmd(cmd, "Setting vehicle shape requires a string.", outputStorage);
420  }
421  try {
423  } catch (InvalidArgument e) {
424  return server.writeErrorStatusCmd(cmd, "Unknown vehicle shape " + sclass + "'.", outputStorage);
425  }
426  }
427  break;
428  case VAR_ACCEL: {
429  double value = 0;
430  if (!server.readTypeCheckingDouble(inputStorage, value)) {
431  return server.writeErrorStatusCmd(cmd, "Setting acceleration requires a double.", outputStorage);
432  }
433  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
434  return server.writeErrorStatusCmd(cmd, "Invalid acceleration.", outputStorage);
435  }
437  }
438  break;
439  case VAR_DECEL: {
440  double value = 0;
441  if (!server.readTypeCheckingDouble(inputStorage, value)) {
442  return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage);
443  }
444  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
445  return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage);
446  }
448  }
449  break;
450  case VAR_EMERGENCY_DECEL: {
451  double value = 0;
452  if (!server.readTypeCheckingDouble(inputStorage, value)) {
453  return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage);
454  }
455  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
456  return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage);
457  }
459  }
460  break;
461  case VAR_APPARENT_DECEL: {
462  double value = 0;
463  if (!server.readTypeCheckingDouble(inputStorage, value)) {
464  return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage);
465  }
466  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
467  return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage);
468  }
470  }
471  break;
472  case VAR_ACTIONSTEPLENGTH: {
473  double value = 0;
474  if (!server.readTypeCheckingDouble(inputStorage, value)) {
475  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting action step length requires a double.", outputStorage);
476  }
477  if (fabs(value) == std::numeric_limits<double>::infinity()) {
478  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Invalid action step length.", outputStorage);
479  }
480  bool resetActionOffset = value >= 0.0;
481  libsumo::VehicleType::setActionStepLength(id, fabs(value), resetActionOffset);
482  }
483  break;
484  case VAR_IMPERFECTION: {
485  double value = 0;
486  if (!server.readTypeCheckingDouble(inputStorage, value)) {
487  return server.writeErrorStatusCmd(cmd, "Setting driver imperfection requires a double.", outputStorage);
488  }
489  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
490  return server.writeErrorStatusCmd(cmd, "Invalid driver imperfection.", outputStorage);
491  }
493  }
494  break;
495  case VAR_TAU: {
496  double value = 0;
497  if (!server.readTypeCheckingDouble(inputStorage, value)) {
498  return server.writeErrorStatusCmd(cmd, "Setting headway time requires a double.", outputStorage);
499  }
500  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
501  return server.writeErrorStatusCmd(cmd, "Invalid headway time.", outputStorage);
502  }
503  libsumo::VehicleType::setTau(id, value);
504  }
505  break;
506  case VAR_COLOR: {
508  if (!server.readTypeCheckingColor(inputStorage, col)) {
509  return server.writeErrorStatusCmd(cmd, "The color must be given using the according type.", outputStorage);
510  }
512  }
513  break;
514  case COPY: {
515  std::string newTypeID;
516  if (!server.readTypeCheckingString(inputStorage, newTypeID)) {
517  return server.writeErrorStatusCmd(cmd, "copying a vehicle type requires a string.",
518  outputStorage);
519  }
520  libsumo::VehicleType::copy(id, newTypeID);
521  }
522  break;
523  case VAR_PARAMETER: {
524  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
525  return server.writeErrorStatusCmd(cmd, "A compound object is needed for setting a parameter.",
526  outputStorage);
527  }
528  //readt itemNo
529  inputStorage.readInt();
530  std::string name;
531  if (!server.readTypeCheckingString(inputStorage, name)) {
532  return server.writeErrorStatusCmd(cmd, "The name of the parameter must be given as a string.",
533  outputStorage);
534  }
535  std::string value;
536  if (!server.readTypeCheckingString(inputStorage, value)) {
537  return server.writeErrorStatusCmd(cmd, "The value of the parameter must be given as a string.",
538  outputStorage);
539  }
540  libsumo::VehicleType::setParameter(id, name, value);
541  }
542  break;
543  default:
544  break;
545  }
546  return true;
547 }
548 
549 #endif
550 
551 
552 /****************************************************************************/
static double getImperfection(const std::string &typeID)
static void setSpeedFactor(const std::string &typeID, double factor)
static double getHeight(const std::string &typeID)
unsigned char g
Definition: TraCIDefs.h:79
static double getDecel(const std::string &typeID)
Definition: VehicleType.cpp:85
bool readTypeCheckingColor(tcpip::Storage &inputStorage, libsumo::TraCIColor &into)
Reads the value type and a color, verifying the type.
#define VAR_EMISSIONCLASS
static double getEmergencyDecel(const std::string &typeID)
Definition: VehicleType.cpp:91
#define VAR_LENGTH
#define VAR_LATALIGNMENT
static double getSpeedDeviation(const std::string &typeID)
Definition: VehicleType.cpp:73
#define TYPE_COMPOUND
#define RESPONSE_GET_VEHICLETYPE_VARIABLE
static double getSpeedFactor(const std::string &typeID)
Definition: VehicleType.cpp:67
#define VAR_TAU
#define RTYPE_OK
#define VAR_HEIGHT
static double getMaxSpeed(const std::string &typeID)
Definition: VehicleType.cpp:55
static void setSpeedDeviation(const std::string &typeID, double deviation)
#define VAR_VEHICLECLASS
static void setLength(const std::string &typeID, double length)
static std::string getParameter(const std::string &typeID, const std::string &key)
#define VAR_SPEED_FACTOR
#define VAR_COLOR
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
#define TYPE_COLOR
#define TYPE_STRINGLIST
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
static double getApparentDecel(const std::string &typeID)
Definition: VehicleType.cpp:97
virtual void writeUnsignedByte(int)
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
static void setMaxSpeed(const std::string &typeID, double speed)
static bool getVariable(const int variable, const std::string &v, tcpip::Storage &tempMsg)
Processes a value request for the given type.
#define VAR_SPEED_DEVIATION
virtual void writeInt(int)
#define TYPE_STRING
virtual int readUnsignedByte()
static double getLength(const std::string &typeID)
Definition: VehicleType.cpp:49
static void setApparentDecel(const std::string &typeID, double decel)
unsigned char b
Definition: TraCIDefs.h:79
#define CMD_GET_VEHICLETYPE_VARIABLE
static void setTau(const std::string &typeID, double tau)
#define VAR_SHAPECLASS
static std::string getVehicleClass(const std::string &typeID)
static void setWidth(const std::string &typeID, double width)
#define VAR_ACCEL
virtual int readInt()
#define VAR_ACTIONSTEPLENGTH
#define CMD_SET_VEHICLETYPE_VARIABLE
#define VAR_EMERGENCY_DECEL
static void setMinGapLat(const std::string &typeID, double minGapLat)
static void setShapeClass(const std::string &typeID, const std::string &shapeClass)
static void copy(const std::string &origTypeID, const std::string &newTypeID)
unsigned char a
Definition: TraCIDefs.h:79
virtual void writeStringList(const std::vector< std::string > &s)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa5: Get Vehicle Type Variable)
#define CMD_SET_VEHICLE_VARIABLE
#define VAR_IMPERFECTION
static double getMaxSpeedLat(const std::string &typeID)
virtual std::string readString()
unsigned char r
Definition: TraCIDefs.h:79
static void setActionStepLength(const std::string &typeID, double actionStepLength, bool resetActionOffset)
static double getWidth(const std::string &typeID)
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:69
#define COPY
static void setDecel(const std::string &typeID, double decel)
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
static void setImperfection(const std::string &typeID, double imperfection)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc5: Change Vehicle Type State)
static std::string getEmissionClass(const std::string &typeID)
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
static bool setVariable(const int cmd, const int variable, const std::string &id, TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value for the given type.
virtual void writeString(const std::string &s)
static void setParameter(const std::string &id, const std::string &name, const std::string &value)
static void setEmergencyDecel(const std::string &typeID, double decel)
static void setLateralAlignment(const std::string &typeID, const std::string &latAlignment)
static void setMinGap(const std::string &typeID, double minGap)
#define TYPE_DOUBLE
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:65
static double getActionStepLength(const std::string &typeID)
Definition: VehicleType.cpp:61
static void setMaxSpeedLat(const std::string &typeID, double speed)
static double getMinGap(const std::string &typeID)
virtual void writeDouble(double)
static void setColor(const std::string &typeID, const TraCIColor &c)
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
#define VAR_APPARENT_DECEL
static double getMinGapLat(const std::string &typeID)
#define VAR_MAXSPEED
static double getTau(const std::string &typeID)
#define VAR_MINGAP_LAT
#define VAR_DECEL
static double getAccel(const std::string &typeID)
Definition: VehicleType.cpp:79
static std::string getLateralAlignment(const std::string &typeID)
#define VAR_PARAMETER
#define ID_COUNT
static void setHeight(const std::string &typeID, double height)
static void setEmissionClass(const std::string &typeID, const std::string &clazz)
#define TYPE_INTEGER
#define VAR_MINGAP
#define ID_LIST
static void setVehicleClass(const std::string &typeID, const std::string &clazz)
static std::string getShapeClass(const std::string &typeID)
#define VAR_MAXSPEED_LAT
static TraCIColor getColor(const std::string &typeID)
static void setAccel(const std::string &typeID, double accel)
static std::vector< std::string > getIDList()
Definition: VehicleType.cpp:42
#define VAR_WIDTH