Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
Correction.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2016-2024 German Aerospace Center (DLR) and others.
4// PHEMlight module
5// Copyright (C) 2016-2023 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/****************************************************************************/
21//
22/****************************************************************************/
23#pragma once
24
25#include <string>
26#include <map>
27#include <vector>
28#include <cmath>
29#include <utility>
31
32namespace PHEMlightdllV5 { class Helpers; }
33
34namespace PHEMlightdllV5 {
35 class Correction {
36 private:
38 const std::vector<std::string> privateDataPath;
39 std::string privateDETFilePath;
40 std::string privateVMAFilePath;
47
48 public:
49 Correction(const std::vector<std::string>& dataPath);
50
51 public:
52 std::map<std::string, double> DETFactors;
53
54 const bool& getUseDet() const;
55 void setUseDet(const bool& value);
56
57 const std::string& getDETFilePath() const;
58 void setDETFilePath(const std::string& value);
59
60 const std::string& getVMAFilePath() const;
61 void setVMAFilePath(const std::string& value);
62
63 const int& getYear() const;
64 void setYear(const int& value);
65
66 const double& getVehMileage() const;
67 void setVehMileage(const double& value);
68
69 //Read the file
70 bool ReadDet(std::string& ErrMSG);
71 private:
72 bool ReadDETFile(std::string& ErrMSG);
73 bool ReadVMAFile(std::string& ErrMSG);
74
75 //Initialise the Detoriation Factor for the vehicle
76 public:
77 bool IniDETfactor(Helpers* Helper);
78
79 //Get the milage of the vehicle
80 private:
81 double GetMileage(Helpers* Helper);
82
83 public:
84 const bool& getUseTNOx() const;
85 void setUseTNOx(const bool& value);
86
87 const std::string& getTNOxFilePath() const;
88 void setTNOxFilePath(const std::string& value);
89
90 const double& getAmbTemp() const;
91 void setAmbTemp(const double& value);
92
93 const double& getTNOxFactor() const;
94 void setTNOxFactor(const double& value);
95
96 //Read the file
97 bool ReadTNOx(std::string& ErrMSG);
98
99 bool IniTNOxfactor(Helpers* Helper);
100
101 private:
102 double Interpolate(double px, double p1, double p2, double e1, double e2);
103
104 private:
108
109 };
110}
void setAmbTemp(const double &value)
const std::vector< std::string > privateDataPath
Definition Correction.h:38
bool IniDETfactor(Helpers *Helper)
const bool & getUseTNOx() const
void setTNOxFilePath(const std::string &value)
const int & getYear() const
bool IniTNOxfactor(Helpers *Helper)
std::map< std::string, double > DETFactors
Definition Correction.h:52
std::string privateDETFilePath
Definition Correction.h:39
void setDETFilePath(const std::string &value)
bool ReadVMAFile(std::string &ErrMSG)
bool ReadDet(std::string &ErrMSG)
const std::string & getTNOxFilePath() const
double Interpolate(double px, double p1, double p2, double e1, double e2)
const double & getVehMileage() const
void setTNOxFactor(const double &value)
const std::string & getDETFilePath() const
void setVMAFilePath(const std::string &value)
bool ReadTNOx(std::string &ErrMSG)
const double & getTNOxFactor() const
std::string privateVMAFilePath
Definition Correction.h:40
std::string privateTNOxFilePath
Definition Correction.h:44
const double & getAmbTemp() const
double GetMileage(Helpers *Helper)
bool ReadDETFile(std::string &ErrMSG)
void setYear(const int &value)
void setUseTNOx(const bool &value)
void setVehMileage(const double &value)
const bool & getUseDet() const
void setUseDet(const bool &value)
const std::string & getVMAFilePath() const
a class to store JSON values
Definition json.hpp:17282