48 #define DEBUG_COND (true) 97 : myState(initialState),
98 myTimeScale(timeScale),
99 myNoiseIntensity(noiseIntensity) {}
107 #ifdef DEBUG_OUPROCESS 108 const double oldstate =
myState;
111 #ifdef DEBUG_OUPROCESS 112 std::cout <<
" OU-step (" << dt <<
" s.): " << oldstate <<
"->" <<
myState << std::endl;
133 mySpeedDifferenceChangePerceptionThreshold(
DriverStateDefaults::speedDifferenceChangePerceptionThreshold),
134 myOriginalReactionTime(veh->getActionStepLengthSecs()),
135 myMaximalReactionTime(
DriverStateDefaults::maximalReactionTimeFactor * myOriginalReactionTime),
140 #ifdef DEBUG_DRIVERSTATE 141 std::cout <<
"Constructing driver state for veh '" << veh->
getID() <<
"'." << std::endl;
150 #ifdef DEBUG_AWARENESS 163 #ifdef DEBUG_AWARENESS 205 #ifdef DEBUG_AWARENESS 220 #ifdef DEBUG_PERCEPTION_ERRORS 224 <<
" trueGap=" << trueGap <<
" objID=" << objID << std::endl;
234 #ifdef DEBUG_PERCEPTION_ERRORS 236 std::cout <<
" new perceived gap (=" << perceivedGap <<
") differs significantly from the assumed (=" 237 << (assumedGap ==
myAssumedGap.end() ?
"NA" :
toString(assumedGap->second)) <<
")" << std::endl;
246 #ifdef DEBUG_PERCEPTION_ERRORS 249 std::cout <<
" new perceived gap (=" << perceivedGap <<
") does *not* differ significantly from the assumed (=" 250 << (assumedGap->second) <<
")" << std::endl;
262 const void* objID = p.first;
264 double assumedSpeedDiff;
267 assumedSpeedDiff = speedDiff->second;
278 #ifdef DEBUG_PERCEPTION_ERRORS 282 <<
" trueGap=" << trueGap <<
" trueSpeedDifference=" << trueSpeedDifference <<
" objID=" << objID << std::endl;
291 #ifdef DEBUG_PERCEPTION_ERRORS 294 std::cout <<
" new perceived speed difference (=" << perceivedSpeedDifference <<
") differs significantly from the last perceived (=" 303 return perceivedSpeedDifference;
305 #ifdef DEBUG_PERCEPTION_ERRORS 307 std::cout <<
" new perceived speed difference (=" << perceivedSpeedDifference <<
") does *not* differ significantly from the last perceived (=" 308 << (lastPerceivedSpeedDifference->second) <<
")" << std::endl;
312 return lastPerceivedSpeedDifference->second;
double myAwareness
Driver's 'awareness' [0,1].
double getState() const
Obtain the current state of the process.
double myLastUpdateTime
Time point of the last state update.
double myMinAwareness
Minimal value for 'awareness' [0,1].
Representation of a vehicle in the micro simulation.
void updateReactionTime()
static double headwayChangePerceptionThreshold
void setNoiseIntensity(double noiseIntensity)
set the process' noise intensity to a new value
double myActionStepLength
Action step length (~current maximal reaction time) induced by awareness level.
double myTimeScale
The time scale of the process.
static double minAwareness
void setState(double state)
set the process' state to a new value
double myOriginalReactionTime
Maximal reaction time (value set for the actionStepLength at awareness=1)
MSSimpleDriverState(MSVehicle *veh)
void update()
Trigger updates for the errorProcess, assumed gaps, etc.
double myHeadwayErrorCoefficient
static double initialAwareness
MSVehicle * myVehicle
Vehicle corresponding to this driver state.
OUProcess(double initialState, double timeScale, double noiseIntensity)
constructor
static double headwayErrorCoefficient
static double errorTimeScaleCoefficient
double myMaximalReactionTime
Maximal reaction time (value set for the actionStepLength at awareness=myMinAwareness) ...
std::map< const void *, double > myLastPerceivedSpeedDifference
The last perceived speed differences to the corresponding objects.
static double randNorm(double mean, double variance, std::mt19937 *rng=0)
Access to a random number from a normal distribution.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double myState
The current state of the process.
static double speedDifferenceErrorCoefficient
void setTimeScale(double timeScale)
set the process' timescale to a new value
static double speedDifferenceChangePerceptionThreshold
void updateAssumedGaps()
Update the assumed gaps to the known objects according to the corresponding perceived speed differenc...
static std::mt19937 myRNG
Random generator for OUProcesses.
void updateStepDuration()
double myErrorNoiseIntensityCoefficient
Coefficient controlling the impact of awareness on the noise intensity of the error process...
std::map< const void *, double > myAssumedGap
The assumed gaps to different objects.
double myNoiseIntensity
The noise intensity of the process.
double getPerceivedHeadway(const double trueGap, const void *objID=nullptr)
double mySpeedDifferenceErrorCoefficient
Scaling coefficients for the magnitude of errors.
double myErrorTimeScaleCoefficient
Coefficient controlling the impact of awareness on the time scale of the error process.
void setAwareness(const double value)
double mySpeedDifferenceChangePerceptionThreshold
OUProcess myError
Driver's 'error',.
void step(double dt)
evolve for a time step of length dt.
static double maximalReactionTimeFactor
double myHeadwayChangePerceptionThreshold
Thresholds above a change in the corresponding quantity is perceived.
static double errorNoiseIntensityCoefficient
double getSpeed() const
Returns the vehicle's current speed.
const std::string & getID() const
Returns the name of the vehicle.
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...