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.dev/sumo
3 // Copyright (C) 2013-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
21 // Helper singleton class for PHEM Light, holds CEP data for emission computation
22 /****************************************************************************/
23 #pragma once
24 #include <config.h>
25 
26 #include <vector>
28 #include "PHEMCEP.h"
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 public:
42 
43 
48 
49 
54  PHEMCEP* GetCep(SUMOEmissionClass emissionClass);
55 
56 
61  bool Load(SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier);
62 
63 
64 private:
87  bool ReadVehicleFile(const std::vector<std::string>& path, const std::string& emissionClass,
88  double& vehicleMass,
89  double& vehicleLoading,
90  double& vehicleMassRot,
91  double& crossArea,
92  double& cWValue,
93  double& f0,
94  double& f1,
95  double& f2,
96  double& f3,
97  double& f4,
98  double& axleRatio,
99  double& ratedPower,
100  double& engineIdlingSpeed,
101  double& engineRatedSpeed,
102  double& effectiveWheelDiameter,
103  std::string& vehicleMassType,
104  std::string& vehicleFuelType,
105  double& pNormV0,
106  double& pNormP0,
107  double& pNormV1,
108  double& pNormP1,
109  std::vector< std::vector<double> >& matrixSpeedInertiaTable,
110  std::vector< std::vector<double> >& normedDragTable);
111 
112 
113 
121  bool ReadEmissionData(bool readFC, const std::vector<std::string>& path, const std::string& emissionClass,
122  std::vector<std::string>& header, std::vector<std::vector<double> >& matrix, std::vector<double>& idlingValues);
123 
124 
125 private:
127  std::map<SUMOEmissionClass, PHEMCEP*> _ceps;
128 // StringBijection<PHEMEmissionClass> _stringRepsPhemEmissionClass;
129 
130 
131 private:
135  PHEMCEPHandler();
137  void operator=(PHEMCEPHandler const&);
138 
139 };
int SUMOEmissionClass
Data Handler for all CEP emission and vehicle Data.
PHEMCEPHandler()
Implementation of Singelton pattern private (copy) constructor and =operator to avoid more than one i...
void operator=(PHEMCEPHandler const &)
PHEMCEPHandler(PHEMCEPHandler const &)
static PHEMCEPHandler & getHandlerInstance()
Implementatio of Singelton pattern.
~PHEMCEPHandler()
Destructor.
PHEMCEP * GetCep(SUMOEmissionClass emissionClass)
Returns the CEP data for a PHEM emission class.
bool Load(SUMOEmissionClass emissionClass, const std::string &emissionClassIdentifier)
Helper method to load CEP and vehicle files from file system.
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.
std::map< SUMOEmissionClass, PHEMCEP * > _ceps
bijection between PHEMEmissionClass and CEPs
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.
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:49