LCOV - code coverage report
Current view: top level - src/utils/emissions - HelpersHarmonoise.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 100.0 % 1 1
Test Date: 2024-12-21 15:45:41 Functions: - 0 0

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2001-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    HelpersHarmonoise.h
      15              : /// @author  Daniel Krajzewicz
      16              : /// @author  Michael Behrisch
      17              : /// @date    Mon, 10.05.2004
      18              : ///
      19              : // Helper methods for Harmonoise-based noise emission computation
      20              : /****************************************************************************/
      21              : #pragma once
      22              : #include <config.h>
      23              : 
      24              : #include <vector>
      25              : #include <limits>
      26              : #include <cmath>
      27              : #include <utils/common/StdDefs.h>
      28              : #include <utils/common/SUMOVehicleClass.h>
      29              : 
      30              : 
      31              : // ===========================================================================
      32              : // class definitions
      33              : // ===========================================================================
      34              : /**
      35              :  * @class HelpersHarmonoise
      36              :  * @brief Helper methods for Harmonoise-based noise emission computation
      37              :  *
      38              :  * The stored values compute the recepted noise of either passenger or heavy
      39              :  *  duty vehicles for a distance of 10m from the noise source.
      40              :  */
      41              : class HelpersHarmonoise {
      42              : public:
      43              :     /** @brief Returns the noise produced by the a vehicle of the given type at the given speed
      44              :      *
      45              :      * @param[in] c The vehicle emission class
      46              :      * @param[in] v The vehicle's current velocity
      47              :      * @param[in] a The vehicle's current acceleration
      48              :      * @return The noise produced by the vehicle of the given class running with v and a
      49              :      */
      50              :     static double computeNoise(SUMOEmissionClass c, double v, double a);
      51              : 
      52              : 
      53              :     /** @brief Computes the resulting noise
      54              :      *
      55              :      * @param[in] val The sum of converted vehicle noises ( pow(10., (<NOISE>/10.)) )
      56              :      * @return The resulting sum
      57              :      */
      58              :     inline static double sum(double val) {
      59          385 :         return double(10. * log10(val));
      60              :     }
      61              : 
      62              : 
      63              : private:
      64              :     /// @name vehicle class noise emission coefficients
      65              :     /// @{
      66              : 
      67              :     /// @brief rolling component, light vehicles, alpha
      68              :     static double myR_A_C1_Parameter[27];
      69              : 
      70              :     /// @brief rolling component, light vehicles, beta
      71              :     static double myR_B_C1_Parameter[27];
      72              : 
      73              :     /// @brief rolling component, heavy vehicles, alpha
      74              :     static double myR_A_C3_Parameter[27];
      75              : 
      76              :     /// @brief rolling component, heavy vehicles, beta
      77              :     static double myR_B_C3_Parameter[27];
      78              : 
      79              :     /// @brief traction component, light vehicles, alpha
      80              :     static double myT_A_C1_Parameter[27];
      81              : 
      82              :     /// @brief traction component, light vehicles, beta
      83              :     static double myT_B_C1_Parameter[27];
      84              : 
      85              :     /// @brief traction component, heavy vehicles, alpha
      86              :     static double myT_A_C3_Parameter[27];
      87              : 
      88              :     /// @brief traction component, heavy vehicles, beta
      89              :     static double myT_B_C3_Parameter[27];
      90              :     /// @}
      91              : 
      92              :     /// @brief A-weighted correction for octave bands
      93              :     static const double myAOctaveBandCorrection[27];
      94              : 
      95              :     /// @brief A-weighted correction for surface
      96              :     static const double mySurfaceCorrection[27];
      97              : };
        

Generated by: LCOV version 2.0-1