120 const size_t numBefore = into.size();
156 const std::string prefix = (isPerson ?
"person-device." :
"device.") +
deviceName;
157 const std::string
object = isPerson ?
"person" :
"vehicle";
159 oc.
addDescription(prefix +
".probability", optionsTopic,
"The probability for a " +
object +
" to have a '" +
deviceName +
"' device");
162 oc.
addSynonyme(prefix +
".explicit", prefix +
".knownveh",
true);
163 oc.
addDescription(prefix +
".explicit", optionsTopic,
"Assign a '" +
deviceName +
"' device to named " +
object +
"s");
166 oc.
addDescription(prefix +
".deterministic", optionsTopic,
"The '" +
deviceName +
"' devices are set deterministic using a fraction of 1000");
183 const std::string key =
"device." + paramName;
195 #ifdef DEBUG_DEVICE_PARAMS
196 std::cout <<
"vehicle '" << v.
getID() <<
"' does not supply vehicle parameter '" + key +
"'. Using default of '" << result <<
"'\n";
211 WRITE_ERRORF(
TL(
"Invalid distribution / float value '%' for parameter '%' in vehicle '%'."), val,
"device." + paramName, v.
getID());
223 WRITE_ERRORF(
TL(
"Invalid boolean value '%' for parameter '%' in vehicle '%'."), val,
"device." + paramName, v.
getID());
235 WRITE_ERRORF(
TL(
"Invalid time value '%' for parameter '%' in vehicle '%'."), val,
"device." + paramName, v.
getID());
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double sample(SumoRNG *which=0) const
Draw a sample of the distribution.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, MSDevice_StationFinder *sf)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Bluelight-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_DriverState-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_ElecHybrid-options.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Emissions-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void cleanup()
resets the edge filter
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCD-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCDReplay-options.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Friction-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_GLOSA-options.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Routing-options.
static bool checkOptions(OptionsCont &oc)
checks MSDevice_Routing-options
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_SSM-options.
A device which triggers rerouting to nearby charging stations.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_StationFinder-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void cleanup()
resets counters
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Taxi-options.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_ToC-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void cleanup()
resets counters
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Tripinfo-options.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCD-options.
static MSDevice_Vehroutes * buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, int maxRoutes=std::numeric_limits< int >::max())
Build devices for the given vehicle, if needed.
static double getFloatParam(const SUMOVehicle &v, const OptionsCont &oc, const std::string ¶mName, const double deflt, bool required=false)
static bool getBoolParam(const SUMOVehicle &v, const OptionsCont &oc, const std::string ¶mName, const bool deflt, bool required=false)
static std::string getStringParam(const SUMOVehicle &v, const OptionsCont &oc, const std::string ¶mName, const std::string &deflt, bool required=false)
virtual void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
virtual const std::string deviceName() const =0
return the name for this type of device
virtual void saveState(OutputDevice &out) const
Saves the state of the device.
static SUMOTime getTimeParam(const SUMOVehicle &v, const OptionsCont &oc, const std::string ¶mName, const SUMOTime deflt, bool required=false)
static void insertOptions(OptionsCont &oc)
Inserts options for building devices.
static SumoRNG myEquipmentRNG
A random number generator used to choose from vtype/route distributions and computing the speed facto...
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
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 std::map< std::string, std::set< std::string > > myExplicitIDs
vehicles which explicitly carry a device, sorted by device, first
static bool checkOptions(OptionsCont &oc)
check device-specific options
static void cleanupAll()
perform cleanup for all devices
static void buildTransportableDevices(MSTransportable &p, std::vector< MSTransportableDevice * > &into)
Build devices for the given person, if needed.
static void cleanup()
deletes the router instance
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTreceiver-options.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTsender-options.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_FCD-options.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
static void buildDevices(MSTransportable &p, std::vector< MSTransportableDevice * > &into)
Build devices for the given person, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_Routing-options.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTreceiver-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTsender-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
const SUMOVTypeParameter & getParameter() const
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.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
std::string getValueString(const std::string &name) const
Returns the string-value of the named option (all options)
Static storage of an output device and its base (abstract) implementation.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
Encapsulated SAX-Attributes.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
Representation of a vehicle.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter