SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSMeanData_Net.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Network state mean data collector for edges/lanes
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSMeanData_Net_h
24 #define MSMeanData_Net_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <vector>
37 #include <set>
38 #include <limits>
39 #include "MSMeanData.h"
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class OutputDevice;
46 class MSEdgeControl;
47 class MSEdge;
48 class MSLane;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
65 class MSMeanData_Net : public MSMeanData {
66 public:
75  public:
79  MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd,
80  const std::set<std::string>* const vTypes = 0,
81  const MSMeanData_Net* parent = 0);
82 
84  virtual ~MSLaneMeanDataValues();
85 
88  void reset(bool afterWrite = false);
89 
94  void addTo(MSMeanData::MeanDataValues& val) const;
95 
98 
108  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason);
109 
110 
126 
127  bool isEmpty() const;
128 
136  void write(OutputDevice& dev, const SUMOTime period,
137  const SUMOReal numLanes, const SUMOReal defaultTravelTime,
138  const int numVehicles = -1) const;
139 
140  protected:
151  void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane,
152  SUMOReal speed);
153 
154  public:
158  unsigned nVehDeparted;
159 
161  unsigned nVehArrived;
162 
164  unsigned nVehEntered;
165 
167  unsigned nVehLeft;
168 
170  unsigned nVehVaporized;
171 
174 
175  private:
178 
181 
182 
186 
189 
190  };
191 
192 
193 public:
209  MSMeanData_Net(const std::string& id,
210  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
211  const bool useLanes, const bool withEmpty, const bool printDefaults,
212  const bool withInternal, const bool trackVehicles,
213  const SUMOReal maxTravelTime, const SUMOReal minSamples,
214  const SUMOReal haltSpeed, const std::set<std::string> vTypes);
215 
216 
218  virtual ~MSMeanData_Net();
219 
220 protected:
226  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const;
227 
233  void resetOnly(SUMOTime stopTime);
234 
235 private:
238 
241 
244 
245 };
246 
247 
248 #endif
249 
250 /****************************************************************************/
251