SUMO - Simulation of Urban MObility
TraCIServerAPI_VehicleType.cpp
Go to the documentation of this file.
1 /****************************************************************************/
12 // APIs for getting/setting vehicle type values via TraCI
13 /****************************************************************************/
14 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
15 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #ifndef NO_TRACI
37 
38 #include <limits>
40 #include <microsim/MSNet.h>
41 #include <microsim/MSVehicleType.h>
43 #include "TraCIConstants.h"
45 #include "lib/TraCI.h"
46 
47 
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
51 bool
53  tcpip::Storage& outputStorage) {
54  // variable & id
55  int variable = inputStorage.readUnsignedByte();
56  std::string id = inputStorage.readString();
57  // check variable
58  if (variable != ID_LIST && variable != VAR_LENGTH && variable != VAR_MAXSPEED && variable != VAR_ACCEL
59  && variable != VAR_DECEL && variable != VAR_EMERGENCY_DECEL && variable != VAR_APPARENT_DECEL
60  && variable != VAR_TAU && variable != VAR_VEHICLECLASS && variable != VAR_EMISSIONCLASS
61  && variable != VAR_SHAPECLASS
62  && variable != VAR_SPEED_FACTOR && variable != VAR_SPEED_DEVIATION && variable != VAR_IMPERFECTION
63  && variable != VAR_MINGAP && variable != VAR_WIDTH && variable != VAR_COLOR && variable != ID_COUNT
64  && variable != VAR_HEIGHT
65  && variable != VAR_MINGAP_LAT
66  && variable != VAR_MAXSPEED_LAT
67  && variable != VAR_LATALIGNMENT
68  && variable != VAR_PARAMETER) {
70  "Get Vehicle Type Variable: unsupported variable " + toHex(variable, 2)
71  + " specified", outputStorage);
72  }
73  // begin response building
74  tcpip::Storage tempMsg;
75  // response-code, variableID, objectID
77  tempMsg.writeUnsignedByte(variable);
78  tempMsg.writeString(id);
79  // process request
80  if (variable == ID_LIST) {
81  std::vector<std::string> ids = TraCI_VehicleType::getIDList();
83  tempMsg.writeStringList(ids);
84  } else if (variable == ID_COUNT) {
85  std::vector<std::string> ids = TraCI_VehicleType::getIDList();
87  tempMsg.writeInt((int) ids.size());
88  } else {
89  try {
90  switch (variable) {
91  case VAR_PARAMETER: {
92  std::string paramName = "";
93  if (!server.readTypeCheckingString(inputStorage, paramName)) {
95  "Retrieval of a parameter requires its name.", outputStorage);
96  }
98  tempMsg.writeString(TraCI_VehicleType::getParameter(id, paramName));
99  }
100  break;
101  default:
102  getVariable(variable, id, tempMsg);
103  break;
104  }
105  } catch (TraCIException& e) {
106  return server.writeErrorStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, e.what(), outputStorage);
107  }
108  }
109  server.writeStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, RTYPE_OK, "", outputStorage);
110  server.writeResponseWithLength(outputStorage, tempMsg);
111  return true;
112 }
113 
114 bool
115 TraCIServerAPI_VehicleType::getVariable(const int variable, const std::string& id, tcpip::Storage& tempMsg) {
116  switch (variable) {
117  case VAR_LENGTH: {
120  }
121  break;
122  case VAR_HEIGHT: {
125  }
126  break;
127  case VAR_MINGAP: {
130  }
131  break;
132  case VAR_MAXSPEED: {
135  }
136  break;
137  case VAR_ACCEL: {
140  }
141  break;
142  case VAR_DECEL: {
145  }
146  break;
147  case VAR_EMERGENCY_DECEL: {
150  }
151  break;
152  case VAR_APPARENT_DECEL: {
155  }
156  break;
157  case VAR_IMPERFECTION: {
160  }
161  break;
162  case VAR_TAU: {
165  }
166  break;
167  case VAR_SPEED_FACTOR: {
170  }
171  break;
172  case VAR_SPEED_DEVIATION: {
175  }
176  break;
177  case VAR_VEHICLECLASS: {
180  }
181  break;
182  case VAR_EMISSIONCLASS: {
185  }
186  break;
187  case VAR_SHAPECLASS: {
190  }
191  break;
192  case VAR_WIDTH: {
195  }
196  break;
197  case VAR_COLOR: {
198  tempMsg.writeUnsignedByte(TYPE_COLOR);
199  const TraCIColor& col = TraCI_VehicleType::getColor(id);
200  tempMsg.writeUnsignedByte(col.r);
201  tempMsg.writeUnsignedByte(col.g);
202  tempMsg.writeUnsignedByte(col.b);
203  tempMsg.writeUnsignedByte(col.a);
204  }
205  break;
206  case VAR_MINGAP_LAT: {
209  }
210  break;
211  case VAR_MAXSPEED_LAT: {
214  }
215  break;
216  case VAR_LATALIGNMENT: {
219  }
220  break;
221  default:
222  break;
223  }
224  return true;
225 }
226 
227 bool
229  tcpip::Storage& outputStorage) {
230  std::string warning = ""; // additional description for response
231  // variable
232  int variable = inputStorage.readUnsignedByte();
233  if (variable != VAR_LENGTH && variable != VAR_MAXSPEED && variable != VAR_VEHICLECLASS
234  && variable != VAR_SPEED_FACTOR && variable != VAR_SPEED_DEVIATION && variable != VAR_EMISSIONCLASS
235  && variable != VAR_WIDTH && variable != VAR_MINGAP && variable != VAR_SHAPECLASS
236  && variable != VAR_ACCEL && variable != VAR_IMPERFECTION
237  && variable != VAR_DECEL && variable != VAR_EMERGENCY_DECEL && variable != VAR_APPARENT_DECEL
238  && variable != VAR_TAU && variable != VAR_COLOR
239  && variable != VAR_HEIGHT
240  && variable != VAR_MINGAP_LAT
241  && variable != VAR_MAXSPEED_LAT
242  && variable != VAR_LATALIGNMENT
243  && variable != VAR_PARAMETER
244  && variable != COPY
245  ) {
247  "Change Vehicle Type State: unsupported variable " + toHex(variable, 2)
248  + " specified", outputStorage);
249  }
250  // id
251  std::string id = inputStorage.readString();
252 // MSVehicleType* v = TraCI_VehicleType::getVType(id);
253 // if (v == 0) {
254 // return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, "Vehicle type '" + id + "' is not known",
255 // outputStorage);
256 // }
257  // process
258  try {
259  if (setVariable(CMD_SET_VEHICLETYPE_VARIABLE, variable, id, server, inputStorage, outputStorage)) {
260  server.writeStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, RTYPE_OK, warning, outputStorage);
261  return true;
262  }
263  } catch (ProcessError& e) {
264  return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, e.what(), outputStorage);
265  } catch (TraCIException& e) {
266  return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, e.what(), outputStorage);
267  }
268  return false;
269 }
270 
271 
272 bool
273 TraCIServerAPI_VehicleType::setVariable(const int cmd, const int variable,
274  const std::string& id, TraCIServer& server,
275  tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) {
276  switch (variable) {
277  case VAR_LENGTH: {
278  double value = 0;
279  if (!server.readTypeCheckingDouble(inputStorage, value)) {
280  return server.writeErrorStatusCmd(cmd, "Setting length requires a double.", outputStorage);
281  }
282  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
283  return server.writeErrorStatusCmd(cmd, "Invalid length.", outputStorage);
284  }
285  TraCI_VehicleType::setLength(id, value);
286  }
287  break;
288  case VAR_HEIGHT: {
289  double value = 0;
290  if (!server.readTypeCheckingDouble(inputStorage, value)) {
291  return server.writeErrorStatusCmd(cmd, "Setting height requires a double.", outputStorage);
292  }
293  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
294  return server.writeErrorStatusCmd(cmd, "Invalid height.", outputStorage);
295  }
296  TraCI_VehicleType::setHeight(id, value);
297  }
298  break;
299  case VAR_MAXSPEED: {
300  double value = 0;
301  if (!server.readTypeCheckingDouble(inputStorage, value)) {
302  return server.writeErrorStatusCmd(cmd, "Setting maximum speed requires a double.", outputStorage);
303  }
304  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
305  return server.writeErrorStatusCmd(cmd, "Invalid maximum speed.", outputStorage);
306  }
308  }
309  break;
310  case VAR_VEHICLECLASS: {
311  std::string vclass;
312  if (!server.readTypeCheckingString(inputStorage, vclass)) {
313  return server.writeErrorStatusCmd(cmd, "Setting vehicle class requires a string.", outputStorage);
314  }
315  try {
317  } catch (InvalidArgument e) {
318  return server.writeErrorStatusCmd(cmd, "Unknown vehicle class '" + vclass + "'.", outputStorage);
319  }
320  }
321  break;
322  case VAR_SPEED_FACTOR: {
323  double value = 0;
324  if (!server.readTypeCheckingDouble(inputStorage, value)) {
325  return server.writeErrorStatusCmd(cmd, "Setting speed factor requires a double.", outputStorage);
326  }
327  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
328  return server.writeErrorStatusCmd(cmd, "Invalid speed factor.", outputStorage);
329  }
331  }
332  break;
333  case VAR_SPEED_DEVIATION: {
334  double value = 0;
335  if (!server.readTypeCheckingDouble(inputStorage, value)) {
336  return server.writeErrorStatusCmd(cmd, "Setting speed deviation requires a double.", outputStorage);
337  }
338  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
339  return server.writeErrorStatusCmd(cmd, "Invalid speed deviation.", outputStorage);
340  }
342  }
343  break;
344  case VAR_EMISSIONCLASS: {
345  std::string eclass;
346  if (!server.readTypeCheckingString(inputStorage, eclass)) {
347  return server.writeErrorStatusCmd(cmd, "Setting emission class requires a string.", outputStorage);
348  }
349  try {
351  } catch (InvalidArgument e) {
352  return server.writeErrorStatusCmd(cmd, "Unknown emission class '" + eclass + "'.", outputStorage);
353  }
354  }
355  break;
356  case VAR_WIDTH: {
357  double value = 0;
358  if (!server.readTypeCheckingDouble(inputStorage, value)) {
359  return server.writeErrorStatusCmd(cmd, "Setting width requires a double.", outputStorage);
360  }
361  if (value <= 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
362  return server.writeErrorStatusCmd(cmd, "Invalid width.", outputStorage);
363  }
364  TraCI_VehicleType::setWidth(id, value);
365  }
366  break;
367  case VAR_MINGAP: {
368  double value = 0;
369  if (!server.readTypeCheckingDouble(inputStorage, value)) {
370  return server.writeErrorStatusCmd(cmd, "Setting minimum gap requires a double.", outputStorage);
371  }
372  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
373  return server.writeErrorStatusCmd(cmd, "Invalid minimum gap.", outputStorage);
374  }
375  TraCI_VehicleType::setMinGap(id, value);
376  }
377  break;
378  case VAR_MINGAP_LAT: {
379  double value = 0;
380  if (!server.readTypeCheckingDouble(inputStorage, value)) {
381  return server.writeErrorStatusCmd(cmd, "Setting minimum lateral gap requires a double.", outputStorage);
382  }
383  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
384  return server.writeErrorStatusCmd(cmd, "Invalid minimum lateral gap.", outputStorage);
385  }
387  }
388  break;
389  case VAR_MAXSPEED_LAT: {
390  double value = 0;
391  if (!server.readTypeCheckingDouble(inputStorage, value)) {
392  return server.writeErrorStatusCmd(cmd, "Setting maximum lateral speed requires a double.", outputStorage);
393  }
394  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
395  return server.writeErrorStatusCmd(cmd, "Invalid maximum lateral speed.", outputStorage);
396  }
398  }
399  break;
400  case VAR_LATALIGNMENT: {
401  std::string latAlign;
402  if (!server.readTypeCheckingString(inputStorage, latAlign)) {
403  return server.writeErrorStatusCmd(cmd, "Setting preferred lateral alignment requires a string.",
404  outputStorage);
405  }
406  if (SUMOXMLDefinitions::LateralAlignments.hasString(latAlign)) {
408  } else {
409  return server.writeErrorStatusCmd(cmd, "Unknown lateral alignment " + latAlign + "'.", outputStorage);
410  }
411  }
412  break;
413  case VAR_SHAPECLASS: {
414  std::string sclass;
415  if (!server.readTypeCheckingString(inputStorage, sclass)) {
416  return server.writeErrorStatusCmd(cmd, "Setting vehicle shape requires a string.", outputStorage);
417  }
418  try {
420  } catch (InvalidArgument e) {
421  return server.writeErrorStatusCmd(cmd, "Unknown vehicle shape " + sclass + "'.", outputStorage);
422  }
423  }
424  break;
425  case VAR_ACCEL: {
426  double value = 0;
427  if (!server.readTypeCheckingDouble(inputStorage, value)) {
428  return server.writeErrorStatusCmd(cmd, "Setting acceleration requires a double.", outputStorage);
429  }
430  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
431  return server.writeErrorStatusCmd(cmd, "Invalid acceleration.", outputStorage);
432  }
433  TraCI_VehicleType::setAccel(id, value);
434  }
435  break;
436  case VAR_DECEL: {
437  double value = 0;
438  if (!server.readTypeCheckingDouble(inputStorage, value)) {
439  return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage);
440  }
441  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
442  return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage);
443  }
444  TraCI_VehicleType::setDecel(id, value);
445  }
446  break;
447  case VAR_EMERGENCY_DECEL: {
448  double value = 0;
449  if (!server.readTypeCheckingDouble(inputStorage, value)) {
450  return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage);
451  }
452  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
453  return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage);
454  }
456  }
457  break;
458  case VAR_APPARENT_DECEL: {
459  double value = 0;
460  if (!server.readTypeCheckingDouble(inputStorage, value)) {
461  return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage);
462  }
463  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
464  return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage);
465  }
467  }
468  break;
469  case VAR_IMPERFECTION: {
470  double value = 0;
471  if (!server.readTypeCheckingDouble(inputStorage, value)) {
472  return server.writeErrorStatusCmd(cmd, "Setting driver imperfection requires a double.", outputStorage);
473  }
474  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
475  return server.writeErrorStatusCmd(cmd, "Invalid driver imperfection.", outputStorage);
476  }
478  }
479  break;
480  case VAR_TAU: {
481  double value = 0;
482  if (!server.readTypeCheckingDouble(inputStorage, value)) {
483  return server.writeErrorStatusCmd(cmd, "Setting headway time requires a double.", outputStorage);
484  }
485  if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
486  return server.writeErrorStatusCmd(cmd, "Invalid headway time.", outputStorage);
487  }
488  TraCI_VehicleType::setTau(id, value);
489  }
490  break;
491  case VAR_COLOR: {
492  TraCIColor col;
493  if (!server.readTypeCheckingColor(inputStorage, col)) {
494  return server.writeErrorStatusCmd(cmd, "The color must be given using the according type.", outputStorage);
495  }
497  }
498  break;
499  case COPY: {
500  std::string newTypeID;
501  if (!server.readTypeCheckingString(inputStorage, newTypeID)) {
502  return server.writeErrorStatusCmd(cmd, "copying a vehicle type requires a string.",
503  outputStorage);
504  }
505  TraCI_VehicleType::copy(id, newTypeID);
506  }
507  break;
508  case VAR_PARAMETER: {
509  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
510  return server.writeErrorStatusCmd(cmd, "A compound object is needed for setting a parameter.",
511  outputStorage);
512  }
513  //readt itemNo
514  inputStorage.readInt();
515  std::string name;
516  if (!server.readTypeCheckingString(inputStorage, name)) {
517  return server.writeErrorStatusCmd(cmd, "The name of the parameter must be given as a string.",
518  outputStorage);
519  }
520  std::string value;
521  if (!server.readTypeCheckingString(inputStorage, value)) {
522  return server.writeErrorStatusCmd(cmd, "The value of the parameter must be given as a string.",
523  outputStorage);
524  }
525  TraCI_VehicleType::addParameter(id, name, value);
526  }
527  break;
528  default:
529  break;
530  }
531  return true;
532 }
533 
534 #endif
535 
536 
537 /****************************************************************************/
static void setAccel(const std::string &typeID, double accel)
static void setSpeedDeviation(const std::string &typeID, double deviation)
bool readTypeCheckingColor(tcpip::Storage &inputStorage, TraCIColor &into)
Reads the value type and a color, verifying the type.
#define VAR_EMISSIONCLASS
static void setShapeClass(const std::string &typeID, const std::string &shapeClass)
#define VAR_LENGTH
static std::string getParameter(const std::string &typeID, const std::string &key)
#define VAR_LATALIGNMENT
#define TYPE_COMPOUND
static double getSpeedFactor(const std::string &typeID)
static std::string getShapeClass(const std::string &typeID)
#define RESPONSE_GET_VEHICLETYPE_VARIABLE
static TraCIColor getColor(const std::string &typeID)
#define VAR_TAU
static void setVehicleClass(const std::string &typeID, const std::string &clazz)
#define RTYPE_OK
#define VAR_HEIGHT
static std::string getEmissionClass(const std::string &typeID)
unsigned char g
Definition: TraCIDefs.h:79
static double getApparentDecel(const std::string &typeID)
#define VAR_VEHICLECLASS
#define VAR_SPEED_FACTOR
#define VAR_COLOR
static std::vector< std::string > getIDList()
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.
unsigned char r
Definition: TraCIDefs.h:79
virtual void writeUnsignedByte(int)
static void copy(const std::string &origTypeID, const std::string &newTypeID)
static double getMaxSpeedLat(const std::string &typeID)
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 setMinGapLat(const std::string &typeID, double minGapLat)
unsigned char a
Definition: TraCIDefs.h:79
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)
static void setApparentDecel(const std::string &typeID, double decel)
#define TYPE_STRING
virtual int readUnsignedByte()
static void setEmissionClass(const std::string &typeID, const std::string &clazz)
#define CMD_GET_VEHICLETYPE_VARIABLE
static std::string getLateralAlignment(const std::string &typeID)
static double getMinGap(const std::string &typeID)
#define VAR_SHAPECLASS
static double getMinGapLat(const std::string &typeID)
static std::string getVehicleClass(const std::string &typeID)
#define VAR_ACCEL
virtual int readInt()
static void setMaxSpeedLat(const std::string &typeID, double speed)
static double getAccel(const std::string &typeID)
static void setHeight(const std::string &typeID, double height)
static void setImperfection(const std::string &typeID, double imperfection)
static void setSpeedFactor(const std::string &typeID, double factor)
#define CMD_SET_VEHICLETYPE_VARIABLE
#define VAR_EMERGENCY_DECEL
static void setLength(const std::string &typeID, double length)
virtual void writeStringList(const std::vector< std::string > &s)
static double getTau(const std::string &typeID)
static void setMinGap(const std::string &typeID, double minGap)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa5: Get Vehicle Type Variable)
#define VAR_IMPERFECTION
virtual std::string readString()
static void setMaxSpeed(const std::string &typeID, double speed)
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:74
static void setWidth(const std::string &typeID, double width)
#define COPY
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
static double getImperfection(const std::string &typeID)
static void setEmergencyDecel(const std::string &typeID, double decel)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc5: Change Vehicle Type State)
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.
static double getDecel(const std::string &typeID)
virtual void writeString(const std::string &s)
#define TYPE_DOUBLE
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:66
static void setTau(const std::string &typeID, double tau)
static double getEmergencyDecel(const std::string &typeID)
static double getHeight(const std::string &typeID)
static void setDecel(const std::string &typeID, double decel)
virtual void writeDouble(double)
static void setColor(const std::string &typeID, const TraCIColor &c)
unsigned char b
Definition: TraCIDefs.h:79
static void setLateralAlignment(const std::string &typeID, const std::string &latAlignment)
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
#define VAR_MAXSPEED
#define VAR_MINGAP_LAT
#define VAR_DECEL
static double getLength(const std::string &typeID)
#define VAR_PARAMETER
#define ID_COUNT
#define TYPE_INTEGER
#define VAR_MINGAP
#define ID_LIST
static double getSpeedDeviation(const std::string &typeID)
static double getWidth(const std::string &typeID)
#define VAR_MAXSPEED_LAT
static void addParameter(const std::string &id, const std::string &name, const std::string &value)
#define VAR_WIDTH
static double getMaxSpeed(const std::string &typeID)