![]() |
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 SUMOVTypeParameter *typeParams=nullptr) | |
| Constructor. | |
| const CharacteristicMap & | getCharacteristicMap (SumoXMLAttr attr) const |
| Return the CharacteristicMap that belongs to a given attribute. | |
| double | getDouble (SumoXMLAttr attr) 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 41 of file EnergyParams.h.
| EnergyParams::EnergyParams | ( | const SUMOVTypeParameter * | typeParams = nullptr | ) |
Constructor.
Definition at line 41 of file EnergyParams.cpp.
References Parameterised::getDouble(), Parameterised::getDoubles(), Parameterised::getParameter(), SUMOVTypeParameter::VClassDefaultValues::height, SUMOVTypeParameter::height, SUMOVTypeParameter::VClassDefaultValues::mass, SUMOVTypeParameter::mass, myCharacteristicMapMap, myMap, myVecMap, 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_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_SHUT_OFF_AUTO, SUMO_ATTR_SHUT_OFF_STOP, SUMO_ATTR_VEHICLEMASS, SUMO_ATTR_WAITINGTIME, SUMO_ATTR_WHEELRADIUS, SUMO_ATTR_WIDTH, SVC_PASSENGER, toString(), SUMOVTypeParameter::VClassDefaultValues::width, and SUMOVTypeParameter::width.
|
inline |
Constructor.
Definition at line 47 of file EnergyParams.h.
| EnergyParams::~EnergyParams | ( | ) |
Destructor.
Definition at line 101 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 150 of file EnergyParams.cpp.
References getDefault(), getDouble(), myMap, setDouble(), TL, toString(), and WRITE_WARNINGF.
Referenced by MSDevice_Battery::MSDevice_Battery(), and MSDevice_ElecHybrid::MSDevice_ElecHybrid().
| 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 137 of file EnergyParams.cpp.
References getCharacteristicMap(), myCharacteristicMapMap, mySecondaryParams, and toString().
Referenced by HelpersMMPEVEM::compute(), and getCharacteristicMap().
|
inlinestatic |
Definition at line 93 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 111 of file EnergyParams.cpp.
References getDouble(), myMap, mySecondaryParams, and toString().
Referenced by HelpersEnergy::acceleration(), checkParam(), HelpersEnergy::compute(), HelpersMMPEVEM::compute(), MSDevice_ElecHybrid::computeChargedEnergy(), PollutantsInterface::Helper::getCoastingDecel(), getDouble(), MSDevice_Battery::getParameter(), MSDevice_ElecHybrid::getParameter(), MSDevice_ElecHybrid::getParameterDouble(), isEngineOff(), isOff(), and MSVehicle::workOnMoveReminders().
| 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 124 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 160 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 168 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 105 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 55 of file EnergyParams.h.
References mySecondaryParams.
Referenced by MSBaseVehicle::replaceVehicleType().
|
private |
Definition at line 104 of file EnergyParams.h.
Referenced by EnergyParams(), and getCharacteristicMap().
|
staticprivate |
Definition at line 107 of file EnergyParams.h.
Referenced by getDefault().
|
private |
The key->value maps.
Definition at line 102 of file EnergyParams.h.
Referenced by checkParam(), EnergyParams(), getDouble(), and setDouble().
|
private |
Definition at line 105 of file EnergyParams.h.
Referenced by getCharacteristicMap(), getDouble(), getDoubles(), and setSecondary().
|
private |
Definition at line 103 of file EnergyParams.h.
Referenced by EnergyParams(), and getDoubles().