67 oc.
addDescription(
"device.driverstate.initialAwareness",
"Driver State Device",
"Initial value assigned to the driver's awareness.");
69 oc.
addDescription(
"device.driverstate.errorTimeScaleCoefficient",
"Driver State Device",
"Time scale for the error process.");
71 oc.
addDescription(
"device.driverstate.errorNoiseIntensityCoefficient",
"Driver State Device",
"Noise intensity driving the error process.");
73 oc.
addDescription(
"device.driverstate.speedDifferenceErrorCoefficient",
"Driver State Device",
"General scaling coefficient for applying the error to the perceived speed difference (error also scales with distance).");
75 oc.
addDescription(
"device.driverstate.headwayErrorCoefficient",
"Driver State Device",
"General scaling coefficient for applying the error to the perceived distance (error also scales with distance).");
77 oc.
addDescription(
"device.driverstate.speedDifferenceChangePerceptionThreshold",
"Driver State Device",
"Base threshold for recognizing changes in the speed difference (threshold also scales with distance).");
79 oc.
addDescription(
"device.driverstate.headwayChangePerceptionThreshold",
"Driver State Device",
"Base threshold for recognizing changes in the headway (threshold also scales with distance).");
81 oc.
addDescription(
"device.driverstate.minAwareness",
"Driver State Device",
"Minimal admissible value for the driver's awareness.");
83 oc.
addDescription(
"device.driverstate.maximalReactionTime",
"Driver State Device",
"Maximal reaction time (~action step length) induced by decreased awareness level (reached for awareness=minAwareness).");
105 errorTimeScaleCoefficient,
106 errorNoiseIntensityCoefficient,
107 speedDifferenceErrorCoefficient,
108 speedDifferenceChangePerceptionThreshold,
109 headwayChangePerceptionThreshold,
110 headwayErrorCoefficient,
111 maximalReactionTime);
112 into.push_back(device);
151 return getFloatParam(v, oc,
"driverstate.maximalReactionTime", -1.0,
false);
160 double initialAwareness,
161 double errorTimeScaleCoefficient,
162 double errorNoiseIntensityCoefficient,
163 double speedDifferenceErrorCoefficient,
164 double speedDifferenceChangePerceptionThreshold,
165 double headwayChangePerceptionThreshold,
166 double headwayErrorCoefficient,
167 double maximalReactionTime) :
183 #ifdef DEBUG_DSDEVICE 184 std::cout <<
"initialized device '" <<
id <<
"' with " 221 #ifdef DEBUG_DSDEVICE 222 std::cout <<
"MSDevice_DriverState::getParameter(key=" << key <<
")" << std::endl;
224 if (key ==
"awareness") {
226 }
else if (key ==
"errorState") {
228 }
else if (key ==
"errorTimeScale") {
230 }
else if (key ==
"errorNoiseIntensity") {
232 }
else if (key ==
"errorNoiseIntensity") {
234 }
else if (key ==
"minAwareness") {
236 }
else if (key ==
"initialAwareness") {
238 }
else if (key ==
"errorTimeScaleCoefficient") {
240 }
else if (key ==
"errorNoiseIntensityCoefficient") {
242 }
else if (key ==
"speedDifferenceErrorCoefficient") {
244 }
else if (key ==
"headwayErrorCoefficient") {
246 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
248 }
else if (key ==
"headwayChangePerceptionThreshold") {
250 }
else if (key ==
"maximalReactionTime") {
252 }
else if (key ==
"originalReactionTime") {
254 }
else if (key ==
"actionStepLength") {
263 #ifdef DEBUG_DSDEVICE 264 std::cout <<
"MSDevice_DriverState::setParameter(key=" << key <<
", value=" << value <<
")" << std::endl;
266 if (key ==
"awareness") {
268 }
else if (key ==
"errorState") {
270 }
else if (key ==
"errorTimeScale") {
272 }
else if (key ==
"errorNoiseIntensity") {
274 }
else if (key ==
"minAwareness") {
276 }
else if (key ==
"initialAwareness") {
278 }
else if (key ==
"errorTimeScaleCoefficient") {
280 }
else if (key ==
"errorNoiseIntensityCoefficient") {
282 }
else if (key ==
"speedDifferenceErrorCoefficient") {
284 }
else if (key ==
"headwayErrorCoefficient") {
286 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
288 }
else if (key ==
"headwayChangePerceptionThreshold") {
290 }
else if (key ==
"maximalReactionTime") {
292 }
else if (key ==
"originalReactionTime") {
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
void update()
update internal state
Representation of a vehicle in the micro simulation.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double mySpeedDifferenceChangePerceptionThreshold
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_DriverState-options.
static double headwayChangePerceptionThreshold
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key ...
double myInitialAwareness
static double minAwareness
static double getErrorNoiseIntensityCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
double myMaximalReactionTime
static double initialAwareness
static double getInitialAwareness(const SUMOVehicle &v, const OptionsCont &oc)
static OptionsCont & getOptions()
Retrieves the options.
static double headwayErrorCoefficient
static double errorTimeScaleCoefficient
static double getSpeedDifferenceErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
static double getMaximalReactionTime(const SUMOVehicle &v, const OptionsCont &oc)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static double getHeadwayErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
Representation of a vehicle.
std::shared_ptr< MSSimpleDriverState > myDriverState
The driver state of the holder.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key ...
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 speedDifferenceErrorCoefficient
double myErrorNoiseIntensityCoefficient
static double getMinAwareness(const SUMOVehicle &v, const OptionsCont &oc)
static double speedDifferenceChangePerceptionThreshold
static double getFloatParam(const SUMOVehicle &v, const OptionsCont &oc, std::string paramName, double deflt, bool required)
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
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 double getErrorTimeScaleCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
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*.
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.
A storage for options typed value containers)
void initDriverState()
Initializeses the driver state parameters.
Abstract in-vehicle device.
static double getHeadwayChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
double mySpeedDifferenceErrorCoefficient
double myHeadwayErrorCoefficient
double myHeadwayChangePerceptionThreshold
The ToC Device controls transition of control between automated and manual driving.
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
static double errorNoiseIntensityCoefficient
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 maximalReactionTime)
Constructor.
double myErrorTimeScaleCoefficient
static double getSpeedDifferenceChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
const std::string deviceName() const
return the name for this type of device