48 oc.
addDescription(
"device.friction.stdDev",
"Friction Device",
TL(
"The measurement noise parameter which can be applied to the friction device"));
50 oc.
addDescription(
"device.friction.offset",
"Friction Device",
TL(
"The measurement offset parameter which can be applied to the friction device -> e.g. to force false measurements"));
62 into.push_back(device);
72 myMeasuredFrictionCoefficient(1.),
74 myStdDeviation(stdDev),
94 if (key ==
"frictionCoefficient") {
96 }
else if (key ==
"stdDev") {
98 }
else if (key ==
"offset") {
100 }
else if (key ==
"rawFriction") {
111 if (key ==
"frictionCoefficient") {
113 }
else if (key ==
"stdDev") {
115 }
else if (key ==
"offset") {
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A device which collects info on current friction Coefficient on the road.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
double myOffset
a value which is initialised based on a vType parameter
~MSDevice_Friction()
Destructor.
double myStdDeviation
a value which is initialised based on a vehicle parameter
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Friction-options.
MSDevice_Friction(SUMOVehicle &holder, const std::string &id, double stdDev, double offset)
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
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
const std::string deviceName() const
return the name for this type of device
double myRawFriction
realValue from Road (without measurement model)
double myMeasuredFrictionCoefficient
a value which is initialised based on a commandline/configuration option
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.
double getFrictionCoefficient() const
Returns the lane's friction coefficient.
Abstract in-vehicle device.
SUMOVehicle & myHolder
The vehicle that stores the device.
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.
static double randNorm(double mean, double variance, SumoRNG *rng=nullptr)
Access to a random number from a normal distribution.
Representation of a vehicle, person, or container.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
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.
virtual SumoRNG * getRNG() const =0
Returns the associated RNG for this 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