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-2017 German Aerospace Center (DLR) and others.
4 // PHEMlight module
5 // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/
6 /****************************************************************************/
7 //
8 // This program and the accompanying materials
9 // are made available under the terms of the Eclipse Public License v2.0
10 // which accompanies this distribution, and is available at
11 // http://www.eclipse.org/legal/epl-v20.html
12 //
13 /****************************************************************************/
20 //
21 /****************************************************************************/
22 
23 
24 #ifndef PHEMlightCEPHANDLER
25 #define PHEMlightCEPHANDLER
26 
27 #include <string>
28 #include <map>
29 #include <vector>
30 #include <utility>
31 
32 //C# TO C++ CONVERTER NOTE: Forward class declarations:
33 namespace PHEMlightdll { class CEP; }
34 namespace PHEMlightdll { class Helpers; }
35 
36 
37 namespace PHEMlightdll {
38  class CEPHandler {
39  //--------------------------------------------------------------------------------------------------
40  // Constructors
41  //--------------------------------------------------------------------------------------------------
42 
43  public:
44  CEPHandler();
45 
46  //--------------------------------------------------------------------------------------------------
47  // Members
48  //--------------------------------------------------------------------------------------------------
49 
50  private:
51  std::map<std::string, CEP*> _ceps;
52  public:
53  const std::map<std::string, CEP*>& getCEPS() const;
54 
55 
56  //--------------------------------------------------------------------------------------------------
57  // Methods
58  //--------------------------------------------------------------------------------------------------
59 
60  bool GetCEP(const std::vector<std::string>& DataPath, Helpers* Helper);
61 
62 
63  //--------------------------------------------------------------------------------------------------
64  // Methods
65  //--------------------------------------------------------------------------------------------------
66 
67  private:
68  bool Load(const std::vector<std::string>& DataPath, Helpers* Helper);
69 
70  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);
71 
72  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);
73 
74 
75  //--------------------------------------------------------------------------------------------------
76  // Functions
77  //--------------------------------------------------------------------------------------------------
78 
79  //Split the string
80  std::vector<std::string> split(const std::string& s, char delim);
81 
82  //Convert string to double
83  double todouble(const std::string& s);
84 
85  //Convert string to double list
86  std::vector<double> todoubleList(const std::vector<std::string>& s);
87 
88  //Read a line from file
89  std::string ReadLine(std::ifstream& s);
90  };
91 }
92 
93 
94 #endif //#ifndef PHEMlightCEPHANDLER
std::vector< double > todoubleList(const std::vector< std::string > &s)
Definition: CEPHandler.cpp:368
std::map< std::string, CEP * > _ceps
Definition: CEPHandler.h:51
C++ TraCI client API implementation.
bool Load(const std::vector< std::string > &DataPath, Helpers *Helper)
Definition: CEPHandler.cpp:51
std::string ReadLine(std::ifstream &s)
Definition: CEPHandler.cpp:376
bool GetCEP(const std::vector< std::string > &DataPath, Helpers *Helper)
Definition: CEPHandler.cpp:42
double todouble(const std::string &s)
Definition: CEPHandler.cpp:361
std::vector< std::string > split(const std::string &s, char delim)
Definition: CEPHandler.cpp:351
const std::map< std::string, CEP * > & getCEPS() const
Definition: CEPHandler.cpp:38
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:298
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:108