Eclipse SUMO - Simulation of Urban MObility
|
An upper class for objects with additional parameters. More...
#include <EnergyParams.h>
Public Member Functions | |
void | checkParam (const SumoXMLAttr paramKey, const std::string &id, const double lower=0., const double upper=std::numeric_limits< double >::infinity()) |
EnergyParams (const EnergyParams *secondaryParams) | |
Constructor. | |
EnergyParams (const SUMOEmissionClass c) | |
Constructor. | |
EnergyParams (const SUMOVTypeParameter *typeParams=nullptr) | |
Constructor. | |
const CharacteristicMap & | getCharacteristicMap (SumoXMLAttr attr) const |
Return the CharacteristicMap that belongs to a given attribute. | |
double | getDouble (SumoXMLAttr attr) const |
double | getDoubleOptional (SumoXMLAttr attr, const double def) const |
const std::vector< double > & | getDoubles (SumoXMLAttr attr) const |
Returns the value for a given key. | |
bool | isEngineOff () const |
Returns the state of the engine when the vehicle is not moving. | |
bool | isOff () const |
Returns whether the vehicle is currently consuming any energy derived from the parking state. | |
void | setDouble (SumoXMLAttr attr, double value) |
Sets a parameter. | |
void | setSecondary (const EnergyParams *secondaryParams) |
Set secondary params. | |
~EnergyParams () | |
Destructor. | |
Static Public Member Functions | |
static const EnergyParams * | getDefault () |
Private Attributes | |
std::map< SumoXMLAttr, CharacteristicMap > | myCharacteristicMapMap |
std::map< SumoXMLAttr, double > | myMap |
The key->value maps. | |
const EnergyParams * | mySecondaryParams = nullptr |
std::map< SumoXMLAttr, std::vector< double > > | myVecMap |
Static Private Attributes | |
static const EnergyParams * | myDefault = nullptr |
An upper class for objects with additional parameters.
Definition at line 43 of file EnergyParams.h.
EnergyParams::EnergyParams | ( | const SUMOVTypeParameter * | typeParams = nullptr | ) |
Constructor.
Definition at line 41 of file EnergyParams.cpp.
References SUMOVTypeParameter::emissionClass, Parameterised::getDouble(), Parameterised::getDoubles(), PollutantsInterface::getName(), Parameterised::getParameter(), Parameterised::hasParameter(), SUMOVTypeParameter::height, SUMOVTypeParameter::id, INVALID_DOUBLE, SUMOVTypeParameter::mass, myCharacteristicMapMap, myMap, myVecMap, StringUtils::startsWith(), SUMO_ATTR_HEIGHT, SUMO_ATTR_INTERNALMOMENTOFINERTIA, SUMO_ATTR_LOADING, SUMO_ATTR_MASS, SUMO_ATTR_ROTATINGMASS, SUMO_ATTR_WIDTH, TL, toString(), VTYPEPARS_MASS_SET, SUMOVTypeParameter::wasSet(), SUMOVTypeParameter::width, and WRITE_WARNINGF.
EnergyParams::EnergyParams | ( | const SUMOEmissionClass | c | ) |
Constructor.
Definition at line 74 of file EnergyParams.cpp.
References EMISSION_CLASS_UNSPECIFIED, PollutantsInterface::getName(), SUMOVTypeParameter::VClassDefaultValues::height, INVALID_DOUBLE, SUMOVTypeParameter::VClassDefaultValues::mass, myCharacteristicMapMap, myMap, StringUtils::startsWith(), SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_ANGLE, SUMO_ATTR_CONSTANTPOWERINTAKE, SUMO_ATTR_DURATION, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_GEAREFFICIENCY, SUMO_ATTR_GEARRATIO, SUMO_ATTR_HEIGHT, SUMO_ATTR_INTERNALBATTERYRESISTANCE, SUMO_ATTR_INTERNALMOMENTOFINERTIA, SUMO_ATTR_LOADING, SUMO_ATTR_MASS, SUMO_ATTR_MAXIMUMPOWER, SUMO_ATTR_MAXIMUMRECUPERATIONPOWER, SUMO_ATTR_MAXIMUMRECUPERATIONTORQUE, SUMO_ATTR_MAXIMUMTORQUE, SUMO_ATTR_NOMINALBATTERYVOLTAGE, SUMO_ATTR_PARKING, SUMO_ATTR_POWERLOSSMAP, SUMO_ATTR_PROPULSIONEFFICIENCY, SUMO_ATTR_RADIALDRAGCOEFFICIENT, SUMO_ATTR_RECUPERATIONEFFICIENCY, SUMO_ATTR_RECUPERATIONEFFICIENCY_BY_DECELERATION, SUMO_ATTR_ROLLDRAGCOEFFICIENT, SUMO_ATTR_ROTATINGMASS, SUMO_ATTR_SHUT_OFF_AUTO, SUMO_ATTR_SHUT_OFF_STOP, SUMO_ATTR_WAITINGTIME, SUMO_ATTR_WHEELRADIUS, SUMO_ATTR_WIDTH, SVC_PASSENGER, and SUMOVTypeParameter::VClassDefaultValues::width.
|
inline |
Constructor.
Definition at line 52 of file EnergyParams.h.
EnergyParams::~EnergyParams | ( | ) |
Destructor.
Definition at line 131 of file EnergyParams.cpp.
void EnergyParams::checkParam | ( | const SumoXMLAttr | paramKey, |
const std::string & | id, | ||
const double | lower = 0. , |
||
const double | upper = std::numeric_limits<double>::infinity() |
||
) |
Definition at line 193 of file EnergyParams.cpp.
References getDefault(), getDouble(), myMap, setDouble(), TL, toString(), and WRITE_WARNINGF.
const CharacteristicMap & EnergyParams::getCharacteristicMap | ( | SumoXMLAttr | attr | ) | const |
Return the CharacteristicMap that belongs to a given attribute.
[in] | attr | Name of an attribute |
Definition at line 180 of file EnergyParams.cpp.
References getCharacteristicMap(), myCharacteristicMapMap, mySecondaryParams, and toString().
Referenced by HelpersMMPEVEM::compute(), and getCharacteristicMap().
|
inlinestatic |
Definition at line 99 of file EnergyParams.h.
References myDefault.
Referenced by HelpersEnergy::acceleration(), checkParam(), HelpersEnergy::compute(), and PollutantsInterface::Helper::getCoastingDecel().
double EnergyParams::getDouble | ( | SumoXMLAttr | attr | ) | const |
Definition at line 141 of file EnergyParams.cpp.
References getDouble(), myMap, mySecondaryParams, and toString().
Referenced by HelpersEnergy::acceleration(), checkParam(), HelpersEnergy::compute(), HelpersMMPEVEM::compute(), MSDevice_ElecHybrid::computeChargedEnergy(), MSDevice_StationFinder::estimateConsumption(), PollutantsInterface::Helper::getCoastingDecel(), getDouble(), MSDevice_Battery::getParameter(), MSDevice_ElecHybrid::getParameter(), MSDevice_ElecHybrid::getParameterDouble(), isEngineOff(), isOff(), and MSVehicle::workOnMoveReminders().
double EnergyParams::getDoubleOptional | ( | SumoXMLAttr | attr, |
const double | def | ||
) | const |
Definition at line 154 of file EnergyParams.cpp.
References getDoubleOptional(), INVALID_DOUBLE, myMap, and mySecondaryParams.
Referenced by HelpersEnergy::acceleration(), HelpersPHEMlight5::calcPower(), HelpersPHEMlight5::calcWheelPower(), HelpersEnergy::compute(), HelpersPHEMlight5::compute(), HelpersMMPEVEM::compute(), HelpersPHEMlight5::getCoastingDecel(), getDoubleOptional(), and HelpersPHEMlight5::getModifiedAccel().
const std::vector< double > & EnergyParams::getDoubles | ( | SumoXMLAttr | attr | ) | const |
Returns the value for a given key.
[in] | key | The key to ask for |
Definition at line 167 of file EnergyParams.cpp.
References getDoubles(), mySecondaryParams, myVecMap, and toString().
Referenced by getDoubles().
bool EnergyParams::isEngineOff | ( | ) | const |
Returns the state of the engine when the vehicle is not moving.
Definition at line 203 of file EnergyParams.cpp.
References getDouble(), SUMO_ATTR_DURATION, SUMO_ATTR_SHUT_OFF_AUTO, SUMO_ATTR_SHUT_OFF_STOP, and SUMO_ATTR_WAITINGTIME.
Referenced by HelpersHBEFA::compute(), HelpersHBEFA3::compute(), HelpersHBEFA4::compute(), HelpersPHEMlight::compute(), and HelpersPHEMlight5::compute().
bool EnergyParams::isOff | ( | ) | const |
Returns whether the vehicle is currently consuming any energy derived from the parking state.
Definition at line 211 of file EnergyParams.cpp.
References getDouble(), SUMO_ATTR_DURATION, SUMO_ATTR_PARKING, and SUMO_ATTR_SHUT_OFF_STOP.
void EnergyParams::setDouble | ( | SumoXMLAttr | attr, |
double | value | ||
) |
Sets a parameter.
[in] | key | The parameter's name |
[in] | value | The parameter's value |
Definition at line 135 of file EnergyParams.cpp.
References myMap.
Referenced by MSDevice_ElecHybrid::acceleration(), checkParam(), MSDevice_ElecHybrid::consumption(), MSDevice_ElecHybrid::MSDevice_ElecHybrid(), MSDevice_Battery::notifyMove(), MSDevice_Battery::setParameter(), MSDevice_ElecHybrid::setParameter(), and MSVehicle::workOnMoveReminders().
|
inline |
Set secondary params.
[in] | secondaryParams | The secondary parameters |
Definition at line 60 of file EnergyParams.h.
References mySecondaryParams.
Referenced by MSBaseVehicle::replaceVehicleType().
|
private |
Definition at line 110 of file EnergyParams.h.
Referenced by EnergyParams(), EnergyParams(), and getCharacteristicMap().
|
staticprivate |
Definition at line 113 of file EnergyParams.h.
Referenced by getDefault().
|
private |
The key->value maps.
Definition at line 108 of file EnergyParams.h.
Referenced by checkParam(), EnergyParams(), EnergyParams(), getDouble(), getDoubleOptional(), and setDouble().
|
private |
Definition at line 111 of file EnergyParams.h.
Referenced by getCharacteristicMap(), getDouble(), getDoubleOptional(), getDoubles(), and setSecondary().
|
private |
Definition at line 109 of file EnergyParams.h.
Referenced by EnergyParams(), and getDoubles().