59 oc.
addDescription(
"device.driverstate.initialAwareness",
"Driver State Device",
TL(
"Initial value assigned to the driver's awareness."));
61 oc.
addDescription(
"device.driverstate.errorTimeScaleCoefficient",
"Driver State Device",
TL(
"Time scale for the error process."));
63 oc.
addDescription(
"device.driverstate.errorNoiseIntensityCoefficient",
"Driver State Device",
TL(
"Noise intensity driving the error process."));
65 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)."));
67 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)."));
69 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)."));
71 oc.
addDescription(
"device.driverstate.speedDifferenceChangePerceptionThreshold",
"Driver State Device",
TL(
"Base threshold for recognizing changes in the speed difference (threshold also scales with distance)."));
73 oc.
addDescription(
"device.driverstate.headwayChangePerceptionThreshold",
"Driver State Device",
TL(
"Base threshold for recognizing changes in the headway (threshold also scales with distance)."));
75 oc.
addDescription(
"device.driverstate.minAwareness",
"Driver State Device",
TL(
"Minimal admissible value for the driver's awareness."));
77 oc.
addDescription(
"device.driverstate.maximalReactionTime",
"Driver State Device",
TL(
"Maximal reaction time (~action step length) induced by decreased awareness level (reached for awareness=minAwareness)."));
90 v.
getFloatParam(
"device.driverstate.errorTimeScaleCoefficient"),
91 v.
getFloatParam(
"device.driverstate.errorNoiseIntensityCoefficient"),
92 v.
getFloatParam(
"device.driverstate.speedDifferenceErrorCoefficient"),
93 v.
getFloatParam(
"device.driverstate.speedDifferenceChangePerceptionThreshold"),
94 v.
getFloatParam(
"device.driverstate.headwayChangePerceptionThreshold"),
95 v.
getFloatParam(
"device.driverstate.headwayErrorCoefficient"),
96 v.
getFloatParam(
"device.driverstate.freeSpeedErrorCoefficient"),
98 into.push_back(device);
108 double initialAwareness,
109 double errorTimeScaleCoefficient,
110 double errorNoiseIntensityCoefficient,
111 double speedDifferenceErrorCoefficient,
112 double speedDifferenceChangePerceptionThreshold,
113 double headwayChangePerceptionThreshold,
114 double headwayErrorCoefficient,
115 double freeSpeedErrorCoefficient,
116 double maximalReactionTime) :
118 myMinAwareness(minAwareness),
119 myInitialAwareness(initialAwareness),
120 myErrorTimeScaleCoefficient(errorTimeScaleCoefficient),
121 myErrorNoiseIntensityCoefficient(errorNoiseIntensityCoefficient),
122 mySpeedDifferenceErrorCoefficient(speedDifferenceErrorCoefficient),
123 mySpeedDifferenceChangePerceptionThreshold(speedDifferenceChangePerceptionThreshold),
124 myHeadwayChangePerceptionThreshold(headwayChangePerceptionThreshold),
125 myHeadwayErrorCoefficient(headwayErrorCoefficient),
126 myFreeSpeedErrorCoefficient(freeSpeedErrorCoefficient),
127 myMaximalReactionTime(maximalReactionTime) {
134 std::cout <<
"initialized device '" <<
id <<
"' with "
174 std::cout <<
"MSDevice_DriverState::getParameter(key=" << key <<
")" << std::endl;
176 if (key ==
"awareness") {
178 }
else if (key ==
"errorState") {
180 }
else if (key ==
"errorTimeScale") {
182 }
else if (key ==
"errorNoiseIntensity") {
184 }
else if (key ==
"minAwareness") {
186 }
else if (key ==
"initialAwareness") {
188 }
else if (key ==
"errorTimeScaleCoefficient") {
190 }
else if (key ==
"errorNoiseIntensityCoefficient") {
192 }
else if (key ==
"speedDifferenceErrorCoefficient") {
194 }
else if (key ==
"headwayErrorCoefficient") {
196 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
198 }
else if (key ==
"headwayChangePerceptionThreshold") {
200 }
else if (key ==
"maximalReactionTime") {
202 }
else if (key ==
"originalReactionTime") {
204 }
else if (key ==
"actionStepLength") {
214 std::cout <<
"MSDevice_DriverState::setParameter(key=" << key <<
", value=" << value <<
")" << std::endl;
216 if (key ==
"awareness") {
218 }
else if (key ==
"errorState") {
220 }
else if (key ==
"errorTimeScale") {
222 }
else if (key ==
"errorNoiseIntensity") {
224 }
else if (key ==
"minAwareness") {
226 }
else if (key ==
"initialAwareness") {
228 }
else if (key ==
"errorTimeScaleCoefficient") {
230 }
else if (key ==
"errorNoiseIntensityCoefficient") {
232 }
else if (key ==
"speedDifferenceErrorCoefficient") {
234 }
else if (key ==
"headwayErrorCoefficient") {
236 }
else if (key ==
"freeSpeedErrorCoefficient") {
238 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
240 }
else if (key ==
"headwayChangePerceptionThreshold") {
242 }
else if (key ==
"maximalReactionTime") {
244 }
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 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.
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
const std::string deviceName() const
return the name for this type of device
void initDriverState()
Initialises the driver state parameters.
double myFreeSpeedErrorCoefficient
double myHeadwayChangePerceptionThreshold
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
void update()
update internal state
double myHeadwayErrorCoefficient
double myInitialAwareness
double mySpeedDifferenceErrorCoefficient
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.
double getFloatParam(const std::string ¶mName, const bool required=false, const double deflt=INVALID_DOUBLE) const
Retrieve a floating point parameter for the traffic object.
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