Eclipse SUMO - Simulation of Urban MObility
HelpersPHEMlight5.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2013-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // Helper methods for PHEMlight-based emission computation
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #define INTERNAL_PHEM
25 
26 #include <vector>
27 #include <limits>
28 #include <cmath>
32 #include <utils/common/StdDefs.h>
33 #include "HelpersPHEMlight.h"
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
44 private:
45  static const int PHEMLIGHT5_BASE = 6 << 16;
46 
47 public:
51 
54  virtual ~HelpersPHEMlight5();
55 
60  SUMOEmissionClass getClassByName(const std::string& eClass, const SUMOVehicleClass vc);
61 
66  std::string getFuel(const SUMOEmissionClass c) const;
67 
75  double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams* param) const;
76 
84  double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams* param) const;
85 
94  virtual double getCoastingDecel(const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams* param) const;
95 
96 private:
104  double getEmission(PHEMlightdllV5::CEP* currCep, const std::string& e, const double p, const double v, const double drivingPower, const double ratedPower) const;
105 
113  double calcPower(PHEMlightdllV5::CEP* currCep, const double v, const double a, const double slope, const EnergyParams* param) const;
114 
122  double calcWheelPower(PHEMlightdllV5::CEP* currCep, const double v, const double a, const double slope, const EnergyParams* param) const;
123 
125  int myIndex;
129  std::map<SUMOEmissionClass, PHEMlightdllV5::CEP*> myCEPs;
130 };
int SUMOEmissionClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
An upper class for objects with additional parameters.
Definition: EnergyParams.h:43
Helper methods for PHEMlight-based emission computation.
int myIndex
the index of the next class
double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param) const
Returns the adapted acceleration value, useful for comparing with external PHEMlight references.
double calcWheelPower(PHEMlightdllV5::CEP *currCep, const double v, const double a, const double slope, const EnergyParams *param) const
Returns the power without auxiliaries.
static const int PHEMLIGHT5_BASE
HelpersPHEMlight5()
Constructor.
double calcPower(PHEMlightdllV5::CEP *currCep, const double v, const double a, const double slope, const EnergyParams *param) const
Returns the total power needed.
virtual double getCoastingDecel(const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param) const
Returns the maximum deceleration value (as a negative number), which can still be considered as non-b...
std::string getFuel(const SUMOEmissionClass c) const
Returns the fuel type described by this emission class as described in the Amitran interface (Gasolin...
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *param) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
double getEmission(PHEMlightdllV5::CEP *currCep, const std::string &e, const double p, const double v, const double drivingPower, const double ratedPower) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
PHEMlightdllV5::CEPHandler myCEPHandler
std::map< SUMOEmissionClass, PHEMlightdllV5::CEP * > myCEPs
PHEMlightdllV5::Correction * myCorrection
SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc)
Checks whether the string describes a known vehicle class.
virtual ~HelpersPHEMlight5()
Destructor.
PHEMlightdllV5::Helpers myHelper
Helper methods for PHEMlight-based emission computation.
EmissionType
Enumerating all emission types, including fuel.