SUMO - Simulation of Urban MObility
 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>
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
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 
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,
71 
72  void writeXMLEmissions(const std::string id,
73  const SUMOEmissionClass c,
74  const SUMOTime t, const SUMOReal v,
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;
103  std::map<std::string, SUMOReal> myLastV;
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:
113 
116 
117 
118 };
119 
120 
121 #endif
122 
123 /****************************************************************************/
124