44 const std::string type =
isVehicle() ?
"vehicle" : (
isPerson() ?
"person" :
"container");
47 if (oc.
exists(paramName)) {
62 const std::string& error = dist.
isValid();
68 const std::string type =
isVehicle() ?
"vehicle" : (
isPerson() ?
"person" :
"container");
69 WRITE_ERRORF(
TL(
"Invalid distribution / float value '%' for parameter '%' in % '%' (%)."), val, paramName, type,
getID(), e.what());
81 const std::string type =
isVehicle() ?
"vehicle" : (
isPerson() ?
"person" :
"container");
82 WRITE_ERRORF(
TL(
"Invalid boolean value '%' for parameter '%' in % '%'."), val, paramName, type,
getID());
94 const std::string type =
isVehicle() ?
"vehicle" : (
isPerson() ?
"person" :
"container");
95 WRITE_ERRORF(
TL(
"Invalid time value '%' for parameter '%' in % '%'."), val, paramName, type,
getID());
#define WRITE_ERRORF(...)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double sample(SumoRNG *which=0) const
Draw a sample of the distribution.
const std::string isValid() const
check whether the distribution is valid
const std::string & getID() const
Returns the id.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
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 OptionsCont & getOptions()
Retrieves the options.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
virtual bool isVehicle() const
Whether it is a vehicle.
bool getBoolParam(const std::string ¶mName, const bool required=false, const bool deflt=false) const
Retrieve a boolean parameter for the traffic object.
std::string getStringParam(const std::string ¶mName, const bool required=false, const std::string &deflt="") const
Retrieve a string parameter for the traffic object.
virtual const SUMOVTypeParameter & getVTypeParameter() const =0
Returns the object's "vehicle" type parameter.
SUMOTime getTimeParam(const std::string ¶mName, const bool required=false, const SUMOTime deflt=SUMOTime_MIN) const
Retrieve a time parameter for the traffic object.
virtual bool isPerson() const
Whether it is a person.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
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.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter