SUMO - Simulation of Urban MObility
MSSimpleDriverState Class Reference

Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness', which can be controlled externally,. More...

#include <MSDriverState.h>

Collaboration diagram for MSSimpleDriverState:
Collaboration graph

Public Member Functions

bool debugLocked () const
 
void lockDebug ()
 
 MSSimpleDriverState (MSVehicle *veh)
 
void unlockDebug ()
 
void update ()
 Trigger updates for the errorProcess, assumed gaps, etc. More...
 
void updateAssumedGaps ()
 Update the assumed gaps to the known objects according to the corresponding perceived speed differences. More...
 
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 getSpeedDifferenceChangePerceptionThreshold () const
 
double getHeadwayChangePerceptionThreshold () const
 
double getAwareness () 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 setSpeedDifferenceChangePerceptionThreshold (const double value)
 
void setHeadwayChangePerceptionThreshold (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
See also
TCIModel
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. More...
 
double getPerceivedHeadway (const double trueGap, const void *objID=nullptr)
 

Private Member Functions

void updateError ()
 
void updateStepDuration ()
 

Private Attributes

double myActionStepLength
 action step length induced by awareness level More...
 
double myAwareness
 
bool myDebugLock
 Used to prevent infinite loops in debugging outputs,. More...
 
OUProcess myError
 
double myErrorNoiseIntensityCoefficient
 Coefficient controlling the impact of awareness on the noise intensity of the error process. More...
 
double myErrorTimeScaleCoefficient
 Coefficient controlling the impact of awareness on the time scale of the error process. More...
 
double myHeadwayChangePerceptionThreshold
 Thresholds above a change in the corresponding quantity is perceived. More...
 
double myHeadwayErrorCoefficient
 
double myInitialAwareness
 
double myMinAwareness
 
double mySpeedDifferenceChangePerceptionThreshold
 
double mySpeedDifferenceErrorCoefficient
 Scaling coefficients for the magnitude of errors. More...
 
MSVehiclemyVehicle
 Vehicle corresponding to this driver state. More...
 
Variables for tracking update instants

Elapsed time since the last state update

See also
updateStepDuration()
double myStepDuration
 
double myLastUpdateTime
 Time point of the last state update. More...
 
std::map< const void *, double > myAssumedGap
 The assumed gaps to different objects. More...
 
std::map< const void *, double > myLastPerceivedSpeedDifference
 The last perceived speed differences to the corresponding objects. More...
 

Detailed Description

Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness', which can be controlled externally,.

See also
MSDevice_ToC

Definition at line 114 of file MSDriverState.h.

Constructor & Destructor Documentation

◆ MSSimpleDriverState()

MSSimpleDriverState::MSSimpleDriverState ( MSVehicle veh)

Definition at line 121 of file MSDriverState.cpp.

References MSBaseVehicle::getID(), and updateError().

◆ ~MSSimpleDriverState()

virtual MSSimpleDriverState::~MSSimpleDriverState ( )
inlinevirtual

Definition at line 118 of file MSDriverState.h.

Member Function Documentation

◆ debugLocked()

bool MSSimpleDriverState::debugLocked ( ) const
inline

Definition at line 255 of file MSDriverState.h.

Referenced by getPerceivedHeadway(), and getPerceivedSpeedDifference().

◆ getAwareness()

double MSSimpleDriverState::getAwareness ( ) const
inline

Definition at line 163 of file MSDriverState.h.

◆ getErrorNoiseIntensity()

double MSSimpleDriverState::getErrorNoiseIntensity ( ) const
inline

Definition at line 143 of file MSDriverState.h.

◆ getErrorNoiseIntensityCoefficient()

double MSSimpleDriverState::getErrorNoiseIntensityCoefficient ( ) const
inline

Definition at line 135 of file MSDriverState.h.

◆ getErrorState()

double MSSimpleDriverState::getErrorState ( ) const
inline

Definition at line 167 of file MSDriverState.h.

◆ getErrorTimeScale()

double MSSimpleDriverState::getErrorTimeScale ( ) const
inline

Definition at line 139 of file MSDriverState.h.

◆ getErrorTimeScaleCoefficient()

double MSSimpleDriverState::getErrorTimeScaleCoefficient ( ) const
inline

Definition at line 131 of file MSDriverState.h.

◆ getHeadwayChangePerceptionThreshold()

double MSSimpleDriverState::getHeadwayChangePerceptionThreshold ( ) const
inline

Definition at line 159 of file MSDriverState.h.

◆ getHeadwayErrorCoefficient()

double MSSimpleDriverState::getHeadwayErrorCoefficient ( ) const
inline

Definition at line 151 of file MSDriverState.h.

◆ getInitialAwareness()

double MSSimpleDriverState::getInitialAwareness ( ) const
inline

Definition at line 127 of file MSDriverState.h.

◆ getMinAwareness()

double MSSimpleDriverState::getMinAwareness ( ) const
inline

Definition at line 123 of file MSDriverState.h.

◆ getPerceivedHeadway()

double MSSimpleDriverState::getPerceivedHeadway ( const double  trueGap,
const void *  objID = nullptr 
)

◆ getPerceivedSpeedDifference()

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 255 of file MSDriverState.cpp.

References DEBUG_COND, debugLocked(), MSBaseVehicle::getID(), OUProcess::getState(), myAwareness, myError, myLastPerceivedSpeedDifference, mySpeedDifferenceChangePerceptionThreshold, mySpeedDifferenceErrorCoefficient, myVehicle, SIMTIME, and toString().

◆ getSpeedDifferenceChangePerceptionThreshold()

double MSSimpleDriverState::getSpeedDifferenceChangePerceptionThreshold ( ) const
inline

Definition at line 155 of file MSDriverState.h.

◆ getSpeedDifferenceErrorCoefficient()

double MSSimpleDriverState::getSpeedDifferenceErrorCoefficient ( ) const
inline

Definition at line 147 of file MSDriverState.h.

◆ lockDebug()

void MSSimpleDriverState::lockDebug ( )
inline

Definition at line 247 of file MSDriverState.h.

◆ setAwareness()

void MSSimpleDriverState::setAwareness ( const double  value)

◆ setErrorNoiseIntensity()

void MSSimpleDriverState::setErrorNoiseIntensity ( const double  value)
inline

Definition at line 217 of file MSDriverState.h.

◆ setErrorNoiseIntensityCoefficient()

void MSSimpleDriverState::setErrorNoiseIntensityCoefficient ( const double  value)
inline

Definition at line 187 of file MSDriverState.h.

◆ setErrorState()

void MSSimpleDriverState::setErrorState ( const double  state)
inline

Definition at line 209 of file MSDriverState.h.

◆ setErrorTimeScale()

void MSSimpleDriverState::setErrorTimeScale ( const double  value)
inline

Definition at line 213 of file MSDriverState.h.

◆ setErrorTimeScaleCoefficient()

void MSSimpleDriverState::setErrorTimeScaleCoefficient ( const double  value)
inline

Definition at line 183 of file MSDriverState.h.

◆ setHeadwayChangePerceptionThreshold()

void MSSimpleDriverState::setHeadwayChangePerceptionThreshold ( const double  value)
inline

Definition at line 203 of file MSDriverState.h.

◆ setHeadwayErrorCoefficient()

void MSSimpleDriverState::setHeadwayErrorCoefficient ( const double  value)
inline

Definition at line 195 of file MSDriverState.h.

◆ setInitialAwareness()

void MSSimpleDriverState::setInitialAwareness ( const double  value)
inline

Definition at line 179 of file MSDriverState.h.

◆ setMinAwareness()

void MSSimpleDriverState::setMinAwareness ( const double  value)
inline

Definition at line 175 of file MSDriverState.h.

◆ setSpeedDifferenceChangePerceptionThreshold()

void MSSimpleDriverState::setSpeedDifferenceChangePerceptionThreshold ( const double  value)
inline

Definition at line 199 of file MSDriverState.h.

◆ setSpeedDifferenceErrorCoefficient()

void MSSimpleDriverState::setSpeedDifferenceErrorCoefficient ( const double  value)
inline

Definition at line 191 of file MSDriverState.h.

◆ unlockDebug()

void MSSimpleDriverState::unlockDebug ( )
inline

Definition at line 251 of file MSDriverState.h.

◆ update()

void MSSimpleDriverState::update ( )

Trigger updates for the errorProcess, assumed gaps, etc.

Definition at line 144 of file MSDriverState.cpp.

References DEBUG_COND, MSBaseVehicle::getID(), OUProcess::getState(), myError, myStepDuration, myVehicle, SIMTIME, updateAssumedGaps(), updateError(), and updateStepDuration().

◆ updateAssumedGaps()

void MSSimpleDriverState::updateAssumedGaps ( )

Update the assumed gaps to the known objects according to the corresponding perceived speed differences.

Definition at line 238 of file MSDriverState.cpp.

References MSVehicle::getSpeed(), myAssumedGap, myLastPerceivedSpeedDifference, myVehicle, and SPEED2DIST.

Referenced by update().

◆ updateError()

◆ updateStepDuration()

void MSSimpleDriverState::updateStepDuration ( )
private

Definition at line 164 of file MSDriverState.cpp.

References myLastUpdateTime, myStepDuration, and SIMTIME.

Referenced by update().

Field Documentation

◆ myActionStepLength

double MSSimpleDriverState::myActionStepLength
private

action step length induced by awareness level

Todo:
make effective

Definition at line 296 of file MSDriverState.h.

◆ myAssumedGap

std::map<const void*, double> MSSimpleDriverState::myAssumedGap
private

The assumed gaps to different objects.

Todo:
: update each step to incorporate the assumed change given a specific speed difference

Definition at line 309 of file MSDriverState.h.

Referenced by getPerceivedHeadway(), and updateAssumedGaps().

◆ myAwareness

double MSSimpleDriverState::myAwareness
private

◆ myDebugLock

bool MSSimpleDriverState::myDebugLock
private

Used to prevent infinite loops in debugging outputs,.

See also
followSpeed() and stopSpeed() (of MSCFModel_Krauss, e.g.)

Definition at line 315 of file MSDriverState.h.

◆ myError

OUProcess MSSimpleDriverState::myError
private

◆ myErrorNoiseIntensityCoefficient

double MSSimpleDriverState::myErrorNoiseIntensityCoefficient
private

Coefficient controlling the impact of awareness on the noise intensity of the error process.

Definition at line 281 of file MSDriverState.h.

Referenced by updateError().

◆ myErrorTimeScaleCoefficient

double MSSimpleDriverState::myErrorTimeScaleCoefficient
private

Coefficient controlling the impact of awareness on the time scale of the error process.

Definition at line 279 of file MSDriverState.h.

Referenced by updateError().

◆ myHeadwayChangePerceptionThreshold

double MSSimpleDriverState::myHeadwayChangePerceptionThreshold
private

Thresholds above a change in the corresponding quantity is perceived.

Note
In the comparison, we multiply the actual change amount by the current gap to the object to reflect a more precise perception if the object is closer.

Definition at line 289 of file MSDriverState.h.

Referenced by getPerceivedHeadway().

◆ myHeadwayErrorCoefficient

double MSSimpleDriverState::myHeadwayErrorCoefficient
private

Definition at line 285 of file MSDriverState.h.

Referenced by getPerceivedHeadway().

◆ myInitialAwareness

double MSSimpleDriverState::myInitialAwareness
private

Definition at line 275 of file MSDriverState.h.

◆ myLastPerceivedSpeedDifference

std::map<const void*, double> MSSimpleDriverState::myLastPerceivedSpeedDifference
private

The last perceived speed differences to the corresponding objects.

Definition at line 311 of file MSDriverState.h.

Referenced by getPerceivedSpeedDifference(), and updateAssumedGaps().

◆ myLastUpdateTime

double MSSimpleDriverState::myLastUpdateTime
private

Time point of the last state update.

Definition at line 304 of file MSDriverState.h.

Referenced by updateStepDuration().

◆ myMinAwareness

double MSSimpleDriverState::myMinAwareness
private

Definition at line 273 of file MSDriverState.h.

Referenced by setAwareness().

◆ mySpeedDifferenceChangePerceptionThreshold

double MSSimpleDriverState::mySpeedDifferenceChangePerceptionThreshold
private

Definition at line 290 of file MSDriverState.h.

Referenced by getPerceivedSpeedDifference().

◆ mySpeedDifferenceErrorCoefficient

double MSSimpleDriverState::mySpeedDifferenceErrorCoefficient
private

Scaling coefficients for the magnitude of errors.

Definition at line 284 of file MSDriverState.h.

Referenced by getPerceivedSpeedDifference().

◆ myStepDuration

double MSSimpleDriverState::myStepDuration
private

Definition at line 302 of file MSDriverState.h.

Referenced by update(), updateError(), and updateStepDuration().

◆ myVehicle

MSVehicle* MSSimpleDriverState::myVehicle
private

Vehicle corresponding to this driver state.

Definition at line 268 of file MSDriverState.h.

Referenced by getPerceivedHeadway(), getPerceivedSpeedDifference(), setAwareness(), update(), and updateAssumedGaps().


The documentation for this class was generated from the following files: