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
HelpersHBEFA3.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// Helper methods for HBEFA3-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 HelpersHBEFA3_h
22
#define HelpersHBEFA3_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
HelpersHBEFA3
:
public
PollutantsInterface::Helper
{
55
public
:
56
57
58
static
const
int
HBEFA3_BASE
= 1 << 16;
59
60
63
HelpersHBEFA3
();
64
65
74
SUMOEmissionClass
getClass
(
const
SUMOEmissionClass
base,
const
std::string& vClass,
const
std::string& fuel,
const
std::string& eClass,
const
double
weight)
const
;
75
80
std::string
getAmitranVehicleClass
(
const
SUMOEmissionClass
c)
const
;
81
86
std::string
getFuel
(
const
SUMOEmissionClass
c)
const
;
87
92
int
getEuroClass
(
const
SUMOEmissionClass
c)
const
;
93
94
108
inline
SUMOReal
compute
(
const
SUMOEmissionClass
c,
const
PollutantsInterface::EmissionType
e,
const
double
v,
const
double
a,
const
double
slope)
const
{
109
UNUSED_PARAMETER
(slope);
110
if
(c ==
HBEFA3_BASE
|| a < 0.) {
111
return
0.;
112
}
113
const
int
index = (c & ~
PollutantsInterface
::HEAVY_BIT) -
HBEFA3_BASE
- 1;
114
SUMOReal
scale = 3.6;
115
if
(e ==
PollutantsInterface::FUEL
) {
116
if
(
getFuel
(c) ==
"Diesel"
) {
117
scale *= 836.;
118
}
else
{
119
scale *= 742.;
120
}
121
}
122
const
double
* f =
myFunctionParameter
[index][e];
123
return
(
SUMOReal
)
MAX2
((f[0] + f[1] * a * v + f[2] * a * a * v + f[3] * v + f[4] * v * v + f[5] * v * v * v) / scale, 0.);
124
}
125
126
127
private
:
129
static
double
myFunctionParameter
[45][6][6];
130
131
};
132
133
134
#endif
135
136
/****************************************************************************/
137
tmp
buildd
sumo-0.21.0+dfsg
src
utils
emissions
HelpersHBEFA3.h
Generated on Thu Nov 20 2014 19:49:54 for SUMO - Simulation of Urban MObility by
1.8.1.2