Eclipse SUMO - Simulation of Urban MObility
MSDriverState.h
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 /****************************************************************************/
15 // A class representing a vehicle driver's current mental state
16 /****************************************************************************/
17 
18 
20 
21 
22 #ifndef MSDriverState_h
23 #define MSDriverState_h
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #include <config.h>
29 
30 #include <memory>
31 #include <utils/common/SUMOTime.h>
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
40 class OUProcess {
41 public:
43  OUProcess(double initialState, double timeScale, double noiseIntensity);
45  ~OUProcess();
46 
48  void step(double dt);
49 
51  void setTimeScale(double timeScale) {
52  myTimeScale = timeScale;
53  };
54 
56  void setNoiseIntensity(double noiseIntensity) {
57  myNoiseIntensity = noiseIntensity;
58  };
59 
61  void setState(double state) {
62  myState = state;
63  };
64 
65  inline double getNoiseIntensity() const {
66  return myNoiseIntensity;
67  };
68 
69  inline double getTimeScale() const {
70  return myTimeScale;
71  };
72 
73 
75  double getState() const;
76 
77 
78  static std::mt19937* getRNG() {
79  return &myRNG;
80  }
81 
82 private:
85  double myState;
86 
89  double myTimeScale;
90 
94 
96  static std::mt19937 myRNG;
97 };
98 
99 
104 
105 public:
107  virtual ~MSSimpleDriverState() {};
108 
109 
112  inline double getMinAwareness() const {
113  return myMinAwareness;
114  }
115 
116  inline double getInitialAwareness() const {
117  return myInitialAwareness;
118  }
119 
120  inline double getErrorTimeScaleCoefficient() const {
122  }
123 
124  inline double getErrorNoiseIntensityCoefficient() const {
126  }
127 
128  inline double getErrorTimeScale() const {
129  return myError.getTimeScale();
130  }
131 
132  inline double getErrorNoiseIntensity() const {
133  return myError.getNoiseIntensity();
134  }
135 
136  inline double getSpeedDifferenceErrorCoefficient() const {
138  }
139 
140  inline double getHeadwayErrorCoefficient() const {
142  }
143 
146  }
147 
148  inline double getHeadwayChangePerceptionThreshold() const {
150  }
151 
152  inline double getAwareness() const {
153  return myAwareness;
154  }
155 
156  inline double getMaximalReactionTime() const {
157  return myMaximalReactionTime;
158  }
159 
160  inline double getOriginalReactionTime() const {
161  return myOriginalReactionTime;
162  }
163 
164  inline double getActionStepLength() const {
165  return myActionStepLength;
166  }
167 
168  inline double getErrorState() const {
169  return myError.getState();
170  };
172 
173 
176  inline void setMinAwareness(const double value) {
177  myMinAwareness = value;
178  }
179 
180  inline void setInitialAwareness(const double value) {
181  myInitialAwareness = value;
182  }
183 
184  inline void setErrorTimeScaleCoefficient(const double value) {
186  }
187 
188  inline void setErrorNoiseIntensityCoefficient(const double value) {
190  }
191 
192  inline void setSpeedDifferenceErrorCoefficient(const double value) {
194  }
195 
196  inline void setHeadwayErrorCoefficient(const double value) {
198  }
199 
200  inline void setSpeedDifferenceChangePerceptionThreshold(const double value) {
202  }
203 
204  inline void setHeadwayChangePerceptionThreshold(const double value) {
206  }
207 
208  inline void setMaximalReactionTime(const double value) {
209  myMaximalReactionTime = value;
211  }
212 
213  inline void setOriginalReactionTime(const double value) {
214  myOriginalReactionTime = value;
216  }
217 
218  void setAwareness(const double value);
219 
220  inline void setErrorState(const double state) {
221  myError.setState(state);
222  };
223 
224  inline void setErrorTimeScale(const double value) {
225  myError.setTimeScale(value);
226  }
227 
228  inline void setErrorNoiseIntensity(const double value) {
229  myError.setNoiseIntensity(value);
230  }
232 
234  void update();
235 
236 
239  void updateAssumedGaps();
240 
244 // /// @see myAccelerationError
245 // inline double getAppliedAcceleration(double desiredAccel) {
246 // return desiredAccel + myError.getState();
247 // };
248 
253  double getPerceivedSpeedDifference(const double trueSpeedDifference, const double trueGap, const void* objID = nullptr);
255  double getPerceivedHeadway(const double trueGap, const void* objID = nullptr);
257 
258  inline void lockDebug() {
259  myDebugLock = true;
260  }
261 
262  inline void unlockDebug() {
263  myDebugLock = false;
264  }
265 
266  inline bool debugLocked() const {
267  return myDebugLock;
268  }
269 
270 private:
271  // @brief Update the current step duration
272  void updateStepDuration();
273  // Update the error process
274  void updateError();
275  // Update the reaction time (actionStepLength)
276  void updateReactionTime();
277 
278 private:
279 
282 
284  double myAwareness;
295 
304 // // @brief if a perception threshold is passed for some object, a flag is set to induce a reaction to the object
305 // std::map<void*, bool> myReactionFlag;
306 
315 
323 
324 
327  std::map<const void*, double> myAssumedGap;
329  std::map<const void*, double> myLastPerceivedSpeedDifference;
331 
334 };
335 
336 
337 
338 
339 
341 // * @brief An object representing a traffic item. Used for influencing
342 // * the task demand of the TCI car-following model.
343 // * @see MSCFModel_TCI
344 // */
345 //class MSDriverState {
346 //
347 //protected:
348 // /// @brief base class for VehicleCharacteristics, TLSCharacteristics, PedestrianCharacteristics, SpeedLimitCharacteristics, Junction Characteristics...
349 // /// @see TrafficItemType, @see MSCFModel_TCI
350 // struct MSTrafficItemCharacteristics {
351 // inline virtual ~MSTrafficItemCharacteristics() {};
352 // };
353 //
354 // // @brief Types of traffic items, @see TrafficItem
355 // enum MSTrafficItemType {
356 // TRAFFIC_ITEM_VEHICLE,
357 // TRAFFIC_ITEM_PEDESTRIAN,
358 // TRAFFIC_ITEM_SPEED_LIMIT,
359 // TRAFFIC_ITEM_JUNCTION
360 // };
361 //
362 // /** @class MSTrafficItem
363 // * @brief An object representing a traffic item. Used for influencing
364 // * the task demand of the TCI car-following model.
365 // * @see MSCFModel_TCI
366 // */
367 // struct MSTrafficItem {
368 // MSTrafficItem(MSTrafficItemType type, const std::string& id, std::shared_ptr<MSTrafficItemCharacteristics> data);
369 // static std::hash<std::string> hash;
370 // MSTrafficItemType type;
371 // size_t id_hash;
372 // std::shared_ptr<MSTrafficItemCharacteristics> data;
373 // double remainingIntegrationTime;
374 // double integrationDemand;
375 // double latentDemand;
376 // };
377 //
378 // struct JunctionCharacteristics : MSTrafficItemCharacteristics {
379 // JunctionCharacteristics(const MSJunction* junction, const MSLink* egoLink, double dist) :
380 // junction(junction), approachingLink(egoLink), dist(dist) {};
381 // const MSJunction* junction;
382 // const MSLink* approachingLink;
383 // double dist;
384 // };
385 //
386 // struct PedestrianCharacteristics : MSTrafficItemCharacteristics {
387 // PedestrianCharacteristics(const MSPerson* pedestrian, double dist) :
388 // pedestrian(pedestrian), dist(dist) {};
389 // const MSPerson* pedestrian;
390 // double dist;
391 // };
392 //
393 // struct SpeedLimitCharacteristics : MSTrafficItemCharacteristics {
394 // SpeedLimitCharacteristics(const MSLane* lane, double dist, double limit) :
395 // dist(dist), limit(limit), lane(lane) {};
396 // const MSLane* lane;
397 // double dist;
398 // double limit;
399 // };
400 //
401 // struct VehicleCharacteristics : MSTrafficItemCharacteristics {
402 // VehicleCharacteristics(const MSVehicle* foe, double longitudinalDist, double lateralDist, double relativeSpeed) :
403 // longitudinalDist(longitudinalDist), lateralDist(lateralDist), foe(foe), relativeSpeed(relativeSpeed) {};
404 // const MSVehicle* foe;
405 // double longitudinalDist;
406 // double lateralDist;
407 // double relativeSpeed;
408 // };
409 //
410 //
411 //public:
412 //
413 // MSDriverState(MSVehicle* veh);
414 // virtual ~MSDriverState() {};
415 //
416 // /// @name Interfaces to inform Driver Model about traffic items, which potentially
417 // /// influence the driving difficulty.
418 // /// @{
419 // /** @brief Informs about leader.
420 // */
421 // virtual void registerLeader(const MSVehicle* leader, double gap, double relativeSpeed, double latGap = -1.);
422 //
423 // /** @brief Informs about pedestrian.
424 // */
425 // virtual void registerPedestrian(const MSPerson* pedestrian, double gap);
426 //
427 // /** @brief Informs about upcoming speed limit reduction.
428 // */
429 // virtual void registerSpeedLimit(const MSLane* lane, double speedLimit, double dist);
430 //
431 // /** @brief Informs about upcoming junction.
432 // */
433 // virtual void registerJunction(MSLink* link, double dist);
434 //
435 // /** @brief Takes into account vehicle-specific factors for the driving demand
436 // * For instance, whether vehicle drives on an opposite direction lane, absolute speed, etc.
437 // */
438 // virtual void registerEgoVehicleState();
439 //
440 // /** @brief Trigger updates for the state variables according to the traffic situation
441 // * (present traffic items)
442 // */
443 // virtual void update();
444 // /// @}
445 //
446 //
447 // /// @name Methods to obtain the current error quantities to be used by the car-following model
448 // /// @see TCIModel
449 // /// @{
450 // /// @see myAccelerationError
451 // inline double getAppliedAcceleration(double desiredAccel) {
452 // return desiredAccel + myAccelerationError.getState();
453 // };
454 // /// @see mySpeedPerceptionError
455 // inline double getPerceivedSpeedDifference(double trueSpeedDifference) {
456 // return trueSpeedDifference + mySpeedPerceptionError.getState();
457 // };
458 // /// @see myHeadwayPerceptionError
459 // inline double getPerceivedHeadway(double trueGap) {
460 // return trueGap + myHeadwayPerceptionError.getState();
461 // };
462 // /// @see myActionStepLength
463 // inline double getActionStepLength(){
464 // return myActionStepLength;
465 // };
466 // /// @}
467 //
468 //
469 //private:
470 //
471 // /** @brief Updates the internal variables to track the time between
472 // * two calls to the state update (i.e., two action points). Needed for a consistent
473 // * evolution of the error processes.
474 // */
475 // void updateStepDuration();
476 //
477 // /** @brief Calculates a value for the task difficulty given the capability and the demand
478 // * and stores the result in myCurrentDrivingDifficulty.
479 // * @see difficultyFunction()
480 // */
481 // void calculateDrivingDifficulty();
482 //
483 //
484 // /** @brief Transformation of the quotient demand/capability to obtain the actual
485 // * difficulty value used to control driving performance.
486 // * @note The current implementation is a continuous piecewise affine function.
487 // * It has two regions with different slopes. A slight ascend, where the capability
488 // * is larger than the demand and a region of steeper ascend, where the demand
489 // * exceeds the capability.
490 // */
491 // double difficultyFunction(double demandCapabilityQuotient) const;
492 //
493 //
494 // /** @brief Updates the myTaskCapability in dependence of the myTaskDifficulty to model a reactive
495 // * level of attention. The characteristics of the process are determined by myHomeostasisDifficulty
496 // * and myCapabilityTimeScale.
497 // * @todo Review the implementation as simple exponential process.
498 // */
499 // void adaptTaskCapability();
500 //
501 //
502 // /// @name Updater for error processes.
503 // /// @{
504 // void updateAccelerationError();
505 // void updateSpeedPerceptionError();
506 // void updateHeadwayPerceptionError();
507 // void updateActionStepLength();
508 // /// @}
509 //
510 //
511 // /// @brief Updates the given error process
512 // void updateErrorProcess(OUProcess& errorProcess, double timeScaleCoefficient, double noiseIntensityCoefficient) const;
513 //
514 // /// @brief Initialize newly appeared traffic item
515 // void calculateLatentDemand(std::shared_ptr<MSTrafficItem> ti) const;
516 //
517 // /// @brief Calculate demand induced by the given junction
518 // double calculateLatentJunctionDemand(std::shared_ptr<JunctionCharacteristics> ch) const;
519 // /// @brief Calculate demand induced by the given pedestrian
520 // double calculateLatentPedestrianDemand(std::shared_ptr<PedestrianCharacteristics> ch) const;
521 // /// @brief Calculate demand induced by the given pedestrian
522 // double calculateLatentSpeedLimitDemand(std::shared_ptr<SpeedLimitCharacteristics> ch) const;
523 // /// @brief Calculate demand induced by the given vehicle
524 // double calculateLatentVehicleDemand(std::shared_ptr<VehicleCharacteristics> ch) const;
525 //
526 // /// @brief Calculate integration demand induced by the given junction
527 // double calculateJunctionIntegrationDemand(std::shared_ptr<JunctionCharacteristics> ch) const;
528 // /// @brief Calculate integration demand induced by the given pedestrian
529 // double calculatePedestrianIntegrationDemand(std::shared_ptr<PedestrianCharacteristics> ch) const;
530 // /// @brief Calculate integration demand induced by the given pedestrian
531 // double calculateSpeedLimitIntegrationDemand(std::shared_ptr<SpeedLimitCharacteristics> ch) const;
532 // /// @brief Calculate integration demand induced by the given vehicle
533 // double calculateVehicleIntegrationDemand(std::shared_ptr<VehicleCharacteristics> ch) const;
534 //
535 // /// @brief Register known traffic item to persist
536 // void updateItemIntegration(std::shared_ptr<MSTrafficItem> ti) const;
537 //
538 // /// @brief Determine the integration demand and duration for a newly encountered traffic item (updated in place)
539 // /// The integration demand takes effect during a short period after the first appearance of the item.
540 // void calculateIntegrationDemandAndTime(std::shared_ptr<MSTrafficItem> ti) const;
541 //
542 // /// @brief Calculate the integration time for an item approached with the given speed at given dist
543 // double calculateIntegrationTime(double dist, double speed) const;
544 //
545 // /// @brief Incorporate the item's demand into the total task demand.
546 // void integrateDemand(std::shared_ptr<MSTrafficItem> ti);
547 //
548 // /// @brief Called whenever the vehicle is notified about a traffic item encounter.
549 // void registerTrafficItem(std::shared_ptr<MSTrafficItem> ti);
550 //
551 //private:
552 //
553 // MSVehicle* myVehicle;
554 //
555 // /// @name Variables for tracking update instants
556 // /// @see updateStepDuration()
557 // /// @{
558 //
559 // /// @brief Elapsed time since the last state update
560 // double myStepDuration;
561 // /// @brief Time point of the last state update
562 // double myLastUpdateTime;
563 //
564 // /// @}
565 //
566 //
567 // /// @name Dynamical quantities for the driving performance
568 // /// @{
569 //
570 // /** @brief Task capability (combines static and dynamic factors specific to the driver and the situation,
571 // * total capability, attention, etc.). Follows myTaskDemand with some inertia (task-difficulty-homeostasis).
572 // */
573 // double myTaskCapability;
574 // double myMinTaskCapability, myMaxTaskCapability;
575 //
576 // /** @brief Task Demand (dynamic variable representing the total demand imposed on the driver by the driving situation and environment.
577 // * For instance, number, novelty and type of traffic participants in neighborhood, speed differences, road curvature,
578 // * headway to leader, number of lanes, traffic density, street signs, traffic lights)
579 // */
580 // double myTaskDemand;
581 // double myMaxTaskDemand;
582 //
583 // /** @brief Cached current value of the difficulty resulting from the combination of task capability and demand.
584 // * @see calculateDrivingDifficulty()
585 // */
586 // double myCurrentDrivingDifficulty;
587 // /// @brief Upper bound for myCurrentDrivingDifficulty
588 // double myMaxDifficulty;
589 // /** @brief Slopes for the dependence of the difficulty on the quotient of demand and capability.
590 // * @see difficultyFunction();
591 // */
592 // double mySubCriticalDifficultyCoefficient, mySuperCriticalDifficultyCoefficient;
593 //
594 // /// @}
595 //
596 // /// @name Field that reflect the current driving situation
597 // /// @{
598 // /// @brief Whether vehicle is driving on an opposite direction lane
599 // bool myAmOpposite;
600 // double myCurrentSpeed;
601 // double myCurrentAcceleration;
602 // /// @}
603 //
604 // /// @name Parameters for the dynamic adaptation of capability (attention) and demand
605 // /// @{
606 //
607 // /** @brief The desired value of the quotient myTaskDemand/myTaskCapability. Influences the fixed point of the
608 // * process myTaskCapability -> myTaskDemand, @see adaptTaskCapability()
609 // */
610 // double myHomeostasisDifficulty;
611 //
612 // /** @brief Determines the time scale for the adaptation process of task capability towards the
613 // * task difficulty.
614 // */
615 // double myCapabilityTimeScale;
616 //
617 // /** @brief Factor for the demand if driving on an opposite direction lane
618 // */
619 // double myOppositeDirectionDrivingDemandFactor;
620 //
621 // /// @}
622 //
623 //
624 //
625 // /** @brief Traffic items in the current neighborhood of the vehicle.
626 // */
627 // std::map<size_t, std::shared_ptr<MSTrafficItem> > myTrafficItems;
628 // std::map<size_t, std::shared_ptr<MSTrafficItem> > myNewTrafficItems;
629 //
630 // /// @name Actuation errors
631 // /// @{
632 //
633 // /** @brief Acceleration error. Modelled as an Ornstein-Uhlenbeck process.
634 // * @see updateAccelerationError()
635 // */
636 // OUProcess myAccelerationError;
637 // /// @brief Coefficient controlling the impact of driving difficulty on the time scale of the acceleration error process
638 // double myAccelerationErrorTimeScaleCoefficient;
639 // /// @brief Coefficient controlling the impact of driving difficulty on the noise intensity of the acceleration error process
640 // double myAccelerationErrorNoiseIntensityCoefficient;
641 //
642 // /// @brief Action step length (increases with task difficulty, is similar to reaction time)
643 // double myActionStepLength;
644 // /// @brief Proportionality factor of myActionStepLength and driving difficulty
645 // double myActionStepLengthCoefficient;
646 // /// @brief Bounds for the action step length
647 // double myMinActionStepLength, myMaxActionStepLength;
648 //
649 // /// @}
650 //
651 //
652 // /// @name Perception errors
653 // /// @{
654 //
655 // /** @brief Error of estimation of the relative speeds of neighboring vehicles
656 // */
657 // OUProcess mySpeedPerceptionError;
658 // /// @brief Coefficient controlling the impact of driving difficulty on the time scale of the relative speed error process
659 // double mySpeedPerceptionErrorTimeScaleCoefficient;
660 // /// @brief Coefficient controlling the impact of driving difficulty on the noise intensity of the relative speed error process
661 // double mySpeedPerceptionErrorNoiseIntensityCoefficient;
662 //
663 // /** @brief Error of estimation of the distance/headways of neighboring vehicles
664 // */
665 // OUProcess myHeadwayPerceptionError;
666 // /// @brief Coefficient controlling the impact of driving difficulty on the time scale of the headway error process
667 // double myHeadwayPerceptionErrorTimeScaleCoefficient;
668 // /// @brief Coefficient controlling the impact of driving difficulty on the noise intensity of the headway error process
669 // double myHeadwayPerceptionErrorNoiseIntensityCoefficient;
670 //
671 // /// @}
672 //};
673 
674 
675 
677 struct DriverStateDefaults {
678 // static double myMinTaskCapability;
679 // static double myMaxTaskCapability;
680 // static double myMaxTaskDemand;
681 // static double myMaxDifficulty;
682 // static double mySubCriticalDifficultyCoefficient;
683 // static double mySuperCriticalDifficultyCoefficient;
684 // static double myHomeostasisDifficulty;
685 // static double myCapabilityTimeScale;
686 // static double myAccelerationErrorTimeScaleCoefficient;
687 // static double myAccelerationErrorNoiseIntensityCoefficient;
688 // static double myActionStepLengthCoefficient;
689 // static double myMinActionStepLength;
690 // static double myMaxActionStepLength;
691 // static double mySpeedPerceptionErrorTimeScaleCoefficient;
692 // static double mySpeedPerceptionErrorNoiseIntensityCoefficient;
693 // static double myHeadwayPerceptionErrorTimeScaleCoefficient;
694 // static double myHeadwayPerceptionErrorNoiseIntensityCoefficient;
695 // static double myOppositeDirectionDrivingFactor;
696 
697  // for MSSimpleDriverState
698  static double minAwareness;
699  static double initialAwareness;
700  static double errorTimeScaleCoefficient;
701  static double errorNoiseIntensityCoefficient;
702  static double speedDifferenceErrorCoefficient;
703  static double speedDifferenceChangePerceptionThreshold;
704  static double headwayChangePerceptionThreshold;
705  static double headwayErrorCoefficient;
706  static double maximalReactionTimeFactor;
707 };
708 
709 
710 
711 #endif
712 
713 /****************************************************************************/
OUProcess::myTimeScale
double myTimeScale
The time scale of the process.
Definition: MSDriverState.h:89
OUProcess::step
void step(double dt)
evolve for a time step of length dt.
Definition: MSDriverState.cpp:106
OUProcess::myState
double myState
The current state of the process.
Definition: MSDriverState.h:85
MSSimpleDriverState::getHeadwayErrorCoefficient
double getHeadwayErrorCoefficient() const
Definition: MSDriverState.h:140
SUMOTime.h
MSSimpleDriverState::myStepDuration
double myStepDuration
Definition: MSDriverState.h:320
MSSimpleDriverState::getSpeedDifferenceErrorCoefficient
double getSpeedDifferenceErrorCoefficient() const
Definition: MSDriverState.h:136
MSSimpleDriverState::myOriginalReactionTime
double myOriginalReactionTime
Maximal reaction time (value set for the actionStepLength at awareness=1)
Definition: MSDriverState.h:312
MSSimpleDriverState::setSpeedDifferenceErrorCoefficient
void setSpeedDifferenceErrorCoefficient(const double value)
Definition: MSDriverState.h:192
OUProcess::setState
void setState(double state)
set the process' state to a new value
Definition: MSDriverState.h:61
MSSimpleDriverState::myError
OUProcess myError
Driver's 'error',.
Definition: MSDriverState.h:290
MSSimpleDriverState::mySpeedDifferenceChangePerceptionThreshold
double mySpeedDifferenceChangePerceptionThreshold
Definition: MSDriverState.h:303
MSSimpleDriverState::myInitialAwareness
double myInitialAwareness
Initial value for 'awareness' \in [0,1].
Definition: MSDriverState.h:288
MSSimpleDriverState::unlockDebug
void unlockDebug()
Definition: MSDriverState.h:262
MSSimpleDriverState::myMaximalReactionTime
double myMaximalReactionTime
Maximal reaction time (value set for the actionStepLength at awareness=myMinAwareness)
Definition: MSDriverState.h:314
MSSimpleDriverState
Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness',...
Definition: MSDriverState.h:103
MSSimpleDriverState::getErrorTimeScale
double getErrorTimeScale() const
Definition: MSDriverState.h:128
MSSimpleDriverState::setErrorState
void setErrorState(const double state)
Definition: MSDriverState.h:220
OUProcess::OUProcess
OUProcess(double initialState, double timeScale, double noiseIntensity)
constructor
Definition: MSDriverState.cpp:96
MSSimpleDriverState::lockDebug
void lockDebug()
Definition: MSDriverState.h:258
MSSimpleDriverState::myHeadwayErrorCoefficient
double myHeadwayErrorCoefficient
Definition: MSDriverState.h:298
OUProcess::getState
double getState() const
Obtain the current state of the process.
Definition: MSDriverState.cpp:118
OUProcess::myNoiseIntensity
double myNoiseIntensity
The noise intensity of the process.
Definition: MSDriverState.h:93
MSSimpleDriverState::getHeadwayChangePerceptionThreshold
double getHeadwayChangePerceptionThreshold() const
Definition: MSDriverState.h:148
OUProcess
An Ornstein-Uhlenbeck stochastic process.
Definition: MSDriverState.h:40
MSSimpleDriverState::myMinAwareness
double myMinAwareness
Minimal value for 'awareness' \in [0,1].
Definition: MSDriverState.h:286
MSSimpleDriverState::~MSSimpleDriverState
virtual ~MSSimpleDriverState()
Definition: MSDriverState.h:107
MSSimpleDriverState::setErrorNoiseIntensity
void setErrorNoiseIntensity(const double value)
Definition: MSDriverState.h:228
MSSimpleDriverState::mySpeedDifferenceErrorCoefficient
double mySpeedDifferenceErrorCoefficient
Scaling coefficients for the magnitude of errors.
Definition: MSDriverState.h:297
MSSimpleDriverState::getMinAwareness
double getMinAwareness() const
Definition: MSDriverState.h:112
MSSimpleDriverState::myLastPerceivedSpeedDifference
std::map< const void *, double > myLastPerceivedSpeedDifference
The last perceived speed differences to the corresponding objects.
Definition: MSDriverState.h:329
MSSimpleDriverState::updateReactionTime
void updateReactionTime()
Definition: MSDriverState.cpp:188
MSSimpleDriverState::getOriginalReactionTime
double getOriginalReactionTime() const
Definition: MSDriverState.h:160
MSSimpleDriverState::myDebugLock
bool myDebugLock
Used to prevent infinite loops in debugging outputs,.
Definition: MSDriverState.h:333
MSSimpleDriverState::setHeadwayErrorCoefficient
void setHeadwayErrorCoefficient(const double value)
Definition: MSDriverState.h:196
MSSimpleDriverState::updateStepDuration
void updateStepDuration()
Definition: MSDriverState.cpp:171
MSSimpleDriverState::myHeadwayChangePerceptionThreshold
double myHeadwayChangePerceptionThreshold
Thresholds above a change in the corresponding quantity is perceived.
Definition: MSDriverState.h:302
MSSimpleDriverState::myActionStepLength
double myActionStepLength
Action step length (~current maximal reaction time) induced by awareness level.
Definition: MSDriverState.h:310
MSSimpleDriverState::update
void update()
Trigger updates for the errorProcess, assumed gaps, etc.
Definition: MSDriverState.cpp:149
OUProcess::getTimeScale
double getTimeScale() const
Definition: MSDriverState.h:69
MSSimpleDriverState::myVehicle
MSVehicle * myVehicle
Vehicle corresponding to this driver state.
Definition: MSDriverState.h:281
MSSimpleDriverState::getPerceivedHeadway
double getPerceivedHeadway(const double trueGap, const void *objID=nullptr)
Definition: MSDriverState.cpp:219
OUProcess::~OUProcess
~OUProcess()
destructor
Definition: MSDriverState.cpp:102
MSSimpleDriverState::setMaximalReactionTime
void setMaximalReactionTime(const double value)
Definition: MSDriverState.h:208
MSSimpleDriverState::setErrorNoiseIntensityCoefficient
void setErrorNoiseIntensityCoefficient(const double value)
Definition: MSDriverState.h:188
MSSimpleDriverState::getActionStepLength
double getActionStepLength() const
Definition: MSDriverState.h:164
MSSimpleDriverState::setErrorTimeScaleCoefficient
void setErrorTimeScaleCoefficient(const double value)
Definition: MSDriverState.h:184
MSSimpleDriverState::setAwareness
void setAwareness(const double value)
Definition: MSDriverState.cpp:202
MSSimpleDriverState::setHeadwayChangePerceptionThreshold
void setHeadwayChangePerceptionThreshold(const double value)
Definition: MSDriverState.h:204
MSSimpleDriverState::getErrorState
double getErrorState() const
Definition: MSDriverState.h:168
MSSimpleDriverState::MSSimpleDriverState
MSSimpleDriverState(MSVehicle *veh)
Definition: MSDriverState.cpp:123
MSSimpleDriverState::setOriginalReactionTime
void setOriginalReactionTime(const double value)
Definition: MSDriverState.h:213
OUProcess::getNoiseIntensity
double getNoiseIntensity() const
Definition: MSDriverState.h:65
MSSimpleDriverState::updateAssumedGaps
void updateAssumedGaps()
Update the assumed gaps to the known objects according to the corresponding perceived speed differenc...
Definition: MSDriverState.cpp:260
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:277
OUProcess::myRNG
static std::mt19937 myRNG
Random generator for OUProcesses.
Definition: MSDriverState.h:96
MSSimpleDriverState::getSpeedDifferenceChangePerceptionThreshold
double getSpeedDifferenceChangePerceptionThreshold() const
Definition: MSDriverState.h:144
MSSimpleDriverState::myAssumedGap
std::map< const void *, double > myAssumedGap
The assumed gaps to different objects.
Definition: MSDriverState.h:327
OUProcess::getRNG
static std::mt19937 * getRNG()
Definition: MSDriverState.h:78
config.h
MSSimpleDriverState::getErrorNoiseIntensityCoefficient
double getErrorNoiseIntensityCoefficient() const
Definition: MSDriverState.h:124
MSSimpleDriverState::debugLocked
bool debugLocked() const
Definition: MSDriverState.h:266
MSSimpleDriverState::myLastUpdateTime
double myLastUpdateTime
Time point of the last state update.
Definition: MSDriverState.h:322
MSSimpleDriverState::getErrorNoiseIntensity
double getErrorNoiseIntensity() const
Definition: MSDriverState.h:132
MSSimpleDriverState::setInitialAwareness
void setInitialAwareness(const double value)
Definition: MSDriverState.h:180
MSSimpleDriverState::myAwareness
double myAwareness
Driver's 'awareness' \in [0,1].
Definition: MSDriverState.h:284
MSSimpleDriverState::myErrorNoiseIntensityCoefficient
double myErrorNoiseIntensityCoefficient
Coefficient controlling the impact of awareness on the noise intensity of the error process.
Definition: MSDriverState.h:294
MSSimpleDriverState::setErrorTimeScale
void setErrorTimeScale(const double value)
Definition: MSDriverState.h:224
MSSimpleDriverState::getAwareness
double getAwareness() const
Definition: MSDriverState.h:152
MSSimpleDriverState::myErrorTimeScaleCoefficient
double myErrorTimeScaleCoefficient
Coefficient controlling the impact of awareness on the time scale of the error process.
Definition: MSDriverState.h:292
MSSimpleDriverState::setSpeedDifferenceChangePerceptionThreshold
void setSpeedDifferenceChangePerceptionThreshold(const double value)
Definition: MSDriverState.h:200
MSSimpleDriverState::getInitialAwareness
double getInitialAwareness() const
Definition: MSDriverState.h:116
OUProcess::setNoiseIntensity
void setNoiseIntensity(double noiseIntensity)
set the process' noise intensity to a new value
Definition: MSDriverState.h:56
SUMOXMLDefinitions.h
MSSimpleDriverState::getMaximalReactionTime
double getMaximalReactionTime() const
Definition: MSDriverState.h:156
MSSimpleDriverState::updateError
void updateError()
Definition: MSDriverState.cpp:177
OUProcess::setTimeScale
void setTimeScale(double timeScale)
set the process' timescale to a new value
Definition: MSDriverState.h:51
MSSimpleDriverState::setMinAwareness
void setMinAwareness(const double value)
Definition: MSDriverState.h:176
MSSimpleDriverState::getErrorTimeScaleCoefficient
double getErrorTimeScaleCoefficient() const
Definition: MSDriverState.h:120
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80