Eclipse SUMO - Simulation of Urban MObility
PHEMCEPHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Helper singleton class for PHEM Light, holds CEP data for emission computation
18 /****************************************************************************/
19 #ifndef PHEMCEPHandler_h
20 #define PHEMCEPHandler_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <vector>
29 #include "PHEMCEP.h"
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
40 public:
43 
44 
49 
50 
55  PHEMCEP* GetCep(SUMOEmissionClass emissionClass);
56 
57 
62  bool Load(SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier);
63 
64 
65 private:
88  bool ReadVehicleFile(const std::vector<std::string>& path, const std::string& emissionClass,
89  double& vehicleMass,
90  double& vehicleLoading,
91  double& vehicleMassRot,
92  double& crossArea,
93  double& cWValue,
94  double& f0,
95  double& f1,
96  double& f2,
97  double& f3,
98  double& f4,
99  double& axleRatio,
100  double& ratedPower,
101  double& engineIdlingSpeed,
102  double& engineRatedSpeed,
103  double& effectiveWheelDiameter,
104  std::string& vehicleMassType,
105  std::string& vehicleFuelType,
106  double& pNormV0,
107  double& pNormP0,
108  double& pNormV1,
109  double& pNormP1,
110  std::vector< std::vector<double> >& matrixSpeedInertiaTable,
111  std::vector< std::vector<double> >& normedDragTable);
112 
113 
114 
122  bool ReadEmissionData(bool readFC, const std::vector<std::string>& path, const std::string& emissionClass,
123  std::vector<std::string>& header, std::vector<std::vector<double> >& matrix, std::vector<double>& idlingValues);
124 
125 
126 private:
128  std::map<SUMOEmissionClass, PHEMCEP*> _ceps;
129 // StringBijection<PHEMEmissionClass> _stringRepsPhemEmissionClass;
130 
131 
132 private:
136  PHEMCEPHandler();
138  void operator=(PHEMCEPHandler const&);
139 
140 };
141 
142 #endif
PHEMCEP
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:51
StringBijection.h
PHEMCEPHandler::~PHEMCEPHandler
~PHEMCEPHandler()
Destructor.
Definition: PHEMCEPHandler.cpp:42
PHEMCEPHandler::operator=
void operator=(PHEMCEPHandler const &)
SUMOEmissionClass
int SUMOEmissionClass
Definition: SUMOVehicleClass.h:231
PHEMCEPHandler::PHEMCEPHandler
PHEMCEPHandler()
Implementation of Singelton pattern private (copy) constructor and =operator to avoid more than one i...
Definition: PHEMCEPHandler.cpp:38
PHEMCEPHandler::GetCep
PHEMCEP * GetCep(SUMOEmissionClass emissionClass)
Returns the CEP data for a PHEM emission class.
Definition: PHEMCEPHandler.cpp:173
PHEMCEPHandler
Data Handler for all CEP emission and vehicle Data.
Definition: PHEMCEPHandler.h:39
PHEMCEPHandler::_ceps
std::map< SUMOEmissionClass, PHEMCEP * > _ceps
bijection between PHEMEmissionClass and CEPs
Definition: PHEMCEPHandler.h:128
PHEMCEPHandler::ReadVehicleFile
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.
Definition: PHEMCEPHandler.cpp:184
config.h
PHEMCEPHandler::getHandlerInstance
static PHEMCEPHandler & getHandlerInstance()
Implementatio of Singelton pattern.
Definition: PHEMCEPHandler.cpp:53
PHEMCEPHandler::ReadEmissionData
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.
Definition: PHEMCEPHandler.cpp:386
PHEMCEPHandler::Load
bool Load(SUMOEmissionClass emissionClass, const std::string &emissionClassIdentifier)
Helper method to load CEP and vehicle files from file system.
Definition: PHEMCEPHandler.cpp:60
PHEMCEP.h