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
TrajectoriesHandler.h
Go to the documentation of this file.
1
/****************************************************************************/
7
// An XML-Handler for amitran and netstate trajectories
8
/****************************************************************************/
9
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10
// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors
11
/****************************************************************************/
12
//
13
// This file is part of SUMO.
14
// SUMO is free software: you can redistribute it and/or modify
15
// it under the terms of the GNU General Public License as published by
16
// the Free Software Foundation, either version 3 of the License, or
17
// (at your option) any later version.
18
//
19
/****************************************************************************/
20
#ifndef TrajectoriesHandler_h
21
#define TrajectoriesHandler_h
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
#ifdef _MSC_VER
28
#include <
windows_config.h
>
29
#else
30
#include <
config.h
>
31
#endif
32
33
#include <string>
34
#include <utility>
35
#include <
utils/xml/SUMOSAXHandler.h
>
36
37
38
// ===========================================================================
39
// class definitions
40
// ===========================================================================
47
class
TrajectoriesHandler
:
public
SUMOSAXHandler
{
48
public
:
49
static
const
int
INVALID_VALUE
= -999999;
50
51
public
:
56
TrajectoriesHandler
(
const
bool
computeA,
const
SUMOEmissionClass
defaultClass,
57
const
SUMOReal
defaultSlope,
OutputDevice
* xmlOut);
58
59
61
~TrajectoriesHandler
();
62
63
const
PollutantsInterface::Emissions
computeEmissions
(
const
std::string
id
,
64
const
SUMOEmissionClass
c,
const
SUMOReal
v,
65
SUMOReal
& a,
SUMOReal
& s);
66
67
void
writeEmissions
(std::ostream& o,
const
std::string
id
,
68
const
SUMOEmissionClass
c,
69
const
SUMOReal
t,
const
SUMOReal
v,
70
SUMOReal
a =
INVALID_VALUE
,
SUMOReal
s =
INVALID_VALUE
);
71
72
void
writeXMLEmissions
(
const
std::string
id
,
73
const
SUMOEmissionClass
c,
74
const
SUMOTime
t,
const
SUMOReal
v,
75
SUMOReal
a =
INVALID_VALUE
,
SUMOReal
s =
INVALID_VALUE
);
76
77
void
writeSums
(std::ostream& o,
const
std::string
id
);
78
79
80
protected
:
82
83
93
void
myStartElement
(
int
element,
94
const
SUMOSAXAttributes
& attrs);
96
97
98
private
:
99
const
bool
myComputeA
;
100
const
SUMOEmissionClass
myDefaultClass
;
101
const
SUMOReal
myDefaultSlope
;
102
OutputDevice
*
myXMLOut
;
103
std::map<std::string, SUMOReal>
myLastV
;
104
SUMOTime
myCurrentTime
;
105
std::map<std::string, PollutantsInterface::Emissions>
mySums
;
106
std::map<std::string, SUMOEmissionClass>
myEmissionClassByType
;
107
std::map<std::string, SUMOEmissionClass>
myEmissionClassByVehicle
;
108
109
110
private
:
112
TrajectoriesHandler
(
const
TrajectoriesHandler
& s);
113
115
TrajectoriesHandler
&
operator=
(
const
TrajectoriesHandler
& s);
116
117
118
};
119
120
121
#endif
122
123
/****************************************************************************/
124
tmp
buildd
sumo-0.21.0+dfsg
src
tools
TrajectoriesHandler.h
Generated on Thu Nov 20 2014 19:49:59 for SUMO - Simulation of Urban MObility by
1.8.1.2