SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
HelpersHBEFA.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// Helper methods for HBEFA-based emission computation
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11
// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12
/****************************************************************************/
13
//
14
// This file is part of SUMO.
15
// SUMO is free software: you can redistribute it and/or modify
16
// it under the terms of the GNU General Public License as published by
17
// the Free Software Foundation, either version 3 of the License, or
18
// (at your option) any later version.
19
//
20
/****************************************************************************/
21
#ifndef HelpersHBEFA_h
22
#define HelpersHBEFA_h
23
24
25
// ===========================================================================
26
// included modules
27
// ===========================================================================
28
#ifdef _MSC_VER
29
#include <
windows_config.h
>
30
#else
31
#include <
config.h
>
32
#endif
33
34
#include <vector>
35
#include <limits>
36
#include <cmath>
37
#include <
utils/common/StdDefs.h
>
38
#include <
utils/geom/GeomHelper.h
>
39
#include <
utils/common/SUMOVehicleClass.h
>
40
#include "
PollutantsInterface.h
"
41
42
43
// ===========================================================================
44
// class definitions
45
// ===========================================================================
54
class
HelpersHBEFA
:
public
PollutantsInterface::Helper
{
55
public
:
58
HelpersHBEFA
();
59
60
74
inline
SUMOReal
compute
(
const
SUMOEmissionClass
c,
const
PollutantsInterface::EmissionType
e,
const
double
v,
const
double
a,
const
double
slope)
const
{
75
UNUSED_PARAMETER
(slope);
76
if
(c ==
PollutantsInterface::ZERO_EMISSIONS
) {
77
return
0.;
78
}
79
const
int
index = (c & ~
PollutantsInterface
::HEAVY_BIT) - 1;
80
const
SUMOReal
kmh = v * 3.6;
81
const
SUMOReal
scale = (e ==
PollutantsInterface::FUEL
) ? 3.6 * 790. : 3.6;
82
if
(index >= 42) {
83
const
double
* f =
myFunctionParameter
[index - 42] + 6 * e;
84
return
(
SUMOReal
)
MAX2
((f[0] + f[3] * kmh + f[4] * kmh * kmh + f[5] * kmh * kmh * kmh) / scale, 0.);
85
}
86
if
(a < 0.) {
87
return
0.;
88
}
89
const
double
* f =
myFunctionParameter
[index] + 6 * e;
90
const
double
alpha = asin(a / 9.81) * 180. /
M_PI
;
91
return
(
SUMOReal
)
MAX2
((f[0] + f[1] * alpha * kmh + f[2] * alpha * alpha * kmh + f[3] * kmh + f[4] * kmh * kmh + f[5] * kmh * kmh * kmh) / scale, 0.);
92
}
93
94
95
private
:
97
static
double
myFunctionParameter
[42][36];
98
99
};
100
101
102
#endif
103
104
/****************************************************************************/
105
tmp
buildd
sumo-0.21.0+dfsg
src
utils
emissions
HelpersHBEFA.h
Generated on Thu Nov 20 2014 19:49:54 for SUMO - Simulation of Urban MObility by
1.8.1.2