LCOV - code coverage report
Current view: top level - src/utils/emissions - HelpersMMPEVEM.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 2 2 100.0 %
Date: 2024-05-04 15:27:10 Functions: 1 1 100.0 %

          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             :     /**
      63             :      * \brief Compute the amount of emitted pollutants for an emission class in a
      64             :      *        given state.
      65             :      *
      66             :      * This method returns 0 for all emission types but electric power
      67             :      * consumption.
      68             :      *
      69             :      * \param[in] c An emission class
      70             :      * \param[in] e An emission type
      71             :      * \param[in] v Current vehicle velocity [m/s]
      72             :      * \param[in] a Current acceleration of the vehicle [m/s^2]
      73             :      * \param[in] slope Slope of the road at the vehicle's current position [deg]
      74             :      *
      75             :      * \returns The electric power consumption [Wh/s] or 0 for all other emission
      76             :      *          types
      77             :      */
      78             :     double compute(const SUMOEmissionClass /* c */,
      79             :                    const PollutantsInterface::EmissionType e, const double v,
      80             :                    const double a, const double slope,
      81             :                    const EnergyParams* ptr_energyParams) const;
      82             : };

Generated by: LCOV version 1.14