Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
EnergyParams Class Reference

An upper class for objects with additional parameters. More...

#include <EnergyParams.h>

Collaboration diagram for EnergyParams:
[legend]

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 CharacteristicMapgetCharacteristicMap (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 EnergyParamsgetDefault ()
 

Private Attributes

std::map< SumoXMLAttr, CharacteristicMapmyCharacteristicMapMap
 
std::map< SumoXMLAttr, double > myMap
 The key->value maps.
 
const EnergyParamsmySecondaryParams = nullptr
 
std::map< SumoXMLAttr, std::vector< double > > myVecMap
 

Static Private Attributes

static const EnergyParamsmyDefault = nullptr
 

Detailed Description

An upper class for objects with additional parameters.

Definition at line 43 of file EnergyParams.h.

Constructor & Destructor Documentation

◆ EnergyParams() [1/3]

◆ EnergyParams() [2/3]

◆ EnergyParams() [3/3]

EnergyParams::EnergyParams ( const EnergyParams secondaryParams)
inline

Constructor.

Definition at line 52 of file EnergyParams.h.

◆ ~EnergyParams()

EnergyParams::~EnergyParams ( )

Destructor.

Definition at line 131 of file EnergyParams.cpp.

Member Function Documentation

◆ checkParam()

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.

◆ getCharacteristicMap()

const CharacteristicMap & EnergyParams::getCharacteristicMap ( SumoXMLAttr  attr) const

Return the CharacteristicMap that belongs to a given attribute.

Parameters
[in]attrName of an attribute
Returns
A CharacteristicMap

Definition at line 180 of file EnergyParams.cpp.

References getCharacteristicMap(), myCharacteristicMapMap, mySecondaryParams, and toString().

Referenced by HelpersMMPEVEM::compute(), and getCharacteristicMap().

Here is the caller graph for this function:

◆ getDefault()

static const EnergyParams * EnergyParams::getDefault ( )
inlinestatic

Definition at line 99 of file EnergyParams.h.

References myDefault.

Referenced by HelpersEnergy::acceleration(), checkParam(), HelpersEnergy::compute(), and PollutantsInterface::Helper::getCoastingDecel().

Here is the caller graph for this function:

◆ getDouble()

◆ getDoubleOptional()

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().

Here is the caller graph for this function:

◆ getDoubles()

const std::vector< double > & EnergyParams::getDoubles ( SumoXMLAttr  attr) const

Returns the value for a given key.

Parameters
[in]keyThe key to ask for
Returns
The value stored under the key

Definition at line 167 of file EnergyParams.cpp.

References getDoubles(), mySecondaryParams, myVecMap, and toString().

Referenced by getDoubles().

Here is the caller graph for this function:

◆ isEngineOff()

bool EnergyParams::isEngineOff ( ) const

Returns the state of the engine when the vehicle is not moving.

Returns
whether the engine is running

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().

Here is the caller graph for this function:

◆ isOff()

bool EnergyParams::isOff ( ) const

Returns whether the vehicle is currently consuming any energy derived from the parking state.

Returns
whether the vehicle has any consumption

Definition at line 211 of file EnergyParams.cpp.

References getDouble(), SUMO_ATTR_DURATION, SUMO_ATTR_PARKING, and SUMO_ATTR_SHUT_OFF_STOP.

◆ setDouble()

void EnergyParams::setDouble ( SumoXMLAttr  attr,
double  value 
)

Sets a parameter.

Parameters
[in]keyThe parameter's name
[in]valueThe 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_ElecHybrid::setParameter(), MSDevice_Battery::setParameter(), and MSVehicle::workOnMoveReminders().

Here is the caller graph for this function:

◆ setSecondary()

void EnergyParams::setSecondary ( const EnergyParams secondaryParams)
inline

Set secondary params.

Parameters
[in]secondaryParamsThe secondary parameters

Definition at line 60 of file EnergyParams.h.

References mySecondaryParams.

Referenced by MSBaseVehicle::replaceVehicleType().

Here is the caller graph for this function:

Field Documentation

◆ myCharacteristicMapMap

std::map<SumoXMLAttr, CharacteristicMap> EnergyParams::myCharacteristicMapMap
private

Definition at line 110 of file EnergyParams.h.

Referenced by EnergyParams(), EnergyParams(), and getCharacteristicMap().

◆ myDefault

const EnergyParams * EnergyParams::myDefault = nullptr
staticprivate

Definition at line 113 of file EnergyParams.h.

Referenced by getDefault().

◆ myMap

std::map<SumoXMLAttr, double> EnergyParams::myMap
private

The key->value maps.

Definition at line 108 of file EnergyParams.h.

Referenced by checkParam(), EnergyParams(), EnergyParams(), getDouble(), getDoubleOptional(), and setDouble().

◆ mySecondaryParams

const EnergyParams* EnergyParams::mySecondaryParams = nullptr
private

◆ myVecMap

std::map<SumoXMLAttr, std::vector<double> > EnergyParams::myVecMap
private

Definition at line 109 of file EnergyParams.h.

Referenced by EnergyParams(), and getDoubles().


The documentation for this class was generated from the following files: