Eclipse SUMO - Simulation of Urban MObility
CEPHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2016-2019 German Aerospace Center (DLR) and others.
4 // PHEMlight module
5 // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 
20 
21 #ifndef PHEMlightCEPHANDLER
22 #define PHEMlightCEPHANDLER
23 
24 #include <string>
25 #include <map>
26 #include <vector>
27 #include <utility>
28 
29 //C# TO C++ CONVERTER NOTE: Forward class declarations:
30 namespace PHEMlightdll { class CEP; }
31 namespace PHEMlightdll { class Helpers; }
32 
33 
34 namespace PHEMlightdll {
35  class CEPHandler {
36  //--------------------------------------------------------------------------------------------------
37  // Constructors
38  //--------------------------------------------------------------------------------------------------
39 
40  public:
41  CEPHandler();
42 
43  //--------------------------------------------------------------------------------------------------
44  // Members
45  //--------------------------------------------------------------------------------------------------
46 
47  private:
48  std::map<std::string, CEP*> _ceps;
49  public:
50  const std::map<std::string, CEP*>& getCEPS() const;
51 
52 
53  //--------------------------------------------------------------------------------------------------
54  // Methods
55  //--------------------------------------------------------------------------------------------------
56 
57  bool GetCEP(const std::vector<std::string>& DataPath, Helpers* Helper);
58 
59 
60  //--------------------------------------------------------------------------------------------------
61  // Methods
62  //--------------------------------------------------------------------------------------------------
63 
64  private:
65  bool Load(const std::vector<std::string>& DataPath, Helpers* Helper);
66 
67  bool ReadVehicleFile(const std::vector<std::string>& DataPath, const std::string& emissionClass, Helpers* Helper, double& vehicleMass, double& vehicleLoading, double& vehicleMassRot, double& crossArea, double& cWValue, double& f0, double& f1, double& f2, double& f3, double& f4, double& axleRatio, double& auxPower, double& ratedPower, double& engineIdlingSpeed, double& engineRatedSpeed, double& effectiveWheelDiameter, std::vector<double>& transmissionGearRatios, 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);
68 
69  bool ReadEmissionData(bool readFC, const std::vector<std::string>& DataPath, const std::string& emissionClass, Helpers* Helper, std::vector<std::string>& header, std::vector<std::vector<double> >& matrix, std::vector<double>& idlingValues);
70 
71 
72  //--------------------------------------------------------------------------------------------------
73  // Functions
74  //--------------------------------------------------------------------------------------------------
75 
76  //Split the string
77  std::vector<std::string> split(const std::string& s, char delim);
78 
79  //Convert string to double
80  double todouble(const std::string& s);
81 
82  //Convert string to double list
83  std::vector<double> todoubleList(const std::vector<std::string>& s);
84 
85  //Read a line from file
86  std::string ReadLine(std::ifstream& s);
87  };
88 }
89 
90 
91 #endif //#ifndef PHEMlightCEPHANDLER
PHEMlightdll::CEPHandler::GetCEP
bool GetCEP(const std::vector< std::string > &DataPath, Helpers *Helper)
Definition: CEPHandler.cpp:39
PHEMlightdll::CEPHandler::getCEPS
const std::map< std::string, CEP * > & getCEPS() const
Definition: CEPHandler.cpp:35
PHEMlightdll::CEPHandler::Load
bool Load(const std::vector< std::string > &DataPath, Helpers *Helper)
Definition: CEPHandler.cpp:48
PHEMlightdll::CEPHandler::ReadLine
std::string ReadLine(std::ifstream &s)
Definition: CEPHandler.cpp:373
PHEMlightdll::CEPHandler::_ceps
std::map< std::string, CEP * > _ceps
Definition: CEPHandler.h:48
PHEMlightdll::CEPHandler
Definition: CEPHandler.h:35
PHEMlightdll::CEPHandler::CEPHandler
CEPHandler()
Definition: CEPHandler.cpp:31
PHEMlightdll
Definition: CEP.cpp:26
PHEMlightdll::CEPHandler::todoubleList
std::vector< double > todoubleList(const std::vector< std::string > &s)
Definition: CEPHandler.cpp:365
PHEMlightdll::CEPHandler::todouble
double todouble(const std::string &s)
Definition: CEPHandler.cpp:358
PHEMlightdll::Helpers
Definition: Helpers.h:28
PHEMlightdll::CEPHandler::ReadEmissionData
bool ReadEmissionData(bool readFC, const std::vector< std::string > &DataPath, const std::string &emissionClass, Helpers *Helper, std::vector< std::string > &header, std::vector< std::vector< double > > &matrix, std::vector< double > &idlingValues)
Definition: CEPHandler.cpp:295
PHEMlightdll::CEPHandler::split
std::vector< std::string > split(const std::string &s, char delim)
Definition: CEPHandler.cpp:348
PHEMlightdll::CEPHandler::ReadVehicleFile
bool ReadVehicleFile(const std::vector< std::string > &DataPath, const std::string &emissionClass, Helpers *Helper, double &vehicleMass, double &vehicleLoading, double &vehicleMassRot, double &crossArea, double &cWValue, double &f0, double &f1, double &f2, double &f3, double &f4, double &axleRatio, double &auxPower, double &ratedPower, double &engineIdlingSpeed, double &engineRatedSpeed, double &effectiveWheelDiameter, std::vector< double > &transmissionGearRatios, 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)
Definition: CEPHandler.cpp:105