SUMO - Simulation of Urban MObility
SUMOVehicleParserHelper.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2008-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 /****************************************************************************/
21 // Helper methods for parsing vehicle attributes
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
36 #include <utils/common/ToString.h>
44 
45 
46 // ===========================================================================
47 // static members
48 // ===========================================================================
51 std::set<SumoXMLAttr> SUMOVehicleParserHelper::allowedJMAttrs;
52 
53 
54 // ===========================================================================
55 // method definitions
56 // ===========================================================================
58 SUMOVehicleParserHelper::parseFlowAttributes(const SUMOSAXAttributes& attrs, const SUMOTime beginDefault, const SUMOTime endDefault) {
59  bool ok = true;
60  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
62  throw ProcessError("At most one of '" + attrs.getName(SUMO_ATTR_PERIOD) +
63  "' and '" + attrs.getName(SUMO_ATTR_VEHSPERHOUR) +
64  "' has to be given in the definition of flow '" + id + "'.");
65  }
67  throw ProcessError("At most one of '" + attrs.getName(SUMO_ATTR_PERIOD) +
68  "' and '" + attrs.getName(SUMO_ATTR_PROB) +
69  "' has to be given in the definition of flow '" + id + "'.");
70  }
72  throw ProcessError("At most one of '" + attrs.getName(SUMO_ATTR_PROB) +
73  "' and '" + attrs.getName(SUMO_ATTR_VEHSPERHOUR) +
74  "' has to be given in the definition of flow '" + id + "'.");
75  }
78  throw ProcessError("If '" + attrs.getName(SUMO_ATTR_PERIOD) +
79  "', '" + attrs.getName(SUMO_ATTR_VEHSPERHOUR) +
80  "' or '" + attrs.getName(SUMO_ATTR_PROB) +
81  "' are given at most one of '" + attrs.getName(SUMO_ATTR_END) +
82  "' and '" + attrs.getName(SUMO_ATTR_NUMBER) +
83  "' are allowed in flow '" + id + "'.");
84  }
85  } else {
86  if (!attrs.hasAttribute(SUMO_ATTR_NUMBER)) {
87  throw ProcessError("At least one of '" + attrs.getName(SUMO_ATTR_PERIOD) +
88  "', '" + attrs.getName(SUMO_ATTR_VEHSPERHOUR) +
89  "', '" + attrs.getName(SUMO_ATTR_PROB) +
90  "', and '" + attrs.getName(SUMO_ATTR_NUMBER) +
91  "' is needed in flow '" + id + "'.");
92  }
93  }
95  ret->id = id;
96  try {
97  parseCommonAttributes(attrs, ret, "flow");
98  } catch (ProcessError&) {
99  delete ret;
100  throw;
101  }
102 
103  // parse repetition information
104  if (attrs.hasAttribute(SUMO_ATTR_PERIOD)) {
105  ret->parametersSet |= VEHPARS_PERIODFREQ_SET;
106  ret->repetitionOffset = attrs.getSUMOTimeReporting(SUMO_ATTR_PERIOD, id.c_str(), ok);
107  }
108  if (attrs.hasAttribute(SUMO_ATTR_VEHSPERHOUR)) {
109  ret->parametersSet |= VEHPARS_PERIODFREQ_SET;
110  const double vph = attrs.get<double>(SUMO_ATTR_VEHSPERHOUR, id.c_str(), ok);
111  if (ok && vph <= 0) {
112  delete ret;
113  throw ProcessError("Invalid repetition rate in the definition of flow '" + id + "'.");
114  }
115  if (ok && vph != 0) {
116  ret->repetitionOffset = TIME2STEPS(3600. / vph);
117  }
118  }
119  if (attrs.hasAttribute(SUMO_ATTR_PROB)) {
120  ret->repetitionProbability = attrs.get<double>(SUMO_ATTR_PROB, id.c_str(), ok);
121  if (ok && (ret->repetitionProbability <= 0 || ret->repetitionProbability > 1)) {
122  delete ret;
123  throw ProcessError("Invalid repetition probability in the definition of flow '" + id + "'.");
124  }
125  }
126 
127  ret->depart = beginDefault;
128  if (attrs.hasAttribute(SUMO_ATTR_BEGIN)) {
129  ret->depart = attrs.getSUMOTimeReporting(SUMO_ATTR_BEGIN, id.c_str(), ok);
130  }
131  if (ok && ret->depart < 0) {
132  delete ret;
133  throw ProcessError("Negative begin time in the definition of flow '" + id + "'.");
134  }
135  ret->repetitionEnd = endDefault;
136  if (ret->repetitionEnd < 0) {
137  ret->repetitionEnd = SUMOTime_MAX;
138  }
139  if (attrs.hasAttribute(SUMO_ATTR_END)) {
140  ret->repetitionEnd = attrs.getSUMOTimeReporting(SUMO_ATTR_END, id.c_str(), ok);
141  } else if (!attrs.hasAttribute(SUMO_ATTR_NUMBER) &&
142  // see SUMOTIME_MAXSTRING (which differs slightly from SUMOTime_MAX)
143  (endDefault >= TIME2STEPS(9223372036854773) || endDefault < 0)) {
144  WRITE_WARNING("Undefined end for flow '" + id + "', defaulting to 24hour duration.");
145  ret->repetitionEnd = ret->depart + TIME2STEPS(24 * 3600);
146  }
147  if (ok && ret->repetitionEnd < ret->depart) {
148  delete ret;
149  throw ProcessError("Flow '" + id + "' ends before its begin time.");
150  }
151  if (attrs.hasAttribute(SUMO_ATTR_NUMBER)) {
152  ret->repetitionNumber = attrs.get<int>(SUMO_ATTR_NUMBER, id.c_str(), ok);
153  ret->parametersSet |= VEHPARS_PERIODFREQ_SET;
154  if (ret->repetitionNumber == 0) {
155  WRITE_WARNING("Flow '" + id + "' has 0 vehicles; will skip it.");
156  } else {
157  if (ok && ret->repetitionNumber < 0) {
158  delete ret;
159  throw ProcessError("Negative repetition number in the definition of flow '" + id + "'.");
160  }
161  if (ok && ret->repetitionOffset < 0) {
162  ret->repetitionOffset = (ret->repetitionEnd - ret->depart) / ret->repetitionNumber;
163  }
164  }
165  ret->repetitionEnd = ret->depart + ret->repetitionNumber * ret->repetitionOffset;
166  } else {
167  // interpret repetitionNumber
168  if (ok && ret->repetitionProbability > 0) {
169  ret->repetitionNumber = std::numeric_limits<int>::max();
170  } else {
171  if (ok && ret->repetitionOffset <= 0) {
172  delete ret;
173  throw ProcessError("Invalid repetition rate in the definition of flow '" + id + "'.");
174  }
175  if (ret->repetitionEnd == SUMOTime_MAX) {
176  ret->repetitionNumber = std::numeric_limits<int>::max();
177  } else {
178  const double repLength = (double)(ret->repetitionEnd - ret->depart);
179  ret->repetitionNumber = (int)ceil(repLength / ret->repetitionOffset);
180  }
181  }
182  }
183  if (!ok) {
184  delete ret;
185  throw ProcessError();
186  }
187  return ret;
188 }
189 
190 
193  const bool optionalID, const bool skipDepart, const bool isPerson) {
194  bool ok = true;
195  std::string id, errorMsg;
196  if (optionalID) {
197  id = attrs.getOpt<std::string>(SUMO_ATTR_ID, 0, ok, "");
198  } else {
199  id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
200  }
202  ret->id = id;
203  if (isPerson) {
204  ret->vtypeid = DEFAULT_PEDTYPE_ID;
205  }
206  try {
207  parseCommonAttributes(attrs, ret, "vehicle");
208  if (!skipDepart) {
209  const std::string helper = attrs.get<std::string>(SUMO_ATTR_DEPART, ret->id.c_str(), ok);
210  if (!ok || !SUMOVehicleParameter::parseDepart(helper, "vehicle", ret->id, ret->depart, ret->departProcedure, errorMsg)) {
211  throw ProcessError(errorMsg);
212  }
213  }
214  } catch (ProcessError&) {
215  delete ret;
216  throw;
217  }
218  return ret;
219 }
220 
221 
222 void
224  SUMOVehicleParameter* ret, std::string element) {
225  //ret->refid = attrs.getStringSecure(SUMO_ATTR_REFID, "");
226  bool ok = true;
227  // parse route information
228  if (attrs.hasAttribute(SUMO_ATTR_ROUTE)) {
229  ret->parametersSet |= VEHPARS_ROUTE_SET; // !!! needed?
230  ret->routeid = attrs.get<std::string>(SUMO_ATTR_ROUTE, ret->id.c_str(), ok);
231  }
232  // parse type information
233  if (attrs.hasAttribute(SUMO_ATTR_TYPE)) {
234  ret->parametersSet |= VEHPARS_VTYPE_SET; // !!! needed?
235  ret->vtypeid = attrs.get<std::string>(SUMO_ATTR_TYPE, ret->id.c_str(), ok);
236  }
237  // parse line information
238  if (attrs.hasAttribute(SUMO_ATTR_LINE)) {
239  ret->parametersSet |= VEHPARS_LINE_SET; // !!! needed?
240  ret->line = attrs.get<std::string>(SUMO_ATTR_LINE, ret->id.c_str(), ok);
241  }
242  // parse zone information
243  if (attrs.hasAttribute(SUMO_ATTR_FROM_TAZ)) {
245  ret->fromTaz = attrs.get<std::string>(SUMO_ATTR_FROM_TAZ, ret->id.c_str(), ok);
246  }
247  if (attrs.hasAttribute(SUMO_ATTR_TO_TAZ)) {
249  ret->toTaz = attrs.get<std::string>(SUMO_ATTR_TO_TAZ, ret->id.c_str(), ok);
250  }
251  // parse reroute information
252  if (attrs.getOpt<bool>(SUMO_ATTR_REROUTE, 0, ok, false)) {
254  }
255 
256  std::string error;
257  // parse depart lane information
258  if (attrs.hasAttribute(SUMO_ATTR_DEPARTLANE)) {
260  const std::string helper = attrs.get<std::string>(SUMO_ATTR_DEPARTLANE, ret->id.c_str(), ok);
261  if (!SUMOVehicleParameter::parseDepartLane(helper, element, ret->id, ret->departLane, ret->departLaneProcedure, error)) {
262  throw ProcessError(error);
263  }
264  }
265  // parse depart position information
266  if (attrs.hasAttribute(SUMO_ATTR_DEPARTPOS)) {
268  const std::string helper = attrs.get<std::string>(SUMO_ATTR_DEPARTPOS, ret->id.c_str(), ok);
269  if (!SUMOVehicleParameter::parseDepartPos(helper, element, ret->id, ret->departPos, ret->departPosProcedure, error)) {
270  throw ProcessError(error);
271  }
272  }
273  // parse lateral depart position information
276  const std::string helper = attrs.get<std::string>(SUMO_ATTR_DEPARTPOS_LAT, ret->id.c_str(), ok);
277  if (!SUMOVehicleParameter::parseDepartPosLat(helper, element, ret->id, ret->departPosLat, ret->departPosLatProcedure, error)) {
278  throw ProcessError(error);
279  }
280  }
281  // parse depart speed information
282  if (attrs.hasAttribute(SUMO_ATTR_DEPARTSPEED)) {
284  std::string helper = attrs.get<std::string>(SUMO_ATTR_DEPARTSPEED, ret->id.c_str(), ok);
285  if (!SUMOVehicleParameter::parseDepartSpeed(helper, element, ret->id, ret->departSpeed, ret->departSpeedProcedure, error)) {
286  throw ProcessError(error);
287  }
288  }
289 
290  // parse arrival lane information
291  if (attrs.hasAttribute(SUMO_ATTR_ARRIVALLANE)) {
293  std::string helper = attrs.get<std::string>(SUMO_ATTR_ARRIVALLANE, ret->id.c_str(), ok);
294  if (!SUMOVehicleParameter::parseArrivalLane(helper, element, ret->id, ret->arrivalLane, ret->arrivalLaneProcedure, error)) {
295  throw ProcessError(error);
296  }
297  }
298  // parse arrival position information
299  if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) {
301  std::string helper = attrs.get<std::string>(SUMO_ATTR_ARRIVALPOS, ret->id.c_str(), ok);
302  if (!SUMOVehicleParameter::parseArrivalPos(helper, element, ret->id, ret->arrivalPos, ret->arrivalPosProcedure, error)) {
303  throw ProcessError(error);
304  }
305  }
306  // parse lateral arrival position information
309  std::string helper = attrs.get<std::string>(SUMO_ATTR_ARRIVALPOS_LAT, ret->id.c_str(), ok);
310  if (!SUMOVehicleParameter::parseArrivalPosLat(helper, element, ret->id, ret->arrivalPosLat, ret->arrivalPosLatProcedure, error)) {
311  throw ProcessError(error);
312  }
313  }
314  // parse arrival speed information
317  std::string helper = attrs.get<std::string>(SUMO_ATTR_ARRIVALSPEED, ret->id.c_str(), ok);
318  if (!SUMOVehicleParameter::parseArrivalSpeed(helper, element, ret->id, ret->arrivalSpeed, ret->arrivalSpeedProcedure, error)) {
319  throw ProcessError(error);
320  }
321  }
322 
323  // parse color
324  if (attrs.hasAttribute(SUMO_ATTR_COLOR)) {
326  ret->color = attrs.get<RGBColor>(SUMO_ATTR_COLOR, ret->id.c_str(), ok);
327  } else {
329  }
330  // parse person number
333  ret->personNumber = attrs.get<int>(SUMO_ATTR_PERSON_NUMBER, ret->id.c_str(), ok);
334  }
335  // parse container number
338  ret->containerNumber = attrs.get<int>(SUMO_ATTR_CONTAINER_NUMBER, ret->id.c_str(), ok);
339  }
340  /*/ parse via
341  if (attrs.hasAttribute(SUMO_ATTR_VIA)) {
342  ret->setParameter |= VEHPARS_VIA_SET;
343  SUMOSAXAttributes::parseStringVector(attrs.get<std::string>(SUMO_ATTR_VIA, ret->id.c_str(), ok), ret->via);
344  }
345  */
346 }
347 
348 
350 SUMOVehicleParserHelper::beginVTypeParsing(const SUMOSAXAttributes& attrs, const std::string& file, const SumoXMLTag defaultCFModel) {
351  bool ok = true;
352  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
354  if (attrs.hasAttribute(SUMO_ATTR_VCLASS)) {
355  vClass = parseVehicleClass(attrs, id);
356  }
357  SUMOVTypeParameter* vtype = new SUMOVTypeParameter(id, vClass);
358  if (attrs.hasAttribute(SUMO_ATTR_VCLASS)) {
360  }
361  if (attrs.hasAttribute(SUMO_ATTR_LENGTH)) {
362  vtype->length = attrs.get<double>(SUMO_ATTR_LENGTH, vtype->id.c_str(), ok);
364  }
365  if (attrs.hasAttribute(SUMO_ATTR_MINGAP)) {
366  vtype->minGap = attrs.get<double>(SUMO_ATTR_MINGAP, vtype->id.c_str(), ok);
368  }
369  if (attrs.hasAttribute(SUMO_ATTR_MAXSPEED)) {
370  vtype->maxSpeed = attrs.get<double>(SUMO_ATTR_MAXSPEED, vtype->id.c_str(), ok);
372  }
373  if (attrs.hasAttribute(SUMO_ATTR_SPEEDFACTOR)) {
374  vtype->speedFactor.parse(attrs.get<std::string>(SUMO_ATTR_SPEEDFACTOR, vtype->id.c_str(), ok));
376  }
377  if (attrs.hasAttribute(SUMO_ATTR_SPEEDDEV)) {
378  vtype->speedFactor.getParameter()[1] = attrs.get<double>(SUMO_ATTR_SPEEDDEV, vtype->id.c_str(), ok);
380  }
382  double actionStepLengthSecs = attrs.get<double>(SUMO_ATTR_ACTIONSTEPLENGTH, vtype->id.c_str(), ok);
383  vtype->actionStepLength = processActionStepLength(actionStepLengthSecs);
385  }
387  vtype->emissionClass = PollutantsInterface::getClassByName(attrs.getOpt<std::string>(SUMO_ATTR_EMISSIONCLASS, id.c_str(), ok, ""));
389  }
390  if (attrs.hasAttribute(SUMO_ATTR_IMPATIENCE)) {
391  if (attrs.get<std::string>(SUMO_ATTR_IMPATIENCE, vtype->id.c_str(), ok) == "off") {
392  vtype->impatience = -std::numeric_limits<double>::max();
393  } else {
394  vtype->impatience = attrs.get<double>(SUMO_ATTR_IMPATIENCE, vtype->id.c_str(), ok);
395  }
397  }
398  if (attrs.hasAttribute(SUMO_ATTR_WIDTH)) {
399  vtype->width = attrs.get<double>(SUMO_ATTR_WIDTH, vtype->id.c_str(), ok);
401  }
402  if (attrs.hasAttribute(SUMO_ATTR_HEIGHT)) {
403  vtype->height = attrs.get<double>(SUMO_ATTR_HEIGHT, vtype->id.c_str(), ok);
405  }
406  if (attrs.hasAttribute(SUMO_ATTR_GUISHAPE)) {
407  vtype->shape = parseGuiShape(attrs, vtype->id);
409  }
410  if (attrs.hasAttribute(SUMO_ATTR_OSGFILE)) {
411  vtype->osgFile = attrs.get<std::string>(SUMO_ATTR_OSGFILE, vtype->id.c_str(), ok);
413  }
414  if (attrs.hasAttribute(SUMO_ATTR_IMGFILE)) {
415  vtype->imgFile = attrs.get<std::string>(SUMO_ATTR_IMGFILE, vtype->id.c_str(), ok);
416  if (vtype->imgFile != "" && !FileHelpers::isAbsolute(vtype->imgFile)) {
418  }
420  }
421  if (attrs.hasAttribute(SUMO_ATTR_COLOR)) {
422  vtype->color = attrs.get<RGBColor>(SUMO_ATTR_COLOR, vtype->id.c_str(), ok);
424  } else {
425  vtype->color = RGBColor::YELLOW;
426  }
427  if (attrs.hasAttribute(SUMO_ATTR_PROB)) {
428  vtype->defaultProbability = attrs.get<double>(SUMO_ATTR_PROB, vtype->id.c_str(), ok);
430  }
433  std::string lcmS = attrs.get<std::string>(SUMO_ATTR_LANE_CHANGE_MODEL, vtype->id.c_str(), ok);
434  if (lcmS == "JE2013") {
435  WRITE_WARNING("Lane change model 'JE2013' is deprecated. Using default model instead.");
436  lcmS = "default";
437  }
438  if (SUMOXMLDefinitions::LaneChangeModels.hasString(lcmS)) {
440  } else {
441  WRITE_ERROR("Unknown lane change model '" + lcmS + "' when parsing vType '" + vtype->id + "'");
442  throw ProcessError();
443  }
444  }
446  const std::string cfmS = attrs.get<std::string>(SUMO_ATTR_CAR_FOLLOW_MODEL, vtype->id.c_str(), ok);
447  if (SUMOXMLDefinitions::CarFollowModels.hasString(cfmS)) {
450  } else {
451  WRITE_ERROR("Unknown car following model '" + cfmS + "' when parsing vType '" + vtype->id + "'");
452  throw ProcessError();
453  }
454  }
456  vtype->personCapacity = attrs.get<int>(SUMO_ATTR_PERSON_CAPACITY, vtype->id.c_str(), ok);
458  }
460  vtype->containerCapacity = attrs.get<int>(SUMO_ATTR_CONTAINER_CAPACITY, vtype->id.c_str(), ok);
462  }
464  vtype->boardingDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_BOARDING_DURATION, vtype->id.c_str(), ok);
466  }
468  vtype->loadingDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_LOADING_DURATION, vtype->id.c_str(), ok);
470  }
472  vtype->maxSpeedLat = attrs.get<double>(SUMO_ATTR_MAXSPEED_LAT, vtype->id.c_str(), ok);
474  }
475  if (attrs.hasAttribute(SUMO_ATTR_MINGAP_LAT)) {
476  vtype->minGapLat = attrs.get<double>(SUMO_ATTR_MINGAP_LAT, vtype->id.c_str(), ok);
478  }
480  const std::string alignS = attrs.get<std::string>(SUMO_ATTR_LATALIGNMENT, vtype->id.c_str(), ok);
481  if (SUMOXMLDefinitions::LateralAlignments.hasString(alignS)) {
484  } else {
485  WRITE_ERROR("Unknown lateral alignment '" + alignS + "' when parsing vType '" + vtype->id + "'");
486  throw ProcessError();
487  }
488  }
489  parseVTypeEmbedded(*vtype, vtype->wasSet(VTYPEPARS_CAR_FOLLOW_MODEL) ? vtype->cfModel : defaultCFModel, attrs, true);
490  parseLCParams(*vtype, vtype->lcModel, attrs);
491  parseJMParams(*vtype, attrs);
492  if (!ok) {
493  delete vtype;
494  throw ProcessError();
495  }
496  return vtype;
497 }
498 
499 
500 void
502  const SumoXMLTag element, const SUMOSAXAttributes& attrs,
503  const bool fromVType) {
504  const CFAttrMap& allowedAttrs = getAllowedCFModelAttrs();
505  CFAttrMap::const_iterator cf_it = allowedAttrs.find(element);
506  if (cf_it == allowedAttrs.end()) {
507  if (SUMOXMLDefinitions::Tags.has((int)element)) {
508  WRITE_ERROR("Unknown car following model " + toString(element) + " when parsing vType '" + into.id + "'");
509  } else {
510  WRITE_ERROR("Unknown car following model when parsing vType '" + into.id + "'");
511  }
512  throw ProcessError();
513  return;
514  }
515  if (!fromVType) {
516  into.cfModel = cf_it->first;
518  }
519  bool ok = true;
520  for (std::set<SumoXMLAttr>::const_iterator it = cf_it->second.begin(); it != cf_it->second.end(); ++it) {
521  if (attrs.hasAttribute(*it)) {
522  into.cfParameter[*it] = attrs.get<std::string>(*it, into.id.c_str(), ok);
523  if (*it == SUMO_ATTR_TAU && string2time(into.cfParameter[*it]) < DELTA_T && element != SUMO_TAG_NOTHING) {
524  WRITE_WARNING("Value of tau=" + toString(into.cfParameter[*it])
525  + " in car following model '" + toString(into.cfModel) + "' lower than simulation step size may cause collisions");
526  }
527  }
528  }
529  if (!ok) {
530  throw ProcessError();
531  }
532 }
533 
534 
537  // init on first use
538  if (allowedCFModelAttrs.size() == 0) {
539  std::set<SumoXMLAttr> kraussParams;
540  kraussParams.insert(SUMO_ATTR_ACCEL);
541  kraussParams.insert(SUMO_ATTR_DECEL);
542  kraussParams.insert(SUMO_ATTR_APPARENTDECEL);
543  kraussParams.insert(SUMO_ATTR_EMERGENCYDECEL);
544  kraussParams.insert(SUMO_ATTR_SIGMA);
545  kraussParams.insert(SUMO_ATTR_TAU);
546  allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS] = kraussParams;
549  std::set<SumoXMLAttr> allParams(kraussParams);
550 
551  std::set<SumoXMLAttr> kraussXParams(kraussParams);
552  kraussXParams.insert(SUMO_ATTR_TMP1);
553  kraussXParams.insert(SUMO_ATTR_TMP2);
554  kraussXParams.insert(SUMO_ATTR_TMP3);
555  kraussXParams.insert(SUMO_ATTR_TMP4);
556  kraussXParams.insert(SUMO_ATTR_TMP5);
557  allowedCFModelAttrs[SUMO_TAG_CF_KRAUSSX] = kraussXParams;
558  allParams.insert(kraussXParams.begin(), kraussXParams.end());
559 
560  std::set<SumoXMLAttr> smartSKParams;
561  smartSKParams.insert(SUMO_ATTR_ACCEL);
562  smartSKParams.insert(SUMO_ATTR_DECEL);
563  smartSKParams.insert(SUMO_ATTR_EMERGENCYDECEL);
564  smartSKParams.insert(SUMO_ATTR_SIGMA);
565  smartSKParams.insert(SUMO_ATTR_TAU);
566  smartSKParams.insert(SUMO_ATTR_TMP1);
567  smartSKParams.insert(SUMO_ATTR_TMP2);
568  smartSKParams.insert(SUMO_ATTR_TMP3);
569  smartSKParams.insert(SUMO_ATTR_TMP4);
570  smartSKParams.insert(SUMO_ATTR_TMP5);
571  allowedCFModelAttrs[SUMO_TAG_CF_SMART_SK] = smartSKParams;
572  allParams.insert(smartSKParams.begin(), smartSKParams.end());
573 
574  std::set<SumoXMLAttr> daniel1Params;
575  daniel1Params.insert(SUMO_ATTR_ACCEL);
576  daniel1Params.insert(SUMO_ATTR_DECEL);
577  daniel1Params.insert(SUMO_ATTR_EMERGENCYDECEL);
578  daniel1Params.insert(SUMO_ATTR_SIGMA);
579  daniel1Params.insert(SUMO_ATTR_TAU);
580  daniel1Params.insert(SUMO_ATTR_TMP1);
581  daniel1Params.insert(SUMO_ATTR_TMP2);
582  daniel1Params.insert(SUMO_ATTR_TMP3);
583  daniel1Params.insert(SUMO_ATTR_TMP4);
584  daniel1Params.insert(SUMO_ATTR_TMP5);
585  allowedCFModelAttrs[SUMO_TAG_CF_DANIEL1] = daniel1Params;
586  allParams.insert(daniel1Params.begin(), daniel1Params.end());
587 
588  std::set<SumoXMLAttr> pwagParams;
589  pwagParams.insert(SUMO_ATTR_ACCEL);
590  pwagParams.insert(SUMO_ATTR_DECEL);
591  pwagParams.insert(SUMO_ATTR_EMERGENCYDECEL);
592  pwagParams.insert(SUMO_ATTR_SIGMA);
593  pwagParams.insert(SUMO_ATTR_TAU);
594  pwagParams.insert(SUMO_ATTR_CF_PWAGNER2009_TAULAST);
595  pwagParams.insert(SUMO_ATTR_CF_PWAGNER2009_APPROB);
597  allParams.insert(pwagParams.begin(), pwagParams.end());
598 
599  std::set<SumoXMLAttr> idmParams;
600  idmParams.insert(SUMO_ATTR_ACCEL);
601  idmParams.insert(SUMO_ATTR_DECEL);
602  idmParams.insert(SUMO_ATTR_EMERGENCYDECEL);
603  idmParams.insert(SUMO_ATTR_TAU);
604  idmParams.insert(SUMO_ATTR_CF_IDM_DELTA);
605  idmParams.insert(SUMO_ATTR_CF_IDM_STEPPING);
607  allParams.insert(idmParams.begin(), idmParams.end());
608 
609  std::set<SumoXMLAttr> idmmParams;
610  idmmParams.insert(SUMO_ATTR_ACCEL);
611  idmmParams.insert(SUMO_ATTR_DECEL);
612  idmmParams.insert(SUMO_ATTR_EMERGENCYDECEL);
613  idmmParams.insert(SUMO_ATTR_TAU);
614  idmmParams.insert(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR);
615  idmmParams.insert(SUMO_ATTR_CF_IDMM_ADAPT_TIME);
616  idmmParams.insert(SUMO_ATTR_CF_IDM_STEPPING);
618  allParams.insert(idmmParams.begin(), idmmParams.end());
619 
620  std::set<SumoXMLAttr> bkernerParams;
621  bkernerParams.insert(SUMO_ATTR_ACCEL);
622  bkernerParams.insert(SUMO_ATTR_DECEL);
623  bkernerParams.insert(SUMO_ATTR_EMERGENCYDECEL);
624  bkernerParams.insert(SUMO_ATTR_TAU);
625  bkernerParams.insert(SUMO_ATTR_K);
626  bkernerParams.insert(SUMO_ATTR_CF_KERNER_PHI);
627  allowedCFModelAttrs[SUMO_TAG_CF_BKERNER] = bkernerParams;
628  allParams.insert(bkernerParams.begin(), bkernerParams.end());
629 
630  std::set<SumoXMLAttr> wiedemannParams;
631  wiedemannParams.insert(SUMO_ATTR_ACCEL);
632  wiedemannParams.insert(SUMO_ATTR_DECEL);
633  wiedemannParams.insert(SUMO_ATTR_EMERGENCYDECEL);
634  wiedemannParams.insert(SUMO_ATTR_CF_WIEDEMANN_SECURITY);
635  wiedemannParams.insert(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION);
636  allowedCFModelAttrs[SUMO_TAG_CF_WIEDEMANN] = wiedemannParams;
637  allParams.insert(wiedemannParams.begin(), wiedemannParams.end());
638 
639  std::set<SumoXMLAttr> railParams;
640  railParams.insert(SUMO_ATTR_TRAIN_TYPE);
642  allParams.insert(railParams.begin(), railParams.end());
643 
645  }
646  return allowedCFModelAttrs;
647 }
648 
649 
650 void
652  if (allowedLCModelAttrs.size() == 0) {
653  // init static map
654  std::set<SumoXMLAttr> lc2013Params;
655  lc2013Params.insert(SUMO_ATTR_LCA_STRATEGIC_PARAM);
656  lc2013Params.insert(SUMO_ATTR_LCA_COOPERATIVE_PARAM);
657  lc2013Params.insert(SUMO_ATTR_LCA_SPEEDGAIN_PARAM);
658  lc2013Params.insert(SUMO_ATTR_LCA_KEEPRIGHT_PARAM);
659  lc2013Params.insert(SUMO_ATTR_LCA_LOOKAHEADLEFT);
660  lc2013Params.insert(SUMO_ATTR_LCA_SPEEDGAINRIGHT);
661  lc2013Params.insert(SUMO_ATTR_LCA_EXPERIMENTAL1);
662  allowedLCModelAttrs[LCM_LC2013] = lc2013Params;
663 
664  std::set<SumoXMLAttr> sl2015Params = lc2013Params;
665  sl2015Params.insert(SUMO_ATTR_LCA_PUSHY);
666  sl2015Params.insert(SUMO_ATTR_LCA_PUSHYGAP);
667  sl2015Params.insert(SUMO_ATTR_LCA_SUBLANE_PARAM);
668  sl2015Params.insert(SUMO_ATTR_LCA_ASSERTIVE);
669  sl2015Params.insert(SUMO_ATTR_LCA_IMPATIENCE);
670  sl2015Params.insert(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE);
671  sl2015Params.insert(SUMO_ATTR_LCA_ACCEL_LAT);
672  allowedLCModelAttrs[LCM_SL2015] = sl2015Params;
673 
674  std::set<SumoXMLAttr> noParams;
675  allowedLCModelAttrs[LCM_DK2008] = noParams;
676 
677  // default model may be either LC2013 or SL2013
678  // we allow both sets (sl2015 is a superset of lc2013Params)
679  allowedLCModelAttrs[LCM_DEFAULT] = sl2015Params;
680  }
681  bool ok = true;
682  std::set<SumoXMLAttr> allowed = allowedLCModelAttrs[model];
683  for (std::set<SumoXMLAttr>::const_iterator it = allowed.begin(); it != allowed.end(); it++) {
684  if (attrs.hasAttribute(*it)) {
685  into.lcParameter[*it] = attrs.get<std::string>(*it, into.id.c_str(), ok);
686  }
687  }
688  if (!ok) {
689  throw ProcessError();
690  }
691 }
692 
693 
694 void
696  if (allowedJMAttrs.size() == 0) {
697  // init static set (there is only one model)
706  }
707  bool ok = true;
708  for (std::set<SumoXMLAttr>::const_iterator it = allowedJMAttrs.begin(); it != allowedJMAttrs.end(); it++) {
709  if (attrs.hasAttribute(*it)) {
710  into.jmParameter[*it] = attrs.get<std::string>(*it, into.id.c_str(), ok);
711  }
712  }
713  if (!ok) {
714  throw ProcessError();
715  }
716 }
717 
718 
721  const std::string& id) {
723  try {
724  bool ok = true;
725  std::string vclassS = attrs.getOpt<std::string>(SUMO_ATTR_VCLASS, id.c_str(), ok, "");
726  if (vclassS == "") {
727  return vclass;
728  }
729  const SUMOVehicleClass result = getVehicleClassID(vclassS);
730  const std::string& realName = SumoVehicleClassStrings.getString(result);
731  if (realName != vclassS) {
732  WRITE_WARNING("The vehicle class '" + vclassS + "' for " + attrs.getObjectType() + " '" + id + "' is deprecated, use '" + realName + "' instead.");
733  }
734  return result;
735  } catch (...) {
736  WRITE_ERROR("The class for " + attrs.getObjectType() + " '" + id + "' is not known.");
737  }
738  return vclass;
739 }
740 
741 
743 SUMOVehicleParserHelper::parseGuiShape(const SUMOSAXAttributes& attrs, const std::string& id) {
744  bool ok = true;
745  std::string vclassS = attrs.getOpt<std::string>(SUMO_ATTR_GUISHAPE, id.c_str(), ok, "");
746  if (SumoVehicleShapeStrings.hasString(vclassS)) {
747  const SUMOVehicleShape result = SumoVehicleShapeStrings.get(vclassS);
748  const std::string& realName = SumoVehicleShapeStrings.getString(result);
749  if (realName != vclassS) {
750  WRITE_WARNING("The shape '" + vclassS + "' for " + attrs.getObjectType() + " '" + id + "' is deprecated, use '" + realName + "' instead.");
751  }
752  return result;
753  } else {
754  WRITE_ERROR("The shape '" + vclassS + "' for " + attrs.getObjectType() + " '" + id + "' is not known.");
755  return SVS_UNKNOWN;
756  }
757 }
758 
759 
760 double
761 SUMOVehicleParserHelper::parseWalkPos(SumoXMLAttr attr, const std::string& id, double maxPos, const std::string& val, std::mt19937* rng) {
762  double result;
763  std::string error;
765  // only supports 'random' and 'max'
766  if (!SUMOVehicleParameter::parseArrivalPos(val, toString(SUMO_TAG_WALK), id, result, proc, error)) {
767  throw ProcessError(error);
768  }
769  if (proc == ARRIVAL_POS_RANDOM) {
770  result = RandHelper::rand(maxPos, rng);
771  } else if (proc == ARRIVAL_POS_MAX) {
772  result = maxPos;
773  }
774  return SUMOVehicleParameter::interpretEdgePos(result, maxPos, attr, id);
775 }
776 
777 
778 SUMOTime
780  SUMOTime result = TIME2STEPS(given);
781  if (result <= 0) {
782  if (result < 0) {
783  std::stringstream ss;
784  ss << "The parameter action-step-length must be a non-negative multiple of the simulation step-length. Ignoring given value (="
785  << STEPS2TIME(result) << " s.)";
786  WRITE_WARNING(ss.str());
787  }
788  result = DELTA_T;
789  } else if (result % DELTA_T != 0) {
790  std::stringstream ss;
791  result = (SUMOTime)(DELTA_T * floor(double(result) / double(DELTA_T)));
792  result = MAX2(DELTA_T, result);
793  if (fabs(given * 1000. - double(result)) > NUMERICAL_EPS) {
794  ss << "The parameter action-step-length must be a non-negative multiple of the simulation step-length. Parsing given value ("
795  << given << " s.) to the adjusted value "
796  << STEPS2TIME(result) << " s.";
797  WRITE_WARNING(ss.str());
798  }
799  }
800  return result;
801 }
802 
803 /****************************************************************************/
804 
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const int VTYPEPARS_MAXSPEED_SET
const int VEHPARS_TO_TAZ_SET
const int VTYPEPARS_MINGAP_SET
static StringBijection< SumoXMLTag > CarFollowModels
car following models
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
RGBColor color
The vehicle&#39;s color, TraCI may change this.
const int VTYPEPARS_LATALIGNMENT_SET
static SUMOVTypeParameter * beginVTypeParsing(const SUMOSAXAttributes &attrs, const std::string &file, const SumoXMLTag defaultCFModel)
Starts to parse a vehicle type.
const int VEHPARS_FORCE_REROUTE
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
Definition: FileHelpers.cpp:81
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
double impatience
The vehicle&#39;s impatience (willingness to obstruct others)
std::string vtypeid
The vehicle&#39;s type id.
static std::set< SumoXMLAttr > allowedJMAttrs
static SUMOVehicleShape parseGuiShape(const SUMOSAXAttributes &attrs, const std::string &id)
Parses the vehicle class.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
virtual std::string getName(int attr) const =0
Converts the given attribute id into a man readable string.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
SUMOVehicleShape shape
This class&#39; shape.
Structure representing possible vehicle parameter.
const int VTYPEPARS_MINGAP_LAT_SET
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static SUMOVehicleParameter * parseVehicleAttributes(const SUMOSAXAttributes &attrs, const bool optionalID=false, const bool skipDepart=false, const bool isPerson=false)
Parses a vehicle&#39;s attributes.
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
Definition: RandHelper.h:64
static void parseVTypeEmbedded(SUMOVTypeParameter &into, const SumoXMLTag element, const SUMOSAXAttributes &attrs, const bool fromVType=false)
Parses an element embedded in vtype definition.
int containerCapacity
The container capacity of the vehicle.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color) ...
const int VTYPEPARS_BOARDING_DURATION
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
weights: time range begin
double arrivalPosLat
(optional) The lateral position the vehicle shall arrive on
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
T MAX2(T a, T b)
Definition: StdDefs.h:73
SUMOTime DELTA_T
Definition: SUMOTime.cpp:39
const int VEHPARS_ARRIVALLANE_SET
const std::string & getObjectType() const
return the objecttype to which these attributes belong
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle&#39;s end speed shall be chosen.
const int VTYPEPARS_CAR_FOLLOW_MODEL
#define TIME2STEPS(x)
Definition: SUMOTime.h:66
const int VTYPEPARS_OSGFILE_SET
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_PROBABILITY_SET
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
static double parseWalkPos(SumoXMLAttr attr, const std::string &id, double maxPos, const std::string &val, std::mt19937 *rng=0)
parse departPos or arrivalPos for a walk
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
void parse(const std::string &description)
Overwrite by parsable distribution description.
static SUMOVehicleClass parseVehicleClass(const SUMOSAXAttributes &attrs, const std::string &id)
Parses the vehicle class.
static void parseLCParams(SUMOVTypeParameter &into, LaneChangeModel model, const SUMOSAXAttributes &attrs)
Parses lane change model attributes.
double height
This class&#39; height.
std::string toTaz
The vehicle&#39;s destination zone (district)
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
const int VEHPARS_ARRIVALSPEED_SET
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
double departSpeed
(optional) The initial speed of the vehicle
static const CFAttrMap & getAllowedCFModelAttrs()
LaneChangeModel
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle&#39;s initial speed shall be chosen.
bool wasSet(int what) const
Returns whether the given parameter was set.
double maxSpeed
The vehicle type&#39;s maximum speed [m/s].
double width
This class&#39; width.
SUMOTime boardingDuration
The time a person needs to board the vehicle.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
std::string routeid
The vehicle&#39;s route id.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
Encapsulated SAX-Attributes.
static SUMOVehicleParameter * parseFlowAttributes(const SUMOSAXAttributes &attrs, const SUMOTime beginDefault, const SUMOTime endDefault)
Parses a flow&#39;s attributes.
const int VEHPARS_DEPARTSPEED_SET
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
Definition: FileHelpers.cpp:96
std::string osgFile
3D model file for this class
#define SUMOTime_MAX
Definition: TraCIDefs.h:52
static void parseCommonAttributes(const SUMOSAXAttributes &attrs, SUMOVehicleParameter *ret, std::string element)
Parses attributes common to vehicles and flows.
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
Definition: RGBColor.h:191
not defined
std::map< SumoXMLTag, std::set< SumoXMLAttr > > CFAttrMap
T get(const std::string &str) const
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
std::string imgFile
Image file for this class.
const int VEHPARS_DEPARTPOSLAT_SET
#define STEPS2TIME(x)
Definition: SUMOTime.h:64
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:46
const int VEHPARS_ROUTE_SET
std::string fromTaz
The vehicle&#39;s origin zone (district)
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const int VTYPEPARS_LOADING_DURATION
const int VTYPEPARS_CONTAINER_CAPACITY
const int VEHPARS_COLOR_SET
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons) ...
vehicle is a passenger car (a "normal" car)
const int VEHPARS_FROM_TAZ_SET
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
std::string line
The vehicle&#39;s line (mainly for public transport)
const int VTYPEPARS_SPEEDFACTOR_SET
double arrivalPos
(optional) The position the vehicle shall arrive on
double maxSpeedLat
The vehicle type&#39;s maximum lateral speed [m/s].
int parametersSet
Information for the router which parameter were set.
const int VEHPARS_ARRIVALPOSLAT_SET
double departPosLat
(optional) The lateral position the vehicle shall depart from
const int VEHPARS_LINE_SET
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
const int VEHPARS_ARRIVALPOS_SET
int personCapacity
The person capacity of the vehicle.
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
double departPos
(optional) The position the vehicle shall depart from
double minGapLat
The vehicle type&#39;s minimum lateral gap [m].
static const RGBColor YELLOW
Definition: RGBColor.h:181
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
Structure representing possible vehicle parameter.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
const int VEHPARS_PERIODFREQ_SET
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
const std::string DEFAULT_PEDTYPE_ID
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
static void parseJMParams(SUMOVTypeParameter &into, const SUMOSAXAttributes &attrs)
Parses junction model attributes.
weights: time range end
SubParams jmParameter
Junction-model parameter.
const int VTYPEPARS_IMGFILE_SET
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
SubParams cfParameter
Car-following parameter.
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
RGBColor color
The color.
const int VEHPARS_DEPARTLANE_SET
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
int containerNumber
The static number of containers in the vehicle when it departs.
std::string id
The vehicle type&#39;s id.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
const int VTYPEPARS_PERSON_CAPACITY
LateralAlignment latAlignment
The vehicles desired lateral alignment.
SUMOTime actionStepLength
The vehicle type&#39;s default actionStepLength [ms], i.e. the interval between two control actions...
const int VEHPARS_VTYPE_SET
double minGap
This class&#39; free space in front of the vehicle itself.
const int VTYPEPARS_HEIGHT_SET
ArrivalPosDefinition
Possible ways to choose the arrival position.
long long int SUMOTime
Definition: TraCIDefs.h:51
#define NUMERICAL_EPS
Definition: config.h:151
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
const int VTYPEPARS_WIDTH_SET
static StringBijection< int > Tags
The names of SUMO-XML elements for use in netbuild.
const int VEHPARS_DEPARTPOS_SET
const int VEHPARS_PERSON_NUMBER_SET
LaneChangeModel lcModel
The lane-change model to use.
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_VEHICLECLASS_SET
const int VEHPARS_CONTAINER_NUMBER_SET
A color information.
const int VTYPEPARS_EMISSIONCLASS_SET
The maximum arrival position is used.
const int VTYPEPARS_COLOR_SET
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
const int VTYPEPARS_SHAPE_SET
double length
The physical vehicle length.
SubParams lcParameter
Lane-changing parameter.
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
vehicles ignoring classes
std::map< LaneChangeModel, std::set< SumoXMLAttr > > LCAttrMap
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
std::string id
The vehicle&#39;s id.
const int VTYPEPARS_IMPATIENCE_SET
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
The arrival position is chosen randomly.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.