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.org/sumo
3// Copyright (C) 2013-2022 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>
33#include "HelpersPHEMlight.h"
34
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
44private:
45 static const int PHEMLIGHT5_BASE = 6 << 16;
46
47public:
51
54 virtual ~HelpersPHEMlight5();
55
60 SUMOEmissionClass getClassByName(const std::string& eClass, const SUMOVehicleClass vc);
61
69 double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams* param) const;
70
78 double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope) const;
79
88 virtual double getCoastingDecel(const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams* param) const;
89
90private:
98 double getEmission(PHEMlightdllV5::CEP* currCep, const std::string& e, const double p, const double v) const;
99
105 std::map<SUMOEmissionClass, PHEMlightdllV5::CEP*> myCEPs;
106};
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
int SUMOEmissionClass
An upper class for objects with additional parameters.
Definition: EnergyParams.h:41
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
Returns the adapted acceleration value, useful for comparing with external PHEMlight references.
static const int PHEMLIGHT5_BASE
HelpersPHEMlight5()
Constructor.
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...
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...
PHEMlightdllV5::CEPHandler myCEPHandler
std::map< SUMOEmissionClass, PHEMlightdllV5::CEP * > myCEPs
PHEMlightdllV5::Correction * myCorrection
double getEmission(PHEMlightdllV5::CEP *currCep, const std::string &e, const double p, const double v) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
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.