 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
66 oc.
addDescription(
"device.driverstate.initialAwareness",
"Driver State Device",
"Initial value assigned to the driver's awareness.");
68 oc.
addDescription(
"device.driverstate.errorTimeScaleCoefficient",
"Driver State Device",
"Time scale for the error process.");
70 oc.
addDescription(
"device.driverstate.errorNoiseIntensityCoefficient",
"Driver State Device",
"Noise intensity driving the error process.");
72 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).");
74 oc.
addDescription(
"device.driverstate.headwayErrorCoefficient",
"Driver State Device",
"General scaling coefficient for applying the error to the perceived distance (error also scales with distance).");
76 oc.
addDescription(
"device.driverstate.speedDifferenceChangePerceptionThreshold",
"Driver State Device",
"Base threshold for recognizing changes in the speed difference (threshold also scales with distance).");
78 oc.
addDescription(
"device.driverstate.headwayChangePerceptionThreshold",
"Driver State Device",
"Base threshold for recognizing changes in the headway (threshold also scales with distance).");
80 oc.
addDescription(
"device.driverstate.minAwareness",
"Driver State Device",
"Minimal admissible value for the driver's awareness.");
82 oc.
addDescription(
"device.driverstate.maximalReactionTime",
"Driver State Device",
"Maximal reaction time (~action step length) induced by decreased awareness level (reached for awareness=minAwareness).");
104 errorTimeScaleCoefficient,
105 errorNoiseIntensityCoefficient,
106 speedDifferenceErrorCoefficient,
107 speedDifferenceChangePerceptionThreshold,
108 headwayChangePerceptionThreshold,
109 headwayErrorCoefficient,
110 maximalReactionTime);
111 into.push_back(device);
150 return getFloatParam(v, oc,
"driverstate.maximalReactionTime", -1.0,
false);
159 double initialAwareness,
160 double errorTimeScaleCoefficient,
161 double errorNoiseIntensityCoefficient,
162 double speedDifferenceErrorCoefficient,
163 double speedDifferenceChangePerceptionThreshold,
164 double headwayChangePerceptionThreshold,
165 double headwayErrorCoefficient,
166 double maximalReactionTime) :
168 myMinAwareness(minAwareness),
169 myInitialAwareness(initialAwareness),
170 myErrorTimeScaleCoefficient(errorTimeScaleCoefficient),
171 myErrorNoiseIntensityCoefficient(errorNoiseIntensityCoefficient),
172 mySpeedDifferenceErrorCoefficient(speedDifferenceErrorCoefficient),
173 mySpeedDifferenceChangePerceptionThreshold(speedDifferenceChangePerceptionThreshold),
174 myHeadwayChangePerceptionThreshold(headwayChangePerceptionThreshold),
175 myHeadwayErrorCoefficient(headwayErrorCoefficient),
176 myMaximalReactionTime(maximalReactionTime) {
182 #ifdef DEBUG_DSDEVICE
183 std::cout <<
"initialized device '" <<
id <<
"' with "
220 #ifdef DEBUG_DSDEVICE
221 std::cout <<
"MSDevice_DriverState::getParameter(key=" << key <<
")" << std::endl;
223 if (key ==
"awareness") {
225 }
else if (key ==
"errorState") {
227 }
else if (key ==
"errorTimeScale") {
229 }
else if (key ==
"errorNoiseIntensity") {
231 }
else if (key ==
"errorNoiseIntensity") {
233 }
else if (key ==
"minAwareness") {
235 }
else if (key ==
"initialAwareness") {
237 }
else if (key ==
"errorTimeScaleCoefficient") {
239 }
else if (key ==
"errorNoiseIntensityCoefficient") {
241 }
else if (key ==
"speedDifferenceErrorCoefficient") {
243 }
else if (key ==
"headwayErrorCoefficient") {
245 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
247 }
else if (key ==
"headwayChangePerceptionThreshold") {
249 }
else if (key ==
"maximalReactionTime") {
251 }
else if (key ==
"originalReactionTime") {
253 }
else if (key ==
"actionStepLength") {
262 #ifdef DEBUG_DSDEVICE
263 std::cout <<
"MSDevice_DriverState::setParameter(key=" << key <<
", value=" << value <<
")" << std::endl;
265 if (key ==
"awareness") {
267 }
else if (key ==
"errorState") {
269 }
else if (key ==
"errorTimeScale") {
271 }
else if (key ==
"errorNoiseIntensity") {
273 }
else if (key ==
"minAwareness") {
275 }
else if (key ==
"initialAwareness") {
277 }
else if (key ==
"errorTimeScaleCoefficient") {
279 }
else if (key ==
"errorNoiseIntensityCoefficient") {
281 }
else if (key ==
"speedDifferenceErrorCoefficient") {
283 }
else if (key ==
"headwayErrorCoefficient") {
285 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
287 }
else if (key ==
"headwayChangePerceptionThreshold") {
289 }
else if (key ==
"maximalReactionTime") {
291 }
else if (key ==
"originalReactionTime") {
static double errorNoiseIntensityCoefficient
static double getHeadwayErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
double myHeadwayChangePerceptionThreshold
double myErrorTimeScaleCoefficient
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
virtual const std::string & getID() const =0
Get the vehicle's ID.
static double headwayChangePerceptionThreshold
double myInitialAwareness
Representation of a vehicle.
static OptionsCont & getOptions()
Retrieves the options.
double mySpeedDifferenceErrorCoefficient
const std::string deviceName() const
return the name for this type of device
static double getErrorTimeScaleCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
static double minAwareness
The ToC Device controls transition of control between automated and manual driving.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_DriverState-options.
double mySpeedDifferenceChangePerceptionThreshold
static double speedDifferenceErrorCoefficient
static double getMinAwareness(const SUMOVehicle &v, const OptionsCont &oc)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
double myMaximalReactionTime
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 errorTimeScaleCoefficient
static double headwayErrorCoefficient
static double getHeadwayChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
static double initialAwareness
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
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
static double getMaximalReactionTime(const SUMOVehicle &v, const OptionsCont &oc)
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
A storage for options typed value containers)
void update()
update internal state
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.
MSVehicle * myHolderMS
The holder vehicle casted to MSVehicle*.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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.
static double getSpeedDifferenceErrorCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
static double speedDifferenceChangePerceptionThreshold
static double getInitialAwareness(const SUMOVehicle &v, const OptionsCont &oc)
std::shared_ptr< MSSimpleDriverState > myDriverState
The driver state of the holder.
static double getErrorNoiseIntensityCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
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.
void initDriverState()
Initializeses the driver state parameters.
double myHeadwayErrorCoefficient
static double getSpeedDifferenceChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
Representation of a vehicle in the micro simulation.
Abstract in-vehicle device.