Eclipse SUMO - Simulation of Urban MObility
MSDriverState.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-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 /****************************************************************************/
16 // The common superclass for modelling transportable objects like persons and containers
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <math.h>
26 #include <cmath>
28 #include <utils/common/SUMOTime.h>
29 //#include <microsim/MSVehicle.h>
31 //#include <microsim/MSLane.h>
32 #include <microsim/MSEdge.h>
33 //#include <microsim/MSGlobals.h>
34 //#include <microsim/MSNet.h>
37 #include "MSDriverState.h"
38 
39 // ===========================================================================
40 // DEBUG constants
41 // ===========================================================================
42 //#define DEBUG_OUPROCESS
43 //#define DEBUG_TRAFFIC_ITEMS
44 //#define DEBUG_AWARENESS
45 //#define DEBUG_PERCEPTION_ERRORS
46 //#define DEBUG_DRIVERSTATE
47 #define DEBUG_COND (true)
48 //#define DEBUG_COND (myVehicle->isSelected())
49 
50 
51 /* -------------------------------------------------------------------------
52  * static member definitions
53  * ----------------------------------------------------------------------- */
54 // hash function
55 //std::hash<std::string> MSDriverState::MSTrafficItem::hash = std::hash<std::string>();
56 std::mt19937 OUProcess::myRNG;
57 
58 // ===========================================================================
59 // Default value definitions
60 // ===========================================================================
61 //double TCIDefaults::myMinTaskCapability = 0.1;
62 //double TCIDefaults::myMaxTaskCapability = 10.0;
63 //double TCIDefaults::myMaxTaskDemand = 20.0;
64 //double TCIDefaults::myMaxDifficulty = 10.0;
65 //double TCIDefaults::mySubCriticalDifficultyCoefficient = 0.1;
66 //double TCIDefaults::mySuperCriticalDifficultyCoefficient = 1.0;
67 //double TCIDefaults::myOppositeDirectionDrivingFactor = 1.3;
68 //double TCIDefaults::myHomeostasisDifficulty = 1.5;
69 //double TCIDefaults::myCapabilityTimeScale = 0.5;
70 //double TCIDefaults::myAccelerationErrorTimeScaleCoefficient = 1.0;
71 //double TCIDefaults::myAccelerationErrorNoiseIntensityCoefficient = 1.0;
72 //double TCIDefaults::myActionStepLengthCoefficient = 1.0;
73 //double TCIDefaults::myMinActionStepLength = 0.0;
74 //double TCIDefaults::myMaxActionStepLength = 3.0;
75 //double TCIDefaults::mySpeedPerceptionErrorTimeScaleCoefficient = 1.0;
76 //double TCIDefaults::mySpeedPerceptionErrorNoiseIntensityCoefficient = 1.0;
77 //double TCIDefaults::myHeadwayPerceptionErrorTimeScaleCoefficient = 1.0;
78 //double TCIDefaults::myHeadwayPerceptionErrorNoiseIntensityCoefficient = 1.0;
79 
80 double DriverStateDefaults::minAwareness = 0.1;
81 double DriverStateDefaults::initialAwareness = 1.0;
82 double DriverStateDefaults::errorTimeScaleCoefficient = 100.0;
83 double DriverStateDefaults::errorNoiseIntensityCoefficient = 0.2;
84 double DriverStateDefaults::speedDifferenceErrorCoefficient = 0.15;
85 double DriverStateDefaults::headwayErrorCoefficient = 0.75;
86 double DriverStateDefaults::speedDifferenceChangePerceptionThreshold = 0.1;
87 double DriverStateDefaults::headwayChangePerceptionThreshold = 0.1;
88 double DriverStateDefaults::maximalReactionTimeFactor = 1.0;
89 
90 
91 // ===========================================================================
92 // method definitions
93 // ===========================================================================
94 
95 OUProcess::OUProcess(double initialState, double timeScale, double noiseIntensity)
96  : myState(initialState),
97  myTimeScale(timeScale),
98  myNoiseIntensity(noiseIntensity) {}
99 
100 
102 
103 
104 void
105 OUProcess::step(double dt) {
106 #ifdef DEBUG_OUPROCESS
107  const double oldstate = myState;
108 #endif
109  myState = exp(-dt / myTimeScale) * myState + myNoiseIntensity * sqrt(2 * dt / myTimeScale) * RandHelper::randNorm(0, 1, &myRNG);
110 #ifdef DEBUG_OUPROCESS
111  std::cout << " OU-step (" << dt << " s.): " << oldstate << "->" << myState << std::endl;
112 #endif
113 }
114 
115 double
116 OUProcess::step(double state, double dt, double timeScale, double noiseIntensity) {
118  return exp(-dt / timeScale) * state + noiseIntensity * sqrt(2 * dt / timeScale) * RandHelper::randNorm(0, 1, &myRNG);
119 }
120 
121 double
123  return myState;
124 }
125 
126 
128  myVehicle(veh),
129  myAwareness(1.),
130  myMinAwareness(DriverStateDefaults::minAwareness),
131  myError(0., 1., 1.),
132  myErrorTimeScaleCoefficient(DriverStateDefaults::errorTimeScaleCoefficient),
133  myErrorNoiseIntensityCoefficient(DriverStateDefaults::errorNoiseIntensityCoefficient),
134  mySpeedDifferenceErrorCoefficient(DriverStateDefaults::speedDifferenceErrorCoefficient),
135  myHeadwayErrorCoefficient(DriverStateDefaults::headwayErrorCoefficient),
136  myHeadwayChangePerceptionThreshold(DriverStateDefaults::headwayChangePerceptionThreshold),
137  mySpeedDifferenceChangePerceptionThreshold(DriverStateDefaults::speedDifferenceChangePerceptionThreshold),
138  myOriginalReactionTime(veh->getActionStepLengthSecs()),
139  myMaximalReactionTime(DriverStateDefaults::maximalReactionTimeFactor * myOriginalReactionTime),
140 // myActionStepLength(TS),
141  myStepDuration(TS),
142  myLastUpdateTime(SIMTIME - TS),
143  myDebugLock(false) {
144 #ifdef DEBUG_DRIVERSTATE
145  std::cout << "Constructing driver state for veh '" << veh->getID() << "'." << std::endl;
146 #endif
147  updateError();
149 }
150 
151 
152 void
154 #ifdef DEBUG_AWARENESS
155  if (DEBUG_COND) {
156  std::cout << SIMTIME << " veh=" << myVehicle->getID() << ", DriverState::update()" << std::endl;
157  }
158 #endif
159  // Adapt step duration
161  // Update error
162  updateError();
163  // Update actionStepLength, aka reaction time
165  // Update assumed gaps
167 #ifdef DEBUG_AWARENESS
168  if (DEBUG_COND) {
169  std::cout << SIMTIME << " stepDuration=" << myStepDuration << ", error=" << myError.getState() << std::endl;
170  }
171 #endif
172 }
173 
174 void
178 }
179 
180 void
182  if (myAwareness == 1.0 || myAwareness == 0.0) {
183  myError.setState(0.);
184  } else {
188  }
189 }
190 
191 void
193  if (myAwareness == 1.0 || myAwareness == 0.0) {
195  } else {
196  const double theta = (myAwareness - myMinAwareness) / (1.0 - myMinAwareness);
198  // Round to multiple of simstep length
199  int quotient;
200  remquo(myActionStepLength, TS, &quotient);
201  myActionStepLength = TS * MAX2(quotient, 1);
202  }
203 }
204 
205 void
207  assert(value >= 0.);
208  assert(value <= 1.);
209 #ifdef DEBUG_AWARENESS
210  if (DEBUG_COND) {
211  std::cout << SIMTIME << " veh=" << myVehicle->getID() << ", setAwareness(" << MAX2(value, myMinAwareness) << ")" << std::endl;
212  }
213 #endif
214  myAwareness = MAX2(value, myMinAwareness);
215  if (myAwareness == 1.) {
216  myError.setState(0.);
217  }
219 }
220 
221 
222 double
223 MSSimpleDriverState::getPerceivedHeadway(const double trueGap, const void* objID) {
224 #ifdef DEBUG_PERCEPTION_ERRORS
225  if (DEBUG_COND) {
226  if (!debugLocked()) {
227  std::cout << SIMTIME << " getPerceivedHeadway() for veh '" << myVehicle->getID() << "'\n"
228  << " trueGap=" << trueGap << " objID=" << objID << std::endl;
229  }
230  }
231 #endif
232 
233  const double perceivedGap = trueGap + myHeadwayErrorCoefficient * myError.getState() * trueGap;
234  const auto assumedGap = myAssumedGap.find(objID);
235  if (assumedGap == myAssumedGap.end()
236  || fabs(perceivedGap - assumedGap->second) > myHeadwayChangePerceptionThreshold * trueGap * (1.0 - myAwareness)) {
237 
238 #ifdef DEBUG_PERCEPTION_ERRORS
239  if (!debugLocked()) {
240  std::cout << " new perceived gap (=" << perceivedGap << ") differs significantly from the assumed (="
241  << (assumedGap == myAssumedGap.end() ? "NA" : toString(assumedGap->second)) << ")" << std::endl;
242  }
243 #endif
244 
245  // new perceived gap differs significantly from the previous
246  myAssumedGap[objID] = perceivedGap;
247  return perceivedGap;
248  } else {
249 
250 #ifdef DEBUG_PERCEPTION_ERRORS
251  if (DEBUG_COND) {
252  if (!debugLocked()) {
253  std::cout << " new perceived gap (=" << perceivedGap << ") does *not* differ significantly from the assumed (="
254  << (assumedGap->second) << ")" << std::endl;
255  }
256  }
257 #endif
258  // new perceived gap doesn't differ significantly from the previous
259  return myAssumedGap[objID];
260  }
261 }
262 
263 void
265  for (auto& p : myAssumedGap) {
266  const void* objID = p.first;
267  const auto speedDiff = myLastPerceivedSpeedDifference.find(objID);
268  double assumedSpeedDiff;
269  if (speedDiff != myLastPerceivedSpeedDifference.end()) {
270  // update the assumed gap with the last perceived speed difference
271  assumedSpeedDiff = speedDiff->second;
272  } else {
273  // Assume the object is not moving, if no perceived speed difference is known.
274  assumedSpeedDiff = -myVehicle->getSpeed();
275  }
276  p.second += SPEED2DIST(assumedSpeedDiff);
277  }
278 }
279 
280 double
281 MSSimpleDriverState::getPerceivedSpeedDifference(const double trueSpeedDifference, const double trueGap, const void* objID) {
282 #ifdef DEBUG_PERCEPTION_ERRORS
283  if (DEBUG_COND) {
284  if (!debugLocked()) {
285  std::cout << SIMTIME << " getPerceivedSpeedDifference() for veh '" << myVehicle->getID() << "'\n"
286  << " trueGap=" << trueGap << " trueSpeedDifference=" << trueSpeedDifference << " objID=" << objID << std::endl;
287  }
288  }
289 #endif
290  const double perceivedSpeedDifference = trueSpeedDifference + mySpeedDifferenceErrorCoefficient * myError.getState() * trueGap;
291  const auto lastPerceivedSpeedDifference = myLastPerceivedSpeedDifference.find(objID);
292  if (lastPerceivedSpeedDifference == myLastPerceivedSpeedDifference.end()
293  || fabs(perceivedSpeedDifference - lastPerceivedSpeedDifference->second) > mySpeedDifferenceChangePerceptionThreshold * trueGap * (1.0 - myAwareness)) {
294 
295 #ifdef DEBUG_PERCEPTION_ERRORS
296  if (DEBUG_COND) {
297  if (!debugLocked()) {
298  std::cout << " new perceived speed difference (=" << perceivedSpeedDifference << ") differs significantly from the last perceived (="
299  << (lastPerceivedSpeedDifference == myLastPerceivedSpeedDifference.end() ? "NA" : toString(lastPerceivedSpeedDifference->second)) << ")"
300  << std::endl;
301  }
302  }
303 #endif
304 
305  // new perceived speed difference differs significantly from the previous
306  myLastPerceivedSpeedDifference[objID] = perceivedSpeedDifference;
307  return perceivedSpeedDifference;
308  } else {
309 #ifdef DEBUG_PERCEPTION_ERRORS
310  if (!debugLocked()) {
311  std::cout << " new perceived speed difference (=" << perceivedSpeedDifference << ") does *not* differ significantly from the last perceived (="
312  << (lastPerceivedSpeedDifference->second) << ")" << std::endl;
313  }
314 #endif
315  // new perceived speed difference doesn't differ significantly from the previous
316  return lastPerceivedSpeedDifference->second;
317  }
318 }
319 
320 
321 //MSDriverState::MSTrafficItem::MSTrafficItem(MSTrafficItemType type, const std::string& id, std::shared_ptr<MSTrafficItemCharacteristics> data) :
322 // type(type),
323 // id_hash(hash(id)),
324 // data(data),
325 // remainingIntegrationTime(0.),
326 // integrationDemand(0.),
327 // latentDemand(0.)
328 //{}
329 //
330 //MSDriverState::MSDriverState(MSVehicle* veh) :
331 // myVehicle(veh),
332 // myMinTaskCapability(TCIDefaults::myMinTaskCapability),
333 // myMaxTaskCapability(TCIDefaults::myMaxTaskCapability),
334 // myMaxTaskDemand(TCIDefaults::myMaxTaskDemand),
335 // myMaxDifficulty(TCIDefaults::myMaxDifficulty),
336 // mySubCriticalDifficultyCoefficient(TCIDefaults::mySubCriticalDifficultyCoefficient),
337 // mySuperCriticalDifficultyCoefficient(TCIDefaults::mySuperCriticalDifficultyCoefficient),
338 // myOppositeDirectionDrivingDemandFactor(TCIDefaults::myOppositeDirectionDrivingFactor),
339 // myHomeostasisDifficulty(TCIDefaults::myHomeostasisDifficulty),
340 // myCapabilityTimeScale(TCIDefaults::myCapabilityTimeScale),
341 // myAccelerationErrorTimeScaleCoefficient(TCIDefaults::myAccelerationErrorTimeScaleCoefficient),
342 // myAccelerationErrorNoiseIntensityCoefficient(TCIDefaults::myAccelerationErrorNoiseIntensityCoefficient),
343 // myActionStepLengthCoefficient(TCIDefaults::myActionStepLengthCoefficient),
344 // myMinActionStepLength(TCIDefaults::myMinActionStepLength),
345 // myMaxActionStepLength(TCIDefaults::myMaxActionStepLength),
346 // mySpeedPerceptionErrorTimeScaleCoefficient(TCIDefaults::mySpeedPerceptionErrorTimeScaleCoefficient),
347 // mySpeedPerceptionErrorNoiseIntensityCoefficient(TCIDefaults::mySpeedPerceptionErrorNoiseIntensityCoefficient),
348 // myHeadwayPerceptionErrorTimeScaleCoefficient(TCIDefaults::myHeadwayPerceptionErrorTimeScaleCoefficient),
349 // myHeadwayPerceptionErrorNoiseIntensityCoefficient(TCIDefaults::myHeadwayPerceptionErrorNoiseIntensityCoefficient),
350 // myAmOpposite(false),
351 // myAccelerationError(0., 1.,1.),
352 // myHeadwayPerceptionError(0., 1.,1.),
353 // mySpeedPerceptionError(0., 1.,1.),
354 // myTaskDemand(0.),
355 // myTaskCapability(myMaxTaskCapability),
356 // myCurrentDrivingDifficulty(myTaskDemand/myTaskCapability),
357 // myActionStepLength(TS),
358 // myStepDuration(TS),
359 // myLastUpdateTime(SIMTIME-TS),
360 // myCurrentSpeed(0.),
361 // myCurrentAcceleration(0.)
362 //{}
363 //
364 //
365 //void
366 //MSDriverState::updateStepDuration() {
367 // myStepDuration = SIMTIME - myLastUpdateTime;
368 // myLastUpdateTime = SIMTIME;
369 //}
370 //
371 //
372 //void
373 //MSDriverState::calculateDrivingDifficulty() {
374 // if (myAmOpposite) {
375 // myCurrentDrivingDifficulty = difficultyFunction(myOppositeDirectionDrivingDemandFactor*myTaskDemand/myTaskCapability);
376 // } else {
377 // myCurrentDrivingDifficulty = difficultyFunction(myTaskDemand/myTaskCapability);
378 // }
379 //}
380 //
381 //
382 //double
383 //MSDriverState::difficultyFunction(double demandCapabilityQuotient) const {
384 // double difficulty;
385 // if (demandCapabilityQuotient <= 1) {
386 // // demand does not exceed capability -> we are in the region for a slight ascend of difficulty
387 // difficulty = mySubCriticalDifficultyCoefficient*demandCapabilityQuotient;
388 // } else {
389 // // demand exceeds capability -> we are in the region for a steeper ascend of the effect of difficulty
390 // difficulty = mySubCriticalDifficultyCoefficient + (demandCapabilityQuotient - 1)*mySuperCriticalDifficultyCoefficient;
391 // }
392 // return MIN2(myMaxDifficulty, difficulty);
393 //}
394 //
395 //
396 //void
397 //MSDriverState::adaptTaskCapability() {
398 // myTaskCapability = myTaskCapability + myCapabilityTimeScale*myStepDuration*(myTaskDemand - myHomeostasisDifficulty*myTaskCapability);
399 //}
400 //
401 //
402 //void
403 //MSDriverState::updateAccelerationError() {
404 //#ifdef DEBUG_OUPROCESS
405 // if (DEBUG_COND) {
406 // std::cout << SIMTIME << " Updating acceleration error (for " << myStepDuration << " s.):\n "
407 // << myAccelerationError.getState() << " -> ";
408 // }
409 //#endif
410 //
411 // updateErrorProcess(myAccelerationError, myAccelerationErrorTimeScaleCoefficient, myAccelerationErrorNoiseIntensityCoefficient);
412 //
413 //#ifdef DEBUG_OUPROCESS
414 // if (DEBUG_COND) {
415 // std::cout << myAccelerationError.getState() << std::endl;
416 // }
417 //#endif
418 //}
419 //
420 //void
421 //MSDriverState::updateSpeedPerceptionError() {
422 //#ifdef DEBUG_OUPROCESS
423 // if (DEBUG_COND) {
424 // std::cout << SIMTIME << " Updating speed perception error (for " << myStepDuration << " s.):\n "
425 // << mySpeedPerceptionError.getState() << " -> ";
426 // }
427 //#endif
428 //
429 // updateErrorProcess(mySpeedPerceptionError, mySpeedPerceptionErrorTimeScaleCoefficient, mySpeedPerceptionErrorNoiseIntensityCoefficient);
430 //
431 //#ifdef DEBUG_OUPROCESS
432 // if (DEBUG_COND) {
433 // std::cout << mySpeedPerceptionError.getState() << std::endl;
434 // }
435 //#endif
436 //}
437 //
438 //void
439 //MSDriverState::updateHeadwayPerceptionError() {
440 //#ifdef DEBUG_OUPROCESS
441 // if (DEBUG_COND) {
442 // std::cout << SIMTIME << " Updating headway perception error (for " << myStepDuration << " s.):\n "
443 // << myHeadwayPerceptionError.getState() << " -> ";
444 // }
445 //#endif
446 //
447 // updateErrorProcess(myHeadwayPerceptionError, myHeadwayPerceptionErrorTimeScaleCoefficient, myHeadwayPerceptionErrorNoiseIntensityCoefficient);
448 //
449 //#ifdef DEBUG_OUPROCESS
450 // if (DEBUG_COND) {
451 // std::cout << myHeadwayPerceptionError.getState() << std::endl;
452 // }
453 //#endif
454 //}
455 //
456 //void
457 //MSDriverState::updateActionStepLength() {
458 //#ifdef DEBUG_OUPROCESS
459 // if (DEBUG_COND) {
460 // std::cout << SIMTIME << " Updating action step length (for " << myStepDuration << " s.): \n" << myActionStepLength;
461 // }
462 //#endif
463 // if (myActionStepLengthCoefficient*myCurrentDrivingDifficulty <= myMinActionStepLength) {
464 // myActionStepLength = myMinActionStepLength;
465 // } else {
466 // myActionStepLength = MIN2(myActionStepLengthCoefficient*myCurrentDrivingDifficulty - myMinActionStepLength, myMaxActionStepLength);
467 // }
468 //#ifdef DEBUG_OUPROCESS
469 // if (DEBUG_COND) {
470 // std::cout << " -> " << myActionStepLength << std::endl;
471 // }
472 //#endif
473 //}
474 //
475 //
476 //void
477 //MSDriverState::updateErrorProcess(OUProcess& errorProcess, double timeScaleCoefficient, double noiseIntensityCoefficient) const {
478 // if (myCurrentDrivingDifficulty == 0) {
479 // errorProcess.setState(0.);
480 // } else {
481 // errorProcess.setTimeScale(timeScaleCoefficient/myCurrentDrivingDifficulty);
482 // errorProcess.setNoiseIntensity(myCurrentDrivingDifficulty*noiseIntensityCoefficient);
483 // errorProcess.step(myStepDuration);
484 // }
485 //}
486 //
487 //void
488 //MSDriverState::registerLeader(const MSVehicle* leader, double gap, double relativeSpeed, double latGap) {
489 // std::shared_ptr<MSTrafficItemCharacteristics> tic = std::dynamic_pointer_cast<MSTrafficItemCharacteristics>(std::make_shared<VehicleCharacteristics>(leader, gap, latGap, relativeSpeed));
490 // std::shared_ptr<MSTrafficItem> ti = std::make_shared<MSTrafficItem>(TRAFFIC_ITEM_VEHICLE, leader->getID(), tic);
491 // registerTrafficItem(ti);
492 //}
493 //
494 //void
495 //MSDriverState::registerPedestrian(const MSPerson* pedestrian, double gap) {
496 // std::shared_ptr<MSTrafficItemCharacteristics> tic = std::dynamic_pointer_cast<MSTrafficItemCharacteristics>(std::make_shared<PedestrianCharacteristics>(pedestrian, gap));
497 // std::shared_ptr<MSTrafficItem> ti = std::make_shared<MSTrafficItem>(TRAFFIC_ITEM_PEDESTRIAN, pedestrian->getID(), tic);
498 // registerTrafficItem(ti);
499 //}
500 //
501 //void
502 //MSDriverState::registerSpeedLimit(const MSLane* lane, double speedLimit, double dist) {
503 // std::shared_ptr<MSTrafficItemCharacteristics> tic = std::dynamic_pointer_cast<MSTrafficItemCharacteristics>(std::make_shared<SpeedLimitCharacteristics>(lane, dist, speedLimit));
504 // std::shared_ptr<MSTrafficItem> ti = std::make_shared<MSTrafficItem>(TRAFFIC_ITEM_SPEED_LIMIT, lane->getID(), tic);
505 // registerTrafficItem(ti);
506 //}
507 //
508 //void
509 //MSDriverState::registerJunction(MSLink* link, double dist) {
510 // const MSJunction* junction = link->getJunction();
511 // std::shared_ptr<MSTrafficItemCharacteristics> tic = std::dynamic_pointer_cast<MSTrafficItemCharacteristics>(std::make_shared<JunctionCharacteristics>(junction, link, dist));
512 // std::shared_ptr<MSTrafficItem> ti = std::make_shared<MSTrafficItem>(TRAFFIC_ITEM_JUNCTION, junction->getID(), tic);
513 // registerTrafficItem(ti);
514 //}
515 //
516 //void
517 //MSDriverState::registerEgoVehicleState() {
518 // myAmOpposite = myVehicle->getLaneChangeModel().isOpposite();
519 // myCurrentSpeed = myVehicle->getSpeed();
520 // myCurrentAcceleration = myVehicle->getAcceleration();
521 //}
522 //
523 //void
524 //MSDriverState::update() {
525 // // Adapt step duration
526 // updateStepDuration();
527 //
528 // // Replace traffic items from previous step with the newly encountered.
529 // myTrafficItems = myNewTrafficItems;
530 //
531 // // Iterate through present traffic items and take into account the corresponding
532 // // task demands. Further update the item's integration progress.
533 // for (auto& hashItemPair : myTrafficItems) {
534 // // Traffic item
535 // auto ti = hashItemPair.second;
536 // // Take into account the task demand associated with the item
537 // integrateDemand(ti);
538 // // Update integration progress
539 // if (ti->remainingIntegrationTime>0) {
540 // updateItemIntegration(ti);
541 // }
542 // }
543 //
544 // // Update capability (~attention) according to the changed demand
545 // // NOTE: Doing this before recalculating the errors seems more adequate
546 // // than after adjusting the errors, since a very fast time scale
547 // // for the capability could not be captured otherwise. A slow timescale
548 // // could still be tuned to have a desired effect.
549 // adaptTaskCapability();
550 //
551 // // Update driving difficulty
552 // calculateDrivingDifficulty();
553 //
554 // // Update errors
555 // updateAccelerationError();
556 // updateSpeedPerceptionError();
557 // updateHeadwayPerceptionError();
558 // updateActionStepLength();
559 //}
560 //
561 //
562 //void
563 //MSDriverState::integrateDemand(std::shared_ptr<MSTrafficItem> ti) {
564 // myMaxTaskDemand += ti->integrationDemand;
565 // myMaxTaskDemand += ti->latentDemand;
566 //}
567 //
568 //
569 //void
570 //MSDriverState::registerTrafficItem(std::shared_ptr<MSTrafficItem> ti) {
571 // if (myNewTrafficItems.find(ti->id_hash) == myNewTrafficItems.end()) {
572 //
573 // // Update demand associated with the item
574 // auto knownTiIt = myTrafficItems.find(ti->id_hash);
575 // if (knownTiIt == myTrafficItems.end()) {
576 // // new item --> init integration demand and latent task demand
577 // calculateIntegrationDemandAndTime(ti);
578 // } else {
579 // // known item --> only update latent task demand associated with the item
580 // ti = knownTiIt->second;
581 // }
582 // calculateLatentDemand(ti);
583 //
584 // // Track item
585 // myNewTrafficItems[ti->id_hash] = ti;
586 // }
587 //}
588 //
589 //
590 //void
591 //MSDriverState::updateItemIntegration(std::shared_ptr<MSTrafficItem> ti) const {
592 // // Eventually decrease integration time and take into account integration cost.
593 // ti->remainingIntegrationTime -= myStepDuration;
594 // if (ti->remainingIntegrationTime <= 0.) {
595 // ti->remainingIntegrationTime = 0.;
596 // ti->integrationDemand = 0.;
597 // }
598 //}
599 //
600 //
601 //void
602 //MSDriverState::calculateIntegrationDemandAndTime(std::shared_ptr<MSTrafficItem> ti) const {
603 // // @todo Idea is that the integration demand is the quantitatively the same for a specific
604 // // item type with definite characteristics but it can be stretched over time,
605 // // if the integration is less urgent (item farther away), thus resulting in
606 // // smaller effort for a longer time.
607 // switch (ti->type) {
608 // case TRAFFIC_ITEM_JUNCTION: {
609 // std::shared_ptr<JunctionCharacteristics> ch = std::dynamic_pointer_cast<JunctionCharacteristics>(ti->data);
610 // const double totalIntegrationDemand = calculateJunctionIntegrationDemand(ch);
611 // const double integrationTime = calculateIntegrationTime(ch->dist, myVehicle->getSpeed());
612 // ti->integrationDemand = totalIntegrationDemand/integrationTime;
613 // ti->remainingIntegrationTime = integrationTime;
614 // }
615 // break;
616 // case TRAFFIC_ITEM_PEDESTRIAN: {
617 // std::shared_ptr<PedestrianCharacteristics> ch = std::dynamic_pointer_cast<PedestrianCharacteristics>(ti->data);
618 // const double totalIntegrationDemand = calculatePedestrianIntegrationDemand(ch);
619 // const double integrationTime = calculateIntegrationTime(ch->dist, myVehicle->getSpeed());
620 // ti->integrationDemand = totalIntegrationDemand/integrationTime;
621 // ti->remainingIntegrationTime = integrationTime;
622 // }
623 // break;
624 // case TRAFFIC_ITEM_SPEED_LIMIT: {
625 // std::shared_ptr<SpeedLimitCharacteristics> ch = std::dynamic_pointer_cast<SpeedLimitCharacteristics>(ti->data);
626 // const double totalIntegrationDemand = calculateSpeedLimitIntegrationDemand(ch);
627 // const double integrationTime = calculateIntegrationTime(ch->dist, myVehicle->getSpeed());
628 // ti->integrationDemand = totalIntegrationDemand/integrationTime;
629 // ti->remainingIntegrationTime = integrationTime;
630 // }
631 // break;
632 // case TRAFFIC_ITEM_VEHICLE: {
633 // std::shared_ptr<VehicleCharacteristics> ch = std::dynamic_pointer_cast<VehicleCharacteristics>(ti->data);
634 // ti->latentDemand = calculateLatentVehicleDemand(ch);
635 // const double totalIntegrationDemand = calculateVehicleIntegrationDemand(ch);
636 // const double integrationTime = calculateIntegrationTime(ch->longitudinalDist, ch->relativeSpeed);
637 // ti->integrationDemand = totalIntegrationDemand/integrationTime;
638 // ti->remainingIntegrationTime = integrationTime;
639 // }
640 // break;
641 // default:
642 // WRITE_WARNING("Unknown traffic item type!")
643 // break;
644 // }
645 //}
646 //
647 //
648 //double
649 //MSDriverState::calculatePedestrianIntegrationDemand(std::shared_ptr<PedestrianCharacteristics> ch) const {
650 // // Integration demand for a pedestrian
651 // const double INTEGRATION_DEMAND_PEDESTRIAN = 0.5;
652 // return INTEGRATION_DEMAND_PEDESTRIAN;
653 //}
654 //
655 //
656 //double
657 //MSDriverState::calculateSpeedLimitIntegrationDemand(std::shared_ptr<SpeedLimitCharacteristics> ch) const {
658 // // Integration demand for speed limit
659 // const double INTEGRATION_DEMAND_SPEEDLIMIT = 0.1;
660 // return INTEGRATION_DEMAND_SPEEDLIMIT;
661 //}
662 //
663 //
664 //double
665 //MSDriverState::calculateJunctionIntegrationDemand(std::shared_ptr<JunctionCharacteristics> ch) const {
666 // // Latent demand for junction is proportional to number of conflicting lanes
667 // // for the vehicle's path plus a factor for the total number of incoming lanes
668 // // at the junction. Further, the distance to the junction is inversely proportional
669 // // to the induced demand [~1/(c*dist + 1)].
670 // // Traffic lights induce an additional demand
671 // const MSJunction* j = ch->junction;
672 //
673 // // Basic junction integration demand
674 // const double INTEGRATION_DEMAND_JUNCTION_BASE = 0.3;
675 //
676 // // Surplus integration demands
677 // const double INTEGRATION_DEMAND_JUNCTION_TLS = 0.2;
678 // const double INTEGRATION_DEMAND_JUNCTION_FOE_LANE = 0.3; // per foe lane
679 // const double INTEGRATION_DEMAND_JUNCTION_LANE = 0.1; // per lane
680 // const double INTEGRATION_DEMAND_JUNCTION_RAIL = 0.2;
681 // const double INTEGRATION_DEMAND_JUNCTION_ZIPPER = 0.3;
682 //
683 // double result = INTEGRATION_DEMAND_JUNCTION_BASE;
685 // switch (ch->junction->getType()) {
686 // case NODETYPE_NOJUNCTION:
687 // case NODETYPE_UNKNOWN:
688 // case NODETYPE_DISTRICT:
689 // case NODETYPE_DEAD_END:
690 // case NODETYPE_DEAD_END_DEPRECATED:
691 // case NODETYPE_RAIL_SIGNAL: {
692 // result = 0.;
693 // }
694 // break;
695 // case NODETYPE_RAIL_CROSSING: {
696 // result += INTEGRATION_DEMAND_JUNCTION_RAIL;
697 // }
698 // break;
699 // case NODETYPE_TRAFFIC_LIGHT:
700 // case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION:
701 // case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: {
702 // // TODO: Take into account traffic light state?
714 // result += INTEGRATION_DEMAND_JUNCTION_TLS;
715 // }
716 // // no break. TLS has extra integration demand.
717 // case NODETYPE_PRIORITY:
718 // case NODETYPE_PRIORITY_STOP:
719 // case NODETYPE_RIGHT_BEFORE_LEFT:
720 // case NODETYPE_ALLWAY_STOP:
721 // case NODETYPE_INTERNAL: {
722 // // TODO: Consider link type (major or minor...)
723 // double junctionComplexity = (INTEGRATION_DEMAND_JUNCTION_LANE*j->getNrOfIncomingLanes()
724 // + INTEGRATION_DEMAND_JUNCTION_FOE_LANE*j->getFoeLinks(ch->approachingLink).size());
725 // result += junctionComplexity;
726 // }
727 // break;
728 // case NODETYPE_ZIPPER: {
729 // result += INTEGRATION_DEMAND_JUNCTION_ZIPPER;
730 // }
731 // break;
732 // default:
733 // assert(false);
734 // result = 0.;
735 // }
736 // return result;
737 //
738 //}
739 //
740 //
741 //double
742 //MSDriverState::calculateVehicleIntegrationDemand(std::shared_ptr<VehicleCharacteristics> ch) const {
743 // // TODO
744 // return 0.;
745 //}
746 //
747 //
748 //double
749 //MSDriverState::calculateIntegrationTime(double dist, double speed) const {
750 // // Fraction of encounter time, which is accounted for the corresponding traffic item's integration
751 // const double INTEGRATION_TIME_COEFF = 0.5;
752 // // Maximal time to be accounted for integration
753 // const double MAX_INTEGRATION_TIME = 5.;
754 // if (speed <= 0.) {
755 // return MAX_INTEGRATION_TIME;
756 // } else {
757 // return MIN2(MAX_INTEGRATION_TIME, INTEGRATION_TIME_COEFF*dist/speed);
758 // }
759 //}
760 //
761 //
762 //void
763 //MSDriverState::calculateLatentDemand(std::shared_ptr<MSTrafficItem> ti) const {
764 // switch (ti->type) {
765 // case TRAFFIC_ITEM_JUNCTION: {
766 // std::shared_ptr<JunctionCharacteristics> ch = std::dynamic_pointer_cast<JunctionCharacteristics>(ti->data);
767 // ti->latentDemand = calculateLatentJunctionDemand(ch);
768 // }
769 // break;
770 // case TRAFFIC_ITEM_PEDESTRIAN: {
771 // std::shared_ptr<PedestrianCharacteristics> ch = std::dynamic_pointer_cast<PedestrianCharacteristics>(ti->data);
772 // ti->latentDemand = calculateLatentPedestrianDemand(ch);
773 // }
774 // break;
775 // case TRAFFIC_ITEM_SPEED_LIMIT: {
776 // std::shared_ptr<SpeedLimitCharacteristics> ch = std::dynamic_pointer_cast<SpeedLimitCharacteristics>(ti->data);
777 // ti->latentDemand = calculateLatentSpeedLimitDemand(ch);
778 // }
779 // break;
780 // case TRAFFIC_ITEM_VEHICLE: {
781 // std::shared_ptr<VehicleCharacteristics> ch = std::dynamic_pointer_cast<VehicleCharacteristics>(ti->data);
782 // ti->latentDemand = calculateLatentVehicleDemand(ch);
783 // }
784 // break;
785 // default:
786 // WRITE_WARNING("Unknown traffic item type!")
787 // break;
788 // }
789 //}
790 //
791 //
792 //double
793 //MSDriverState::calculateLatentPedestrianDemand(std::shared_ptr<PedestrianCharacteristics> ch) const {
794 // // Latent demand for pedestrian is proportional to the euclidean distance to the
795 // // pedestrian (i.e. its potential to 'jump in front of the car) [~1/(c*dist + 1)]
796 // const double LATENT_DEMAND_COEFF_PEDESTRIAN_DIST = 0.1;
797 // const double LATENT_DEMAND_COEFF_PEDESTRIAN = 0.5;
798 // double result = LATENT_DEMAND_COEFF_PEDESTRIAN/(1. + LATENT_DEMAND_COEFF_PEDESTRIAN_DIST*ch->dist);
799 // return result;
800 //}
801 //
802 //
803 //double
804 //MSDriverState::calculateLatentSpeedLimitDemand(std::shared_ptr<SpeedLimitCharacteristics> ch) const {
805 // // Latent demand for speed limit is proportional to speed difference to current vehicle speed
806 // // during approach [~c*(1+deltaV) if dist<threshold].
807 // const double LATENT_DEMAND_COEFF_SPEEDLIMIT_TIME_THRESH = 5;
808 // const double LATENT_DEMAND_COEFF_SPEEDLIMIT = 0.1;
809 // double dist_thresh = LATENT_DEMAND_COEFF_SPEEDLIMIT_TIME_THRESH*myVehicle->getSpeed();
810 // double result = 0.;
811 // if (ch->dist <= dist_thresh && myVehicle->getSpeed() > ch->limit*myVehicle->getChosenSpeedFactor()) {
812 // // Upcoming speed limit does require a slowdown and is close enough.
813 // double dv = myVehicle->getSpeed() - ch->limit*myVehicle->getChosenSpeedFactor();
814 // result = LATENT_DEMAND_COEFF_SPEEDLIMIT*(1 + dv);
815 // }
816 // return result;
817 //}
818 //
819 //
820 //double
821 //MSDriverState::calculateLatentVehicleDemand(std::shared_ptr<VehicleCharacteristics> ch) const {
822 //
823 //
824 // // TODO
825 //
826 //
827 // // Latent demand for neighboring vehicle is determined from the relative and absolute speed,
828 // // and from the lateral and longitudinal distance.
829 // double result = 0.;
830 // const MSVehicle* foe = ch->foe;
831 // if (foe->getEdge() == myVehicle->getEdge()) {
832 // // on same edge
833 // } else if (foe->getEdge() == myVehicle->getEdge()->getOppositeEdge()) {
834 // // on opposite edges
835 // }
836 // return result;
837 //}
838 //
839 //
840 //
841 //double
842 //MSDriverState::calculateLatentJunctionDemand(std::shared_ptr<JunctionCharacteristics> ch) const {
843 // // Latent demand for junction is proportional to number of conflicting lanes
844 // // for the vehicle's path plus a factor for the total number of incoming lanes
845 // // at the junction. Further, the distance to the junction is inversely proportional
846 // // to the induced demand [~1/(c*dist + 1)].
847 // // Traffic lights induce an additional demand
848 // const MSJunction* j = ch->junction;
849 // const double LATENT_DEMAND_COEFF_JUNCTION_TIME_DIST_THRESH = 5; // seconds till arrival, below which junction is relevant
850 // const double LATENT_DEMAND_COEFF_JUNCTION_INCOMING = 0.1;
851 // const double LATENT_DEMAND_COEFF_JUNCTION_FOES = 0.5;
852 // const double LATENT_DEMAND_COEFF_JUNCTION_DIST = 0.1;
853 //
854 // double v = myVehicle->getSpeed();
855 // double dist_thresh = LATENT_DEMAND_COEFF_JUNCTION_TIME_DIST_THRESH*v;
856 //
857 // if (ch->dist > dist_thresh) {
858 // return 0.;
859 // }
860 // double result = 0.;
861 // LinkState linkState = ch->approachingLink->getState();
862 // switch (ch->junction->getType()) {
863 // case NODETYPE_NOJUNCTION:
864 // case NODETYPE_UNKNOWN:
865 // case NODETYPE_DISTRICT:
866 // case NODETYPE_DEAD_END:
867 // case NODETYPE_DEAD_END_DEPRECATED:
868 // case NODETYPE_RAIL_SIGNAL: {
869 // result = 0.;
870 // }
871 // break;
872 // case NODETYPE_RAIL_CROSSING: {
873 // result = 0.5;
874 // }
875 // break;
876 // case NODETYPE_TRAFFIC_LIGHT:
877 // case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION:
878 // case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: {
879 // // Take into account traffic light state
880 // switch (linkState) {
881 // case LINKSTATE_TL_GREEN_MAJOR:
882 // result = 0;
883 // break;
884 // case LINKSTATE_TL_GREEN_MINOR:
885 // result = 0.2*(1. + 0.1*v);
886 // break;
887 // case LINKSTATE_TL_RED:
888 // result = 0.1*(1. + 0.1*v);
889 // break;
890 // case LINKSTATE_TL_REDYELLOW:
891 // result = 0.2*(1. + 0.1*v);
892 // break;
893 // case LINKSTATE_TL_YELLOW_MAJOR:
894 // result = 0.1*(1. + 0.1*v);
895 // break;
896 // case LINKSTATE_TL_YELLOW_MINOR:
897 // result = 0.2*(1. + 0.1*v);
898 // break;
899 // case LINKSTATE_TL_OFF_BLINKING:
900 // result = 0.3*(1. + 0.1*v);
901 // break;
902 // case LINKSTATE_TL_OFF_NOSIGNAL:
903 // result = 0.2*(1. + 0.1*v);
904 // }
905 // }
906 // // no break, TLS is accounted extra
907 // case NODETYPE_PRIORITY:
908 // case NODETYPE_PRIORITY_STOP:
909 // case NODETYPE_RIGHT_BEFORE_LEFT:
910 // case NODETYPE_ALLWAY_STOP:
911 // case NODETYPE_INTERNAL: {
912 // // TODO: Consider link type (major or minor...)
913 // double junctionComplexity = (LATENT_DEMAND_COEFF_JUNCTION_INCOMING*j->getNrOfIncomingLanes()
914 // + LATENT_DEMAND_COEFF_JUNCTION_FOES*j->getFoeLinks(ch->approachingLink).size())
915 // /(1 + ch->dist*LATENT_DEMAND_COEFF_JUNCTION_DIST);
916 // result += junctionComplexity;
917 // }
918 // break;
919 // case NODETYPE_ZIPPER: {
920 // result = 0.5*(1. + 0.1*v);
921 // }
922 // break;
923 // default:
924 // assert(false);
925 // result = 0.;
926 // }
927 // return result;
928 //}
929 //
930 
931 
932 
933 
934 
935 
936 /****************************************************************************/
OUProcess::myTimeScale
double myTimeScale
The time scale of the process.
Definition: MSDriverState.h:90
SPEED2DIST
#define SPEED2DIST(x)
Definition: SUMOTime.h:46
OUProcess::step
void step(double dt)
evolve for a time step of length dt.
Definition: MSDriverState.cpp:105
OUProcess::myState
double myState
The current state of the process.
Definition: MSDriverState.h:86
SUMOTime.h
MSSimpleDriverState::myStepDuration
double myStepDuration
Definition: MSDriverState.h:321
MSSimpleDriverState::myOriginalReactionTime
double myOriginalReactionTime
Maximal reaction time (value set for the actionStepLength at awareness=1)
Definition: MSDriverState.h:313
OUProcess::setState
void setState(double state)
set the process' state to a new value
Definition: MSDriverState.h:62
MSSimpleDriverState::myError
OUProcess myError
Driver's 'error',.
Definition: MSDriverState.h:291
MSSimpleDriverState::mySpeedDifferenceChangePerceptionThreshold
double mySpeedDifferenceChangePerceptionThreshold
Definition: MSDriverState.h:304
MSSimpleDriverState::myMaximalReactionTime
double myMaximalReactionTime
Maximal reaction time (value set for the actionStepLength at awareness=myMinAwareness)
Definition: MSDriverState.h:315
RandHelper::randNorm
static double randNorm(double mean, double variance, std::mt19937 *rng=0)
Access to a random number from a normal distribution.
Definition: RandHelper.h:135
OUProcess::OUProcess
OUProcess(double initialState, double timeScale, double noiseIntensity)
constructor
Definition: MSDriverState.cpp:95
MSSimpleDriverState::myHeadwayErrorCoefficient
double myHeadwayErrorCoefficient
Definition: MSDriverState.h:299
OUProcess::getState
double getState() const
Obtain the current state of the process.
Definition: MSDriverState.cpp:122
OUProcess::myNoiseIntensity
double myNoiseIntensity
The noise intensity of the process.
Definition: MSDriverState.h:94
MSEdge.h
MSSimpleDriverState::myMinAwareness
double myMinAwareness
Minimal value for 'awareness' \in [0,1].
Definition: MSDriverState.h:287
MSSimpleDriverState::mySpeedDifferenceErrorCoefficient
double mySpeedDifferenceErrorCoefficient
Scaling coefficients for the magnitude of errors.
Definition: MSDriverState.h:298
MSSimpleDriverState::myLastPerceivedSpeedDifference
std::map< const void *, double > myLastPerceivedSpeedDifference
The last perceived speed differences to the corresponding objects.
Definition: MSDriverState.h:330
MSSimpleDriverState::updateReactionTime
void updateReactionTime()
Definition: MSDriverState.cpp:192
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
MSTrafficLightLogic.h
SIMTIME
#define SIMTIME
Definition: SUMOTime.h:63
MSSimpleDriverState::updateStepDuration
void updateStepDuration()
Definition: MSDriverState.cpp:175
MSSimpleDriverState::myHeadwayChangePerceptionThreshold
double myHeadwayChangePerceptionThreshold
Thresholds above a change in the corresponding quantity is perceived.
Definition: MSDriverState.h:303
TS
#define TS
Definition: SUMOTime.h:43
MSSimpleDriverState::myActionStepLength
double myActionStepLength
Action step length (~current maximal reaction time) induced by awareness level.
Definition: MSDriverState.h:311
MSSimpleDriverState::update
void update()
Trigger updates for the errorProcess, assumed gaps, etc.
Definition: MSDriverState.cpp:153
MSSimpleDriverState::myVehicle
MSVehicle * myVehicle
Vehicle corresponding to this driver state.
Definition: MSDriverState.h:282
MSSimpleDriverState::getPerceivedHeadway
double getPerceivedHeadway(const double trueGap, const void *objID=nullptr)
Definition: MSDriverState.cpp:223
OUProcess::~OUProcess
~OUProcess()
destructor
Definition: MSDriverState.cpp:101
MSSimpleDriverState::setAwareness
void setAwareness(const double value)
Definition: MSDriverState.cpp:206
MSPerson.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
MSSimpleDriverState::MSSimpleDriverState
MSSimpleDriverState(MSVehicle *veh)
Definition: MSDriverState.cpp:127
DEBUG_COND
#define DEBUG_COND
Definition: MSDriverState.cpp:47
MSDriverState.h
MSSimpleDriverState::updateAssumedGaps
void updateAssumedGaps()
Update the assumed gaps to the known objects according to the corresponding perceived speed differenc...
Definition: MSDriverState.cpp:264
MSSimpleDriverState::getPerceivedSpeedDifference
double getPerceivedSpeedDifference(const double trueSpeedDifference, const double trueGap, const void *objID=nullptr)
This method checks whether the errorneous speed difference that would be perceived for this step diff...
Definition: MSDriverState.cpp:281
OUProcess::myRNG
static std::mt19937 myRNG
Random generator for OUProcesses.
Definition: MSDriverState.h:97
MSBaseVehicle::getID
const std::string & getID() const
Returns the name of the vehicle.
Definition: MSBaseVehicle.cpp:138
MSSimpleDriverState::myAssumedGap
std::map< const void *, double > myAssumedGap
The assumed gaps to different objects.
Definition: MSDriverState.h:328
config.h
MSVehicle::getSpeed
double getSpeed() const
Returns the vehicle's current speed.
Definition: MSVehicle.h:476
RandHelper.h
MSSimpleDriverState::debugLocked
bool debugLocked() const
Definition: MSDriverState.h:267
MSSimpleDriverState::myLastUpdateTime
double myLastUpdateTime
Time point of the last state update.
Definition: MSDriverState.h:323
MSSimpleDriverState::myAwareness
double myAwareness
Driver's 'awareness' \in [0,1].
Definition: MSDriverState.h:285
MSSimpleDriverState::myErrorNoiseIntensityCoefficient
double myErrorNoiseIntensityCoefficient
Coefficient controlling the impact of awareness on the noise intensity of the error process.
Definition: MSDriverState.h:295
MSSimpleDriverState::myErrorTimeScaleCoefficient
double myErrorTimeScaleCoefficient
Coefficient controlling the impact of awareness on the time scale of the error process.
Definition: MSDriverState.h:293
OUProcess::setNoiseIntensity
void setNoiseIntensity(double noiseIntensity)
set the process' noise intensity to a new value
Definition: MSDriverState.h:57
MSSimpleDriverState::updateError
void updateError()
Definition: MSDriverState.cpp:181
MSAbstractLaneChangeModel.h
OUProcess::setTimeScale
void setTimeScale(double timeScale)
set the process' timescale to a new value
Definition: MSDriverState.h:52
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79