Eclipse SUMO - Simulation of Urban MObility
EnergyParams Class Reference

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

#include <EnergyParams.h>

Public Member Functions

 EnergyParams (const SUMOVTypeParameter *typeParams=nullptr)
 Default constructor. More...
 
const CharacteristicMapgetCharacteristicMap (SumoXMLAttr attr) const
 Return the CharacteristicMap that belongs to a given attribute. More...
 
double getDouble (SumoXMLAttr attr) const
 
const std::vector< double > & getDoubles (SumoXMLAttr attr) const
 Returns the value for a given key. More...
 
bool knowsParameter (SumoXMLAttr attr) const
 
void setDouble (SumoXMLAttr attr, double value)
 Sets a parameter. More...
 
 ~EnergyParams ()
 Destructor. More...
 

Private Attributes

std::map< SumoXMLAttr, CharacteristicMapmyCharacteristicMapMap
 
std::map< SumoXMLAttr, double > myMap
 The key->value maps. More...
 
std::map< SumoXMLAttr, std::vector< double > > myVecMap
 

Detailed Description

An upper class for objects with additional parameters.

Definition at line 41 of file EnergyParams.h.

Constructor & Destructor Documentation

◆ EnergyParams()

◆ ~EnergyParams()

EnergyParams::~EnergyParams ( )

Destructor.

Definition at line 81 of file EnergyParams.cpp.

Member Function Documentation

◆ 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 110 of file EnergyParams.cpp.

References myCharacteristicMapMap, and toString().

Referenced by HelpersMMPEVEM::compute().

Here is the caller graph for this function:

◆ getDouble()

◆ 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 100 of file EnergyParams.cpp.

References myVecMap, and toString().

◆ knowsParameter()

bool EnergyParams::knowsParameter ( SumoXMLAttr  attr) const

Definition at line 120 of file EnergyParams.cpp.

References myCharacteristicMapMap, myMap, and myVecMap.

Referenced by MSDevice_Battery::checkParam(), and MSDevice_ElecHybrid::checkParam().

Here is the caller graph for this function:

◆ 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 85 of file EnergyParams.cpp.

References myMap.

Referenced by MSDevice_ElecHybrid::acceleration(), MSDevice_ElecHybrid::buildVehicleDevices(), MSDevice_Battery::checkParam(), MSDevice_ElecHybrid::checkParam(), MSDevice_ElecHybrid::consumption(), MSDevice_Battery::notifyMove(), MSDevice_Battery::setParameter(), and MSDevice_ElecHybrid::setParameter().

Here is the caller graph for this function:

Field Documentation

◆ myCharacteristicMapMap

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

Definition at line 79 of file EnergyParams.h.

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

◆ myMap

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

The key->value maps.

Definition at line 77 of file EnergyParams.h.

Referenced by EnergyParams(), getDouble(), knowsParameter(), and setDouble().

◆ myVecMap

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

Definition at line 78 of file EnergyParams.h.

Referenced by EnergyParams(), getDoubles(), and knowsParameter().


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