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.");
101 errorTimeScaleCoefficient,
102 errorNoiseIntensityCoefficient,
103 speedDifferenceErrorCoefficient,
104 speedDifferenceChangePerceptionThreshold,
105 headwayChangePerceptionThreshold,
106 headwayErrorCoefficient);
107 into.push_back(device);
151 double initialAwareness,
152 double errorTimeScaleCoefficient,
153 double errorNoiseIntensityCoefficient,
154 double speedDifferenceErrorCoefficient,
155 double speedDifferenceChangePerceptionThreshold,
156 double headwayChangePerceptionThreshold,
157 double headwayErrorCoefficient) :
173 #ifdef DEBUG_DSDEVICE 174 std::cout <<
"initialized device '" <<
id <<
"' with " 191 #ifdef DEBUG_DSDEVICE 192 std::cout <<
SIMTIME <<
" MSDevice_DriverState::createDriverState() for vehicle '" <<
myHolder.
getID() <<
"'" << std::endl;
217 #ifdef DEBUG_DSDEVICE 218 std::cout <<
"MSDevice_DriverState::getParameter(key=" << key <<
")" << std::endl;
220 if (key ==
"awareness") {
222 }
else if (key ==
"errorState") {
224 }
else if (key ==
"errorTimeScale") {
226 }
else if (key ==
"errorNoiseIntensity") {
228 }
else if (key ==
"errorNoiseIntensity") {
230 }
else if (key ==
"minAwareness") {
232 }
else if (key ==
"initialAwareness") {
234 }
else if (key ==
"errorTimeScaleCoefficient") {
236 }
else if (key ==
"errorNoiseIntensityCoefficient") {
238 }
else if (key ==
"speedDifferenceErrorCoefficient") {
240 }
else if (key ==
"headwayErrorCoefficient") {
242 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
244 }
else if (key ==
"headwayChangePerceptionThreshold") {
253 #ifdef DEBUG_DSDEVICE 254 std::cout <<
"MSDevice_DriverState::setParameter(key=" << key <<
", value=" << value <<
")" << std::endl;
256 if (key ==
"awareness") {
258 }
else if (key ==
"errorState") {
260 }
else if (key ==
"errorTimeScale") {
262 }
else if (key ==
"errorNoiseIntensity") {
264 }
else if (key ==
"minAwareness") {
266 }
else if (key ==
"initialAwareness") {
268 }
else if (key ==
"errorTimeScaleCoefficient") {
270 }
else if (key ==
"errorNoiseIntensityCoefficient") {
272 }
else if (key ==
"speedDifferenceErrorCoefficient") {
274 }
else if (key ==
"headwayErrorCoefficient") {
276 }
else if (key ==
"speedDifferenceChangePerceptionThreshold") {
278 }
else if (key ==
"headwayChangePerceptionThreshold") {
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Representation of a vehicle in the micro simulation.
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 ...
SUMOVehicle & myHolder
The vehicle that stores the device.
double myInitialAwareness
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void createDriverState()
Create a DriverState for the vehicle.
static double minAwareness
static double getErrorNoiseIntensityCoefficient(const SUMOVehicle &v, const OptionsCont &oc)
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)
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
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
double myErrorNoiseIntensityCoefficient
static double getMinAwareness(const SUMOVehicle &v, const OptionsCont &oc)
A wrapper for a Command function.
SUMOTime createDriverState(SUMOTime)
Creates a DriverState for the equipped vehicle.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
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
std::shared_ptr< MSSimpleDriverState > getDriverState() const
Returns the vehicle driver's state.
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
double myErrorTimeScaleCoefficient
static double getSpeedDifferenceChangePerceptionThreshold(const SUMOVehicle &v, const OptionsCont &oc)
virtual const std::string & getID() const =0
Get the vehicle's ID.
const std::string deviceName() const
return the name for this type of device
MSDevice_DriverState(SUMOVehicle &holder, const std::string &id, double minAwareness, double initialAwareness, double errorTimeScaleCoefficient, double errorNoiseIntensityCoefficient, double speedDifferenceErrorCoefficient, double speedDifferenceChangePerceptionThreshold, double headwayChangePerceptionThreshold, double headwayErrorCoefficient)
Constructor.