47 #define DEBUG_COND (true) 95 : myState(initialState),
96 myTimeScale(timeScale),
97 myNoiseIntensity(noiseIntensity) {}
105 #ifdef DEBUG_OUPROCESS 106 const double oldstate =
myState;
109 #ifdef DEBUG_OUPROCESS 110 std::cout <<
" OU-step (" << dt <<
" s.): " << oldstate <<
"->" <<
myState << std::endl;
131 mySpeedDifferenceChangePerceptionThreshold(
DriverStateDefaults::speedDifferenceChangePerceptionThreshold),
132 myActionStepLength(
TS),
136 #ifdef DEBUG_DRIVERSTATE 137 std::cout <<
"Constructing driver state for veh '" << veh->
getID() <<
"'." << std::endl;
145 #ifdef DEBUG_AWARENESS 156 #ifdef DEBUG_AWARENESS 184 #ifdef DEBUG_AWARENESS 186 std::cout <<
SIMTIME <<
" veh=" <<
myVehicle->
getID() <<
", setAwareness(" <<
MAX2(value, minAwareness) <<
")" << std::endl;
198 #ifdef DEBUG_PERCEPTION_ERRORS 202 <<
" trueGap=" << trueGap <<
" objID=" << objID << std::endl;
212 #ifdef DEBUG_PERCEPTION_ERRORS 214 std::cout <<
" new perceived gap (=" << perceivedGap <<
") differs significantly from the assumed (=" 215 << (assumedGap ==
myAssumedGap.end() ?
"NA" :
toString(assumedGap->second)) <<
")" << std::endl;
224 #ifdef DEBUG_PERCEPTION_ERRORS 227 std::cout <<
" new perceived gap (=" << perceivedGap <<
") does *not* differ significantly from the assumed (=" 228 << (assumedGap->second) <<
")" << std::endl;
240 const void* objID = p.first;
242 double assumedSpeedDiff;
245 assumedSpeedDiff = speedDiff->second;
256 #ifdef DEBUG_PERCEPTION_ERRORS 260 <<
" trueGap=" << trueGap <<
" trueSpeedDifference=" << trueSpeedDifference <<
" objID=" << objID << std::endl;
269 #ifdef DEBUG_PERCEPTION_ERRORS 272 std::cout <<
" new perceived speed difference (=" << perceivedSpeedDifference <<
") differs significantly from the last perceived (=" 281 return perceivedSpeedDifference;
283 #ifdef DEBUG_PERCEPTION_ERRORS 285 std::cout <<
" new perceived speed difference (=" << perceivedSpeedDifference <<
") does *not* differ significantly from the last perceived (=" 286 << (lastPerceivedSpeedDifference->second) <<
")" << std::endl;
290 return lastPerceivedSpeedDifference->second;
double getState() const
Obtain the current state of the process.
double myLastUpdateTime
Time point of the last state update.
Representation of a vehicle in the micro simulation.
static double headwayChangePerceptionThreshold
void setNoiseIntensity(double noiseIntensity)
set the process' noise intensity to a new value
double myTimeScale
The time scale of the process.
static double minAwareness
void setState(double state)
set the process' state to a new value
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
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
void step(double dt)
evolve for a time step of length dt.
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...