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