Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/foreign/PHEMlight/cpp/CEPHandler.h
169685 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2016-2025 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 are made available under the
7
// terms of the Eclipse Public License 2.0 which is available at
8
// https://www.eclipse.org/legal/epl-2.0/
9
// This Source Code may also be made available under the following Secondary
10
// Licenses when the conditions for such availability set forth in the Eclipse
11
// Public License 2.0 are satisfied: GNU General Public License, version 2
12
// or later which is available at
13
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15
/****************************************************************************/
16
/// @file CEPHandler.h
17
/// @author Martin Dippold
18
/// @author Michael Behrisch
19
/// @date July 2016
20
///
21
//
22
/****************************************************************************/
23
24
25
#ifndef PHEMlightCEPHANDLER
26
#define PHEMlightCEPHANDLER
27
28
#include <string>
29
#include <map>
30
#include <vector>
31
#include <utility>
32
33
//C# TO C++ CONVERTER NOTE: Forward class declarations:
34
namespace PHEMlightdll { class CEP; }
35
namespace PHEMlightdll { class Helpers; }
36
37
38
namespace PHEMlightdll {
39
class CEPHandler {
40
//--------------------------------------------------------------------------------------------------
41
// Constructors
42
//--------------------------------------------------------------------------------------------------
43
44
public:
45
CEPHandler();
46
47
//--------------------------------------------------------------------------------------------------
48
// Members
49
//--------------------------------------------------------------------------------------------------
50
51
private:
52
std::map<std::string, CEP*> _ceps;
53
public:
54
const std::map<std::string, CEP*>& getCEPS() const;
55
56
57
//--------------------------------------------------------------------------------------------------
58
// Methods
59
//--------------------------------------------------------------------------------------------------
60
61
bool GetCEP(const std::vector<std::string>& DataPath, Helpers* Helper);
62
63
64
//--------------------------------------------------------------------------------------------------
65
// Methods
66
//--------------------------------------------------------------------------------------------------
67
68
private:
69
bool Load(const std::vector<std::string>& DataPath, Helpers* Helper);
70
71
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);
72
73
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);
74
75
76
//--------------------------------------------------------------------------------------------------
77
// Functions
78
//--------------------------------------------------------------------------------------------------
79
80
//Split the string
81
std::vector<std::string> split(const std::string& s, char delim);
82
83
//Convert string to double
84
double todouble(const std::string& s);
85
86
//Convert string to double list
87
std::vector<double> todoubleList(const std::vector<std::string>& s);
88
89
//Read a line from file
90
std::string ReadLine(std::ifstream& s);
91
};
92
}
93
94
95
#endif //#ifndef PHEMlightCEPHANDLER
96
97