Eclipse SUMO - Simulation of Urban MObility
HelpersEnergy.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 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 HBEFA-based 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/geom/GeomHelper.h>
30 #include "PollutantsInterface.h"
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 private:
42  static const int ENERGY_BASE = 4 << 16;
43 
44 public:
47  HelpersEnergy();
48 
49 
61  double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map<int, double>* param) const;
62 
72  double acceleration(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double P, const double slope, const std::map<int, double>* param) const;
73 
74  double getDefaultParam(int paramKey) const {
75  return myDefaultParameter.find(paramKey)->second;
76  }
77 
78 
79 private:
81  std::map<int, double> myDefaultParameter;
82 };
int SUMOEmissionClass
Helper methods for energy-based electricity consumption computation based on the battery device.
Definition: HelpersEnergy.h:40
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param) const
Computes the emitted pollutant amount using the given speed and acceleration.
std::map< int, double > myDefaultParameter
The default parameter.
Definition: HelpersEnergy.h:81
HelpersEnergy()
Constructor (initializes myEmissionClassStrings)
double acceleration(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double P, const double slope, const std::map< int, double > *param) const
Computes the achievable acceleration using the given speed and amount of consumed electric power.
static const int ENERGY_BASE
Definition: HelpersEnergy.h:42
double getDefaultParam(int paramKey) const
Definition: HelpersEnergy.h:74
zero emission model, used as superclass for the other model helpers
EmissionType
Enumerating all emission types, including fuel.