Eclipse SUMO - Simulation of Urban MObility
|
Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness', which can be controlled externally,. More...
#include <MSDriverState.h>
Public Member Functions | |
bool | debugLocked () const |
void | lockDebug () |
MSSimpleDriverState (MSVehicle *veh) | |
void | unlockDebug () |
void | update () |
Trigger updates for the errorProcess, assumed gaps, etc. | |
void | updateAssumedGaps () |
Update the assumed gaps to the known objects according to the corresponding perceived speed differences. | |
virtual | ~MSSimpleDriverState () |
Getter methods | |
double | getMinAwareness () const |
double | getInitialAwareness () const |
double | getErrorTimeScaleCoefficient () const |
double | getErrorNoiseIntensityCoefficient () const |
double | getErrorTimeScale () const |
double | getErrorNoiseIntensity () const |
double | getSpeedDifferenceErrorCoefficient () const |
double | getHeadwayErrorCoefficient () const |
double | getFreeSpeedErrorCoefficient () const |
double | getSpeedDifferenceChangePerceptionThreshold () const |
double | getHeadwayChangePerceptionThreshold () const |
double | getAwareness () const |
double | getMaximalReactionTime () const |
double | getOriginalReactionTime () const |
double | getActionStepLength () const |
double | getErrorState () const |
Setter methods | |
void | setMinAwareness (const double value) |
void | setInitialAwareness (const double value) |
void | setErrorTimeScaleCoefficient (const double value) |
void | setErrorNoiseIntensityCoefficient (const double value) |
void | setSpeedDifferenceErrorCoefficient (const double value) |
void | setHeadwayErrorCoefficient (const double value) |
void | setFreeSpeedErrorCoefficient (const double value) |
void | setSpeedDifferenceChangePerceptionThreshold (const double value) |
void | setHeadwayChangePerceptionThreshold (const double value) |
void | setMaximalReactionTime (const double value) |
void | setOriginalReactionTime (const double value) |
void | setAwareness (const double value) |
void | setErrorState (const double state) |
void | setErrorTimeScale (const double value) |
void | setErrorNoiseIntensity (const double value) |
Methods to obtain the current error quantities to be used by the car-following model | |
| |
double | getPerceivedOwnSpeed (double speed) |
apply perception error to own speed | |
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 differs sufficiently from the previously perceived to be actually perceived. If so, it sets the flag myReactionFlag[objID]=true, which should be checked just after the call to this method because it will be overwritten by subsequent calls. | |
double | getPerceivedHeadway (const double trueGap, const void *objID=nullptr) |
Private Member Functions | |
void | updateError () |
void | updateReactionTime () |
void | updateStepDuration () |
Private Attributes | |
double | myActionStepLength |
Action step length (~current maximal reaction time) induced by awareness level. | |
double | myAwareness |
Driver's 'awareness' \in [0,1]. | |
bool | myDebugLock |
Used to prevent infinite loops in debugging outputs,. | |
OUProcess | myError |
Driver's 'error',. | |
double | myErrorNoiseIntensityCoefficient |
Coefficient controlling the impact of awareness on the noise intensity of the error process. | |
double | myErrorTimeScaleCoefficient |
Coefficient controlling the impact of awareness on the time scale of the error process. | |
double | myFreeSpeedErrorCoefficient |
double | myHeadwayChangePerceptionThreshold |
Thresholds above a change in the corresponding quantity is perceived. | |
double | myHeadwayErrorCoefficient |
double | myInitialAwareness |
Initial value for 'awareness' \in [0,1]. | |
double | myMaximalReactionTime |
Maximal reaction time (value set for the actionStepLength at awareness=myMinAwareness) | |
double | myMinAwareness |
Minimal value for 'awareness' \in [0,1]. | |
double | myOriginalReactionTime |
Maximal reaction time (value set for the actionStepLength at awareness=1) | |
double | mySpeedDifferenceChangePerceptionThreshold |
double | mySpeedDifferenceErrorCoefficient |
Scaling coefficients for the magnitude of errors. | |
MSVehicle * | myVehicle |
Vehicle corresponding to this driver state. | |
Variables for tracking update instants | |
Elapsed time since the last state update
| |
double | myStepDuration |
double | myLastUpdateTime |
Time point of the last state update. | |
std::map< const void *, double > | myAssumedGap |
The assumed gaps to different objects. | |
std::map< const void *, double > | myLastPerceivedSpeedDifference |
The last perceived speed differences to the corresponding objects. | |
Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness', which can be controlled externally,.
Definition at line 103 of file MSDriverState.h.
MSSimpleDriverState::MSSimpleDriverState | ( | MSVehicle * | veh | ) |
Definition at line 127 of file MSDriverState.cpp.
References Named::getID(), updateError(), and updateReactionTime().
|
inlinevirtual |
Definition at line 107 of file MSDriverState.h.
|
inline |
Definition at line 277 of file MSDriverState.h.
References myDebugLock.
Referenced by getPerceivedHeadway(), and getPerceivedSpeedDifference().
|
inline |
Definition at line 168 of file MSDriverState.h.
References myActionStepLength.
|
inline |
Definition at line 156 of file MSDriverState.h.
References myAwareness.
|
inline |
Definition at line 132 of file MSDriverState.h.
References OUProcess::getNoiseIntensity(), and myError.
|
inline |
Definition at line 124 of file MSDriverState.h.
References myErrorNoiseIntensityCoefficient.
|
inline |
Definition at line 172 of file MSDriverState.h.
References OUProcess::getState(), and myError.
|
inline |
Definition at line 128 of file MSDriverState.h.
References OUProcess::getTimeScale(), and myError.
|
inline |
Definition at line 120 of file MSDriverState.h.
References myErrorTimeScaleCoefficient.
|
inline |
Definition at line 144 of file MSDriverState.h.
References myFreeSpeedErrorCoefficient.
|
inline |
Definition at line 152 of file MSDriverState.h.
References myHeadwayChangePerceptionThreshold.
|
inline |
Definition at line 140 of file MSDriverState.h.
References myHeadwayErrorCoefficient.
|
inline |
Definition at line 116 of file MSDriverState.h.
References myInitialAwareness.
|
inline |
Definition at line 160 of file MSDriverState.h.
References myMaximalReactionTime.
|
inline |
Definition at line 112 of file MSDriverState.h.
References myMinAwareness.
|
inline |
Definition at line 164 of file MSDriverState.h.
References myOriginalReactionTime.
double MSSimpleDriverState::getPerceivedHeadway | ( | const double | trueGap, |
const void * | objID = nullptr |
||
) |
Definition at line 230 of file MSDriverState.cpp.
References DEBUG_COND, debugLocked(), Named::getID(), OUProcess::getState(), myAssumedGap, myAwareness, myError, myHeadwayChangePerceptionThreshold, myHeadwayErrorCoefficient, myVehicle, SIMTIME, and toString().
double MSSimpleDriverState::getPerceivedOwnSpeed | ( | double | speed | ) |
apply perception error to own speed
Definition at line 224 of file MSDriverState.cpp.
References OUProcess::getState(), myError, and myFreeSpeedErrorCoefficient.
double MSSimpleDriverState::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 differs sufficiently from the previously perceived to be actually perceived. If so, it sets the flag myReactionFlag[objID]=true, which should be checked just after the call to this method because it will be overwritten by subsequent calls.
Definition at line 288 of file MSDriverState.cpp.
References DEBUG_COND, debugLocked(), Named::getID(), OUProcess::getState(), myAwareness, myError, myLastPerceivedSpeedDifference, mySpeedDifferenceChangePerceptionThreshold, mySpeedDifferenceErrorCoefficient, myVehicle, SIMTIME, and toString().
|
inline |
Definition at line 148 of file MSDriverState.h.
References mySpeedDifferenceChangePerceptionThreshold.
|
inline |
Definition at line 136 of file MSDriverState.h.
References mySpeedDifferenceErrorCoefficient.
|
inline |
Definition at line 269 of file MSDriverState.h.
References myDebugLock.
void MSSimpleDriverState::setAwareness | ( | const double | value | ) |
Definition at line 207 of file MSDriverState.cpp.
References DEBUG_COND, Named::getID(), MAX2(), myAwareness, myError, myMinAwareness, myVehicle, OUProcess::setState(), SIMTIME, and updateReactionTime().
|
inline |
Definition at line 236 of file MSDriverState.h.
References myError, and OUProcess::setNoiseIntensity().
|
inline |
Definition at line 192 of file MSDriverState.h.
References myErrorNoiseIntensityCoefficient.
|
inline |
Definition at line 228 of file MSDriverState.h.
References myError, and OUProcess::setState().
|
inline |
Definition at line 232 of file MSDriverState.h.
References myError, and OUProcess::setTimeScale().
|
inline |
Definition at line 188 of file MSDriverState.h.
References myErrorTimeScaleCoefficient.
|
inline |
Definition at line 204 of file MSDriverState.h.
References myFreeSpeedErrorCoefficient.
|
inline |
Definition at line 212 of file MSDriverState.h.
References myHeadwayChangePerceptionThreshold.
|
inline |
Definition at line 200 of file MSDriverState.h.
References myHeadwayErrorCoefficient.
|
inline |
Definition at line 184 of file MSDriverState.h.
References myInitialAwareness.
|
inline |
Definition at line 216 of file MSDriverState.h.
References myMaximalReactionTime, and updateReactionTime().
|
inline |
Definition at line 180 of file MSDriverState.h.
References myMinAwareness.
|
inline |
Definition at line 221 of file MSDriverState.h.
References myOriginalReactionTime, and updateReactionTime().
|
inline |
Definition at line 208 of file MSDriverState.h.
References mySpeedDifferenceChangePerceptionThreshold.
|
inline |
Definition at line 196 of file MSDriverState.h.
References mySpeedDifferenceErrorCoefficient.
|
inline |
Definition at line 273 of file MSDriverState.h.
References myDebugLock.
void MSSimpleDriverState::update | ( | ) |
Trigger updates for the errorProcess, assumed gaps, etc.
Definition at line 154 of file MSDriverState.cpp.
References DEBUG_COND, Named::getID(), OUProcess::getState(), myError, myStepDuration, myVehicle, SIMTIME, updateAssumedGaps(), updateError(), updateReactionTime(), and updateStepDuration().
void MSSimpleDriverState::updateAssumedGaps | ( | ) |
Update the assumed gaps to the known objects according to the corresponding perceived speed differences.
Definition at line 271 of file MSDriverState.cpp.
References MSVehicle::getSpeed(), myAssumedGap, myLastPerceivedSpeedDifference, myVehicle, and SPEED2DIST.
Referenced by update().
|
private |
Definition at line 182 of file MSDriverState.cpp.
References myAwareness, myError, myErrorNoiseIntensityCoefficient, myErrorTimeScaleCoefficient, myStepDuration, OUProcess::setNoiseIntensity(), OUProcess::setState(), OUProcess::setTimeScale(), and OUProcess::step().
Referenced by MSSimpleDriverState(), and update().
|
private |
Definition at line 193 of file MSDriverState.cpp.
References MAX2(), myActionStepLength, myAwareness, myMaximalReactionTime, myMinAwareness, myOriginalReactionTime, and TS.
Referenced by MSSimpleDriverState(), setAwareness(), setMaximalReactionTime(), setOriginalReactionTime(), and update().
|
private |
Definition at line 176 of file MSDriverState.cpp.
References myLastUpdateTime, myStepDuration, and SIMTIME.
Referenced by update().
|
private |
Action step length (~current maximal reaction time) induced by awareness level.
Definition at line 322 of file MSDriverState.h.
Referenced by getActionStepLength(), and updateReactionTime().
|
private |
The assumed gaps to different objects.
Definition at line 339 of file MSDriverState.h.
Referenced by getPerceivedHeadway(), and updateAssumedGaps().
|
private |
Driver's 'awareness' \in [0,1].
Definition at line 295 of file MSDriverState.h.
Referenced by getAwareness(), getPerceivedHeadway(), getPerceivedSpeedDifference(), setAwareness(), updateError(), and updateReactionTime().
|
private |
Used to prevent infinite loops in debugging outputs,.
Definition at line 345 of file MSDriverState.h.
Referenced by debugLocked(), lockDebug(), and unlockDebug().
|
private |
Driver's 'error',.
Definition at line 301 of file MSDriverState.h.
Referenced by getErrorNoiseIntensity(), getErrorState(), getErrorTimeScale(), getPerceivedHeadway(), getPerceivedOwnSpeed(), getPerceivedSpeedDifference(), setAwareness(), setErrorNoiseIntensity(), setErrorState(), setErrorTimeScale(), update(), and updateError().
|
private |
Coefficient controlling the impact of awareness on the noise intensity of the error process.
Definition at line 305 of file MSDriverState.h.
Referenced by getErrorNoiseIntensityCoefficient(), setErrorNoiseIntensityCoefficient(), and updateError().
|
private |
Coefficient controlling the impact of awareness on the time scale of the error process.
Definition at line 303 of file MSDriverState.h.
Referenced by getErrorTimeScaleCoefficient(), setErrorTimeScaleCoefficient(), and updateError().
|
private |
Definition at line 310 of file MSDriverState.h.
Referenced by getFreeSpeedErrorCoefficient(), getPerceivedOwnSpeed(), and setFreeSpeedErrorCoefficient().
|
private |
Thresholds above a change in the corresponding quantity is perceived.
Definition at line 314 of file MSDriverState.h.
Referenced by getHeadwayChangePerceptionThreshold(), getPerceivedHeadway(), and setHeadwayChangePerceptionThreshold().
|
private |
Definition at line 309 of file MSDriverState.h.
Referenced by getHeadwayErrorCoefficient(), getPerceivedHeadway(), and setHeadwayErrorCoefficient().
|
private |
Initial value for 'awareness' \in [0,1].
Definition at line 299 of file MSDriverState.h.
Referenced by getInitialAwareness(), and setInitialAwareness().
|
private |
The last perceived speed differences to the corresponding objects.
Definition at line 341 of file MSDriverState.h.
Referenced by getPerceivedSpeedDifference(), and updateAssumedGaps().
|
private |
Time point of the last state update.
Definition at line 334 of file MSDriverState.h.
Referenced by updateStepDuration().
|
private |
Maximal reaction time (value set for the actionStepLength at awareness=myMinAwareness)
Definition at line 326 of file MSDriverState.h.
Referenced by getMaximalReactionTime(), setMaximalReactionTime(), and updateReactionTime().
|
private |
Minimal value for 'awareness' \in [0,1].
Definition at line 297 of file MSDriverState.h.
Referenced by getMinAwareness(), setAwareness(), setMinAwareness(), and updateReactionTime().
|
private |
Maximal reaction time (value set for the actionStepLength at awareness=1)
Definition at line 324 of file MSDriverState.h.
Referenced by getOriginalReactionTime(), setOriginalReactionTime(), and updateReactionTime().
|
private |
Definition at line 315 of file MSDriverState.h.
Referenced by getPerceivedSpeedDifference(), getSpeedDifferenceChangePerceptionThreshold(), and setSpeedDifferenceChangePerceptionThreshold().
|
private |
Scaling coefficients for the magnitude of errors.
Definition at line 308 of file MSDriverState.h.
Referenced by getPerceivedSpeedDifference(), getSpeedDifferenceErrorCoefficient(), and setSpeedDifferenceErrorCoefficient().
|
private |
Definition at line 332 of file MSDriverState.h.
Referenced by update(), updateError(), and updateStepDuration().
|
private |
Vehicle corresponding to this driver state.
Definition at line 292 of file MSDriverState.h.
Referenced by getPerceivedHeadway(), getPerceivedSpeedDifference(), setAwareness(), update(), and updateAssumedGaps().