SUMO - Simulation of Urban MObility
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.dlr.de/
13 // Copyright (C) 2004-2016 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 MSMeanData_Net* parent);
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:
143  void notifyMoveInternal(const SUMOVehicle& veh, const SUMOReal frontOnLane, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane);
144 
145  public:
150 
153 
156 
158  int nVehLeft;
159 
162 
165 
166  private:
169 
172 
175 
178 
182 
185 
186  };
187 
188 
189 public:
205  MSMeanData_Net(const std::string& id,
206  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
207  const bool useLanes, const bool withEmpty, const bool printDefaults,
208  const bool withInternal, const bool trackVehicles,
209  const SUMOReal maxTravelTime, const SUMOReal minSamples,
210  const SUMOReal haltSpeed, const std::string& vTypes);
211 
212 
214  virtual ~MSMeanData_Net();
215 
216 protected:
222  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const;
223 
229  void resetOnly(SUMOTime stopTime);
230 
231 private:
234 
237 
240 
241 };
242 
243 
244 #endif
245 
246 /****************************************************************************/
247 
Data collector for edges/lanes.
Definition: MSMeanData.h:67
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
virtual ~MSLaneMeanDataValues()
Destructor.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
long long int SUMOTime
Definition: SUMOTime.h:43
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const MSMeanData_Net *parent)
Constructor.
int 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.
Notification
Definition of a vehicle state.
const MSMeanData_Net * myParent
The meandata parent.
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.
SUMOReal frontSampleSeconds
The number of vehicle probes regarding the vehicle front.
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:80
int nVehLaneChangeTo
The number of vehicles that changed to this lane.
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:66
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:76
virtual ~MSMeanData_Net()
Destructor.
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:74
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.
int nVehLeft
The number of vehicles that left this lane within the sample interval.
int nVehArrived
The number of vehicles that finished on the lane.
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::string &vTypes)
Constructor.
SUMOReal frontTravelledDistance
The travelled distance regarding the vehicle front.
int nVehLaneChangeFrom
The number of vehicles that changed from this lane.
MSMoveReminder & operator=(const MSMoveReminder &)
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
bool isEmpty() const
Returns whether any data was collected.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
Network state mean data collector for edges/lanes.
#define SUMOReal
Definition: config.h:213
void notifyMoveInternal(const SUMOVehicle &veh, const SUMOReal frontOnLane, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves.
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:79