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 /****************************************************************************/
9 // Network state mean data collector for edges/lanes
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSMeanData_Net_h
23 #define MSMeanData_Net_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
36 #include <set>
37 #include <limits>
38 #include "MSMeanData.h"
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class OutputDevice;
45 class MSEdgeControl;
46 class MSEdge;
47 class MSLane;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
64 class MSMeanData_Net : public MSMeanData {
65 public:
74  public:
78  MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd,
79  const std::set<std::string>* const vTypes = 0,
80  const MSMeanData_Net* parent = 0);
81 
83  virtual ~MSLaneMeanDataValues();
84 
87  void reset(bool afterWrite = false);
88 
93  void addTo(MSMeanData::MeanDataValues& val) const;
94 
97 
107  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason);
108 
109 
125 
126  bool isEmpty() const;
127 
135  void write(OutputDevice& dev, const SUMOTime period,
136  const SUMOReal numLanes, const SUMOReal defaultTravelTime,
137  const int numVehicles = -1) const;
138 
139  protected:
150  void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane,
151  SUMOReal speed);
152 
153  public:
157  unsigned nVehDeparted;
158 
160  unsigned nVehArrived;
161 
163  unsigned nVehEntered;
164 
166  unsigned nVehLeft;
167 
169  unsigned nVehVaporized;
170 
173 
174  private:
177 
180 
181 
185 
188 
189  };
190 
191 
192 public:
208  MSMeanData_Net(const std::string& id,
209  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
210  const bool useLanes, const bool withEmpty, const bool printDefaults,
211  const bool withInternal, const bool trackVehicles,
212  const SUMOReal maxTravelTime, const SUMOReal minSamples,
213  const SUMOReal haltSpeed, const std::set<std::string> vTypes);
214 
215 
217  virtual ~MSMeanData_Net();
218 
219 protected:
225  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const;
226 
232  void resetOnly(SUMOTime stopTime);
233 
234 private:
237 
240 
243 
244 };
245 
246 
247 #endif
248 
249 /****************************************************************************/
250 
Data collector for edges/lanes.
Definition: MSMeanData.h:66
virtual ~MSLaneMeanDataValues()
Destructor.
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const std::set< std::string > *const vTypes=0, const MSMeanData_Net *parent=0)
Constructor.
void write(OutputDevice &dev, const SUMOTime period, const SUMOReal numLanes, const SUMOReal defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
unsigned nVehVaporized
The number of vehicles that left this lane within the sample interval.
void resetOnly(SUMOTime stopTime)
Resets network value in order to allow processing of the next interval.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
Notification
Definition of a vehicle state.
const MSMeanData_Net * myParent
The meandata parent.
MSMeanData_Net(const std::string &id, const SUMOTime dumpBegin, const SUMOTime dumpEnd, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const SUMOReal maxTravelTime, const SUMOReal minSamples, const SUMOReal haltSpeed, const std::set< std::string > vTypes)
Constructor.
unsigned nVehLaneChangeFrom
The number of vehicles that changed from this lane.
MSMeanData_Net & operator=(const MSMeanData_Net &)
Invalidated assignment operator.
Data structure for mean (aggregated) edge/lane values.
SUMOReal waitSeconds
The number of vehicle probes with small speed.
A road/street connecting two junctions.
Definition: MSEdge.h:73
SUMOReal vehLengthSum
The sum of the lengths the vehicles had.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes current values and adds them to their sums.
Representation of a vehicle.
Definition: SUMOVehicle.h:63
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:75
void notifyMoveInternal(SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
Internal notification about the vehicle moves.
unsigned nVehArrived
The number of vehicles that finished on the lane.
unsigned nVehLaneChangeTo
The number of vehicles that changed to this lane.
unsigned nVehEntered
The number of vehicles that entered this lane within the sample interval.
virtual ~MSMeanData_Net()
Destructor.
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:73
bool isEmpty() const
Returns whether any data was collected.
const SUMOReal myHaltSpeed
the minimum sample seconds
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Called if the vehicle leaves the reminder&#39;s lane.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
unsigned nVehLeft
The number of vehicles that left this lane within the sample interval.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
Network state mean data collector for edges/lanes.
#define SUMOReal
Definition: config.h:215
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77