56 if (typeParams ==
nullptr) {
69 if (characteristicMapString !=
"") {
88 WRITE_WARNINGF(
TL(
"Vehicle type '%' uses the emission class '%' which does not have proper defaults for its vehicle class. "
89 "Please use a different emission model or complete the vType definition with further parameters."), typeParams->
id, ecName);
97 WRITE_WARNINGF(
TL(
"Vehicle type '%' uses the Energy model parameter 'internalMomentOfInertia' which is deprecated. Use 'rotatingMass' instead."), typeParams->
id);
112 if ((stopDuration >= 0. &&
myStopDurationSeconds < 0.) || (stopDuration < 0. && myStopDurationSeconds >= 0.)) {
149 auto it =
myMap.find(attr);
150 if (it !=
myMap.end()) {
162 auto it =
myMap.find(attr);
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
const long long int VTYPEPARS_MASS_SET
const double DEFAULT_VEH_HEIGHT
const double DEFAULT_VEH_SHUT_OFF_STOP
const double DEFAULT_VEH_MASS
const double DEFAULT_VEH_WIDTH
@ SVC_HOV
vehicle is a HOV
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_TAXI
vehicle is a taxi
@ SVC_E_VEHICLE
is an electric vehicle
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_GEAREFFICIENCY
Gear efficiency.
@ SUMO_ATTR_MAXIMUMPOWER
Maximum Power.
@ SUMO_ATTR_INTERNALBATTERYRESISTANCE
Internal battery resistance.
@ SUMO_ATTR_MAXIMUMTORQUE
Maximum torque.
@ SUMO_ATTR_ROLLDRAGCOEFFICIENT
Roll Drag coefficient.
@ SUMO_ATTR_CONSTANTPOWERINTAKE
Constant Power Intake.
@ SUMO_ATTR_LOADING
additional mass loaded on the vehicle
@ SUMO_ATTR_RECUPERATIONEFFICIENCY_BY_DECELERATION
Recuperation efficiency (by deceleration)
@ SUMO_ATTR_RECUPERATIONEFFICIENCY
Recuperation efficiency (constant)
@ SUMO_ATTR_AIRDRAGCOEFFICIENT
Air drag coefficient.
@ SUMO_ATTR_POWERLOSSMAP
A string encoding the power loss map.
@ SUMO_ATTR_MAXIMUMRECUPERATIONPOWER
Maximum recuperation power.
@ SUMO_ATTR_SHUT_OFF_STOP
@ SUMO_ATTR_MAXIMUMRECUPERATIONTORQUE
Maximum recuperation torque.
@ SUMO_ATTR_RADIALDRAGCOEFFICIENT
Radial drag coefficient.
@ SUMO_ATTR_GEARRATIO
Gear ratio.
@ SUMO_ATTR_ROTATINGMASS
Mass equivalent of rotating elements.
@ SUMO_ATTR_PROPULSIONEFFICIENCY
Propulsion efficiency.
@ SUMO_ATTR_INTERNALMOMENTOFINERTIA
Internal moment of inertia.
@ SUMO_ATTR_NOMINALBATTERYVOLTAGE
Nominal battery voltage.
@ SUMO_ATTR_FRONTSURFACEAREA
Front surface area.
@ SUMO_ATTR_SHUT_OFF_AUTO
engine gets switched off if stopping duration exceeds value
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
The purpose of this class is to store a characteristic map (German: Kennfeld) of arbitrary dimensions...
An upper class for objects with additional parameters.
double getDouble(SumoXMLAttr attr) const
Returns the value for a given key.
static const std::vector< SumoXMLAttr > myParamAttrs
void setMass(const double mass)
Sets the empty mass of the vehicle (type) This is to be used by traci/libsumo.
bool isOff() const
Returns whether the vehicle is currently consuming any energy derived from the parking state.
double getTotalMass(const double defaultEmptyMass, const double defaultLoading) const
Returns the sum of the empty mass (SUMO_ATTR_MASS), tthe loading (SUMO_ATTR_LOADING) and the mass of ...
static const EnergyParams * myDefault
bool myHaveDefaultFrontSurfaceArea
double getDoubleOptional(SumoXMLAttr attr, const double def) const
Returns the value for a given key with an optional default. SUMO_ATTR_MASS and SUMO_ATTR_FRONTSURFACE...
double myWaitingTimeSeconds
std::map< SumoXMLAttr, double > myMap
The key->value maps.
EnergyParams(const SUMOVTypeParameter *typeParams=nullptr)
Constructor.
std::map< SumoXMLAttr, CharacteristicMap > myCharacteristicMapMap
double myTransportableMass
bool isEngineOff() const
Returns the state of the engine when the vehicle is not moving.
const EnergyParams * mySecondaryParams
const CharacteristicMap & getCharacteristicMap(SumoXMLAttr attr) const
Return the CharacteristicMap that belongs to a given attribute.
double getTransportableMass() const
Returns the mass of all transportables in the vehicle.
double myStopDurationSeconds
~EnergyParams()
Destructor.
void setTransportableMass(const double mass)
Sets the mass of all transportables in the vehicle.
double getAngleDiff() const
Returns the angle difference between the last two calls of setDynamicValues (usually the last two tim...
void setDynamicValues(const SUMOTime stopDuration, const bool parking, const SUMOTime waitingTime, const double angle)
Sets the values which change possibly in every simulation step and are relevant for emsssion calculat...
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
static double getWeight(const SUMOEmissionClass c)
Returns a representative weight for the given emission class see http://colombo-fp7....
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
Structure representing possible vehicle parameter.
double width
This class' width.
bool wasSet(long long int what) const
Returns whether the given parameter was set.
double height
This class' height.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
SUMOVehicleClass vehicleClass
The vehicle's class.
std::string id
The vehicle type's id.
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.