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 /****************************************************************************/
18 //
19 /****************************************************************************/
20 
21 
22 #ifndef PHEMlightCEPHANDLER
23 #define PHEMlightCEPHANDLER
24 
25 #include <string>
26 #include <map>
27 #include <vector>
28 #include <utility>
29 
30 //C# TO C++ CONVERTER NOTE: Forward class declarations:
31 namespace PHEMlightdll { class CEP; }
32 namespace PHEMlightdll { class Helpers; }
33 
34 
35 namespace PHEMlightdll {
36  class CEPHandler {
37  //--------------------------------------------------------------------------------------------------
38  // Constructors
39  //--------------------------------------------------------------------------------------------------
40 
41  public:
42  CEPHandler();
43 
44  //--------------------------------------------------------------------------------------------------
45  // Members
46  //--------------------------------------------------------------------------------------------------
47 
48  private:
49  std::map<std::string, CEP*> _ceps;
50  public:
51  const std::map<std::string, CEP*>& getCEPS() const;
52 
53 
54  //--------------------------------------------------------------------------------------------------
55  // Methods
56  //--------------------------------------------------------------------------------------------------
57 
58  bool GetCEP(const std::vector<std::string>& DataPath, Helpers* Helper);
59 
60 
61  //--------------------------------------------------------------------------------------------------
62  // Methods
63  //--------------------------------------------------------------------------------------------------
64 
65  private:
66  bool Load(const std::vector<std::string>& DataPath, Helpers* Helper);
67 
68  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);
69 
70  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);
71 
72 
73  //--------------------------------------------------------------------------------------------------
74  // Functions
75  //--------------------------------------------------------------------------------------------------
76 
77  //Split the string
78  std::vector<std::string> split(const std::string& s, char delim);
79 
80  //Convert string to double
81  double todouble(const std::string& s);
82 
83  //Convert string to double list
84  std::vector<double> todoubleList(const std::vector<std::string>& s);
85 
86  //Read a line from file
87  std::string ReadLine(std::ifstream& s);
88  };
89 }
90 
91 
92 #endif //#ifndef PHEMlightCEPHANDLER
PHEMlightdll::CEPHandler::GetCEP
bool GetCEP(const std::vector< std::string > &DataPath, Helpers *Helper)
Definition: CEPHandler.cpp:40
PHEMlightdll::CEPHandler::getCEPS
const std::map< std::string, CEP * > & getCEPS() const
Definition: CEPHandler.cpp:36
PHEMlightdll::CEPHandler::Load
bool Load(const std::vector< std::string > &DataPath, Helpers *Helper)
Definition: CEPHandler.cpp:49
PHEMlightdll::CEPHandler::ReadLine
std::string ReadLine(std::ifstream &s)
Definition: CEPHandler.cpp:374
PHEMlightdll::CEPHandler::_ceps
std::map< std::string, CEP * > _ceps
Definition: CEPHandler.h:49
PHEMlightdll::CEPHandler
Definition: CEPHandler.h:36
PHEMlightdll::CEPHandler::CEPHandler
CEPHandler()
Definition: CEPHandler.cpp:32
PHEMlightdll
Definition: CEP.cpp:27
PHEMlightdll::CEPHandler::todoubleList
std::vector< double > todoubleList(const std::vector< std::string > &s)
Definition: CEPHandler.cpp:366
PHEMlightdll::CEPHandler::todouble
double todouble(const std::string &s)
Definition: CEPHandler.cpp:359
PHEMlightdll::Helpers
Definition: Helpers.h:29
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:296
PHEMlightdll::CEPHandler::split
std::vector< std::string > split(const std::string &s, char delim)
Definition: CEPHandler.cpp:349
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:106