SUMO - Simulation of Urban MObility
PHEMCEPHandler Class Reference

Data Handler for all CEP emission and vehicle Data. More...

#include <PHEMCEPHandler.h>

Collaboration diagram for PHEMCEPHandler:
Collaboration graph

Public Member Functions

PHEMCEPGetCep (SUMOEmissionClass emissionClass)
 Returns the CEP data for a PHEM emission class. More...
 
bool Load (SUMOEmissionClass emissionClass, const std::string &emissionClassIdentifier)
 Helper method to load CEP and vehicle files from file system. More...
 
 ~PHEMCEPHandler ()
 Destructor. More...
 

Static Public Member Functions

static PHEMCEPHandlergetHandlerInstance ()
 Implementatio of Singelton pattern. More...
 

Private Member Functions

void operator= (PHEMCEPHandler const &)
 
 PHEMCEPHandler ()
 Implementation of Singelton pattern private (copy) constructor and =operator to avoid more than one instances. More...
 
 PHEMCEPHandler (PHEMCEPHandler const &)
 
bool ReadEmissionData (bool readFC, const std::vector< std::string > &path, const std::string &emissionClass, std::vector< std::string > &header, std::vector< std::vector< double > > &matrix, std::vector< double > &idlingValues)
 Helper method to read a CEP file from file system. More...
 
bool ReadVehicleFile (const std::vector< std::string > &path, const std::string &emissionClass, double &vehicleMass, double &vehicleLoading, double &vehicleMassRot, double &crossArea, double &cWValue, double &f0, double &f1, double &f2, double &f3, double &f4, double &axleRatio, double &ratedPower, double &engineIdlingSpeed, double &engineRatedSpeed, double &effectiveWheelDiameter, std::string &vehicleMassType, std::string &vehicleFuelType, double &pNormV0, double &pNormP0, double &pNormV1, double &pNormP1, std::vector< std::vector< double > > &matrixSpeedInertiaTable, std::vector< std::vector< double > > &normedDragTable)
 Helper method to read a vehicle file from file system. More...
 

Private Attributes

std::map< SUMOEmissionClass, PHEMCEP * > _ceps
 bijection between PHEMEmissionClass and CEPs More...
 

Detailed Description

Data Handler for all CEP emission and vehicle Data.

Definition at line 47 of file PHEMCEPHandler.h.

Constructor & Destructor Documentation

PHEMCEPHandler::~PHEMCEPHandler ( )

Destructor.

Definition at line 50 of file PHEMCEPHandler.cpp.

References _ceps.

PHEMCEPHandler::PHEMCEPHandler ( )
private

Implementation of Singelton pattern private (copy) constructor and =operator to avoid more than one instances.

Definition at line 46 of file PHEMCEPHandler.cpp.

PHEMCEPHandler::PHEMCEPHandler ( PHEMCEPHandler const &  )
private

Member Function Documentation

PHEMCEP * PHEMCEPHandler::GetCep ( SUMOEmissionClass  emissionClass)

Returns the CEP data for a PHEM emission class.

Parameters
[in]emissionClassdesired PHEM emission class
Returns
CEP Data

Definition at line 181 of file PHEMCEPHandler.cpp.

References _ceps.

Referenced by HelpersPHEMlight::compute(), and HelpersPHEMlight::getMaxAccel().

PHEMCEPHandler & PHEMCEPHandler::getHandlerInstance ( )
static

Implementatio of Singelton pattern.

Returns
reference on the actual instance

Definition at line 61 of file PHEMCEPHandler.cpp.

Referenced by HelpersPHEMlight::compute(), HelpersPHEMlight::getClassByName(), and HelpersPHEMlight::getMaxAccel().

bool PHEMCEPHandler::Load ( SUMOEmissionClass  emissionClass,
const std::string &  emissionClassIdentifier 
)

Helper method to load CEP and vehicle files from file system.

Parameters
[in]emissionClassdesired PHEM emission class
Returns
Indicator if loading was successul

Definition at line 68 of file PHEMCEPHandler.cpp.

References _ceps, OptionsCont::getOptions(), OptionsCont::getString(), ReadEmissionData(), and ReadVehicleFile().

void PHEMCEPHandler::operator= ( PHEMCEPHandler const &  )
private
bool PHEMCEPHandler::ReadEmissionData ( bool  readFC,
const std::vector< std::string > &  path,
const std::string &  emissionClass,
std::vector< std::string > &  header,
std::vector< std::vector< double > > &  matrix,
std::vector< double > &  idlingValues 
)
private

Helper method to read a CEP file from file system.

Parameters
[in]pathThe possible paths to PHEMlight data files
[in]emissionClassdesired PHEM emission class
[in]headervector of pollutant identifiers
[in]matrixmatrix holding power pattern and CEP curves
Returns
Indicator if reading was successul

Definition at line 394 of file PHEMCEPHandler.cpp.

Referenced by Load().

bool PHEMCEPHandler::ReadVehicleFile ( const std::vector< std::string > &  path,
const std::string &  emissionClass,
double &  vehicleMass,
double &  vehicleLoading,
double &  vehicleMassRot,
double &  crossArea,
double &  cWValue,
double &  f0,
double &  f1,
double &  f2,
double &  f3,
double &  f4,
double &  axleRatio,
double &  ratedPower,
double &  engineIdlingSpeed,
double &  engineRatedSpeed,
double &  effectiveWheelDiameter,
std::string &  vehicleMassType,
std::string &  vehicleFuelType,
double &  pNormV0,
double &  pNormP0,
double &  pNormV1,
double &  pNormP1,
std::vector< std::vector< double > > &  matrixSpeedInertiaTable,
std::vector< std::vector< double > > &  normedDragTable 
)
private

Helper method to read a vehicle file from file system.

Parameters
[in]pathThe possible paths to PHEMlight data files
[in]emissionClassdesired PHEM emission class
[in]vehicleMassout variable for vehicle mass
[in]vehivleLoadingout variable for vehicle loading
[in]crossAreaout variable for crosssectional area of vehicle
[in]cwValuedout variable for cd value of vehivle
[in]f0out variable for rolling resistance coefficient f0
[in]f1out variable for rolling resistance coefficient f1
[in]f2out variable for rolling resistance coefficient f2
[in]f3out variable for rolling resistance coefficient f3
[in]f4out variable for rolling resistance coefficient f4
[in]ratedPowerout variable for rated power of vehicle
[in]vehicleMassTypeout variable for mass tyepe of vehicle, light (LV) or heavy (HV)
[in]vehicleFuelTypeout variable for fuel type (D, G) of vehicle, needed for density of fuel
[in]pNormV0out variable for step function to get maximum normalized rated power over speed
[in]pNormP0out variable for step function to get maximum normalized rated power over speed
[in]pNormV1out variable for step function to get maximum normalized rated power over speed
[in]pNormP1out variable for step function to get maximum normalized rated power over speed
[in]matrixRotFactorout variable for rotational factors over speed for more accurate power calculation
Returns
Indicator if reading was successul

Definition at line 192 of file PHEMCEPHandler.cpp.

Referenced by Load().

Field Documentation

std::map<SUMOEmissionClass, PHEMCEP*> PHEMCEPHandler::_ceps
private

bijection between PHEMEmissionClass and CEPs

Definition at line 136 of file PHEMCEPHandler.h.

Referenced by GetCep(), Load(), and ~PHEMCEPHandler().


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