Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2002-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 : /****************************************************************************/
14 : /// @file HelpersMMPEVEM.h
15 : /// @author Kevin Badalian (badalian_k@mmp.rwth-aachen.de)
16 : /// @date 2021-10
17 : ///
18 : // The MMP's emission model for electric vehicles.
19 : // If you use this model for academic research, you are highly encouraged to
20 : // cite our paper "Accurate physics-based modeling of electric vehicle energy
21 : // consumption in the SUMO traffic microsimulator"
22 : // (DOI: 10.1109/ITSC48978.2021.9564463).
23 : // Teaching and Research Area Mechatronics in Mobile Propulsion (MMP), RWTH Aachen
24 : /****************************************************************************/
25 :
26 :
27 : #pragma once
28 :
29 :
30 : #include <utils/emissions/PollutantsInterface.h>
31 : #include <utils/emissions/EnergyParams.h>
32 :
33 : #include <map>
34 :
35 :
36 :
37 :
38 : /**
39 : * \class HelpersMMPEVEM
40 : * \brief This helper class allows the PollutantsInterface to load and use
41 : * different MMPEVEMs.
42 : */
43 : class HelpersMMPEVEM : public PollutantsInterface::Helper {
44 : private:
45 : static const int MMPEVEM_BASE = 5 << 16;
46 :
47 :
48 : public:
49 : /**
50 : * \brief Constructor
51 : */
52 : HelpersMMPEVEM();
53 :
54 : /** @brief Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...)
55 : * @param[in] c the emission class
56 : * @return always "Electricity"
57 : */
58 30 : std::string getFuel(const SUMOEmissionClass /* c */) const {
59 30 : return "Electricity";
60 : }
61 :
62 : /** @brief Returns a reference weight in kg described by this emission class
63 : * This implementation returns the default mass for this model.
64 : * @param[in] c the emission class
65 : * @return a reference weight
66 : */
67 5280 : double getWeight(const SUMOEmissionClass /* c */) const {
68 5280 : return 1794.;
69 : }
70 :
71 : /**
72 : * \brief Compute the amount of emitted pollutants for an emission class in a
73 : * given state.
74 : *
75 : * This method returns 0 for all emission types but electric power
76 : * consumption.
77 : *
78 : * \param[in] c An emission class
79 : * \param[in] e An emission type
80 : * \param[in] v Current vehicle velocity [m/s]
81 : * \param[in] a Current acceleration of the vehicle [m/s^2]
82 : * \param[in] slope Slope of the road at the vehicle's current position [deg]
83 : *
84 : * \returns The electric power consumption [Wh/s] or 0 for all other emission
85 : * types
86 : */
87 : double compute(const SUMOEmissionClass /* c */,
88 : const PollutantsInterface::EmissionType e, const double v,
89 : const double a, const double slope,
90 : const EnergyParams* ptr_energyParams) const;
91 : };
|