66 oc.
addDescription(
"device.driverstate.initialAwareness",
"Driver State Device",
TL(
"Initial value assigned to the driver's awareness."));
68 oc.
addDescription(
"device.driverstate.errorTimeScaleCoefficient",
"Driver State Device",
TL(
"Time scale for the error process."));
70 oc.
addDescription(
"device.driverstate.errorNoiseIntensityCoefficient",
"Driver State Device",
TL(
"Noise intensity driving the error process."));
72 oc.
addDescription(
"device.driverstate.speedDifferenceErrorCoefficient",
"Driver State Device",
TL(
"General scaling coefficient for applying the error to the perceived speed difference (error also scales with distance)."));
74 oc.
addDescription(
"device.driverstate.headwayErrorCoefficient",
"Driver State Device",
TL(
"General scaling coefficient for applying the error to the perceived distance (error also scales with distance)."));
76 oc.
addDescription(
"device.driverstate.freeSpeedErrorCoefficient",
"Driver State Device",
TL(
"General scaling coefficient for applying the error to the vehicle's own speed when driving without a leader (error also scales with own speed)."));
78 oc.
addDescription(
"device.driverstate.speedDifferenceChangePerceptionThreshold",
"Driver State Device",
TL(
"Base threshold for recognizing changes in the speed difference (threshold also scales with distance)."));
80 oc.
addDescription(
"device.driverstate.headwayChangePerceptionThreshold",
"Driver State Device",
TL(
"Base threshold for recognizing changes in the headway (threshold also scales with distance)."));
82 oc.
addDescription(
"device.driverstate.minAwareness",
"Driver State Device",
TL(
"Minimal admissible value for the driver's awareness."));
84 oc.
addDescription(
"device.driverstate.maximalReactionTime",
"Driver State Device",
TL(
"Maximal reaction time (~action step length) induced by decreased awareness level (reached for awareness=minAwareness)."));
107 errorTimeScaleCoefficient,
108 errorNoiseIntensityCoefficient,
109 speedDifferenceErrorCoefficient,
110 speedDifferenceChangePerceptionThreshold,
111 headwayChangePerceptionThreshold,
112 headwayErrorCoefficient,
113 freeSpeedErrorCoefficient,
114 maximalReactionTime);
115 into.push_back(device);
158 return getFloatParam(v, oc,
"driverstate.maximalReactionTime", -1.0,
false);
167 double initialAwareness,
168 double errorTimeScaleCoefficient,
169 double errorNoiseIntensityCoefficient,
170 double speedDifferenceErrorCoefficient,
171 double speedDifferenceChangePerceptionThreshold,
172 double headwayChangePerceptionThreshold,
173 double headwayErrorCoefficient,
174 double freeSpeedErrorCoefficient,
175 double maximalReactionTime) :
177 myMinAwareness(minAwareness),
178 myInitialAwareness(initialAwareness),
179 myErrorTimeScaleCoefficient(errorTimeScaleCoefficient),
180 myErrorNoiseIntensityCoefficient(errorNoiseIntensityCoefficient),
181 mySpeedDifferenceErrorCoefficient(speedDifferenceErrorCoefficient),
182 mySpeedDifferenceChangePerceptionThreshold(speedDifferenceChangePerceptionThreshold),
183 myHeadwayChangePerceptionThreshold(headwayChangePerceptionThreshold),
184 myHeadwayErrorCoefficient(headwayErrorCoefficient),
185 myFreeSpeedErrorCoefficient(freeSpeedErrorCoefficient),
186 myMaximalReactionTime(maximalReactionTime) {
192 #ifdef DEBUG_DSDEVICE
193 std::cout <<
"initialized device '" <<
id <<
"' with "
232 #ifdef DEBUG_DSDEVICE
233 std::cout <<
"MSDevice_DriverState::getParameter(key=" << key <<
")" << std::endl;
235 if (key ==
"awareness") {
237 }
else if (key ==
"errorState") {
239 }
else if (key ==
"errorTimeScale") {
241 }
else if (key ==
"errorNoiseIntensity") {
243 }
else if (key ==
"minAwareness") {
245 }
else if (key ==
"initialAwareness") {
247 }
else if (key ==
"errorTimeScaleCoefficient") {
249 }
else if (key ==
"errorNoiseIntensityCoefficient") {
251 }
else if (key ==
"speedDifferenceErrorCoefficient") {
253 }
else if (key ==
"headwayErrorCoefficient") {
255 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
257 }
else if (key ==
"headwayChangePerceptionThreshold") {
259 }
else if (key ==
"maximalReactionTime") {
261 }
else if (key ==
"originalReactionTime") {
263 }
else if (key ==
"actionStepLength") {
272 #ifdef DEBUG_DSDEVICE
273 std::cout <<
"MSDevice_DriverState::setParameter(key=" << key <<
", value=" << value <<
")" << std::endl;
275 if (key ==
"awareness") {
277 }
else if (key ==
"errorState") {
279 }
else if (key ==
"errorTimeScale") {
281 }
else if (key ==
"errorNoiseIntensity") {
283 }
else if (key ==
"minAwareness") {
285 }
else if (key ==
"initialAwareness") {
287 }
else if (key ==
"errorTimeScaleCoefficient") {
289 }
else if (key ==
"errorNoiseIntensityCoefficient") {
291 }
else if (key ==
"speedDifferenceErrorCoefficient") {
293 }
else if (key ==
"headwayErrorCoefficient") {
295 }
else if (key ==
"freeSpeedErrorCoefficient") {
297 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
299 }
else if (key ==
"headwayChangePerceptionThreshold") {
301 }
else if (key ==
"maximalReactionTime") {
303 }
else if (key ==
"originalReactionTime") {
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
The ToC Device controls transition of control between automated and manual driving.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
MSVehicle * myHolderMS
The holder vehicle casted to MSVehicle*.
double myErrorTimeScaleCoefficient
static double getSpeedDifferenceChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_DriverState-options.
MSDevice_DriverState(SUMOVehicle &holder, const std::string &id, double minAwareness, double initialAwareness, double errorTimeScaleCoefficient, double errorNoiseIntensityCoefficient, double speedDifferenceErrorCoefficient, double speedDifferenceChangePerceptionThreshold, double headwayChangePerceptionThreshold, double headwayErrorCoefficient, double freeSpeedErrorCoefficient, double maximalReactionTime)
Constructor.
static double getErrorTimeScaleCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
double myErrorNoiseIntensityCoefficient
static double getHeadwayErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
const std::string deviceName() const
return the name for this type of device
void initDriverState()
Initializeses the driver state parameters.
double myFreeSpeedErrorCoefficient
static double getSpeedDifferenceErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
static double getFreeSpeedErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
double myHeadwayChangePerceptionThreshold
static double getMaximalReactionTime(const SUMOVehicle &v, const OptionsCont &oc)
double myMaximalReactionTime
double mySpeedDifferenceChangePerceptionThreshold
std::shared_ptr< MSSimpleDriverState > myDriverState
The driver state of the holder.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
static double getMinAwareness(const SUMOVehicle &v, const OptionsCont &oc)
void update()
update internal state
static double getHeadwayChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
double myHeadwayErrorCoefficient
static double getErrorNoiseIntensityCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
static double getInitialAwareness(const SUMOVehicle &v, const OptionsCont &oc)
double myInitialAwareness
double mySpeedDifferenceErrorCoefficient
static double getFloatParam(const SUMOVehicle &v, const OptionsCont &oc, const std::string ¶mName, const double deflt, bool required=false)
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
Abstract in-vehicle device.
Representation of a vehicle in the micro simulation.
const std::string & getID() const
Returns the id.
A storage for options typed value containers)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
static OptionsCont & getOptions()
Retrieves the options.
Representation of a vehicle.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static double speedDifferenceChangePerceptionThreshold
static double headwayChangePerceptionThreshold
static double initialAwareness
static double minAwareness
static double freeSpeedErrorCoefficient
static double headwayErrorCoefficient
static double errorTimeScaleCoefficient
static double errorNoiseIntensityCoefficient
static double speedDifferenceErrorCoefficient