SUMO - Simulation of Urban MObility
RODFDetectorFlow.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // missing_desc
20 /****************************************************************************/
21 #ifndef RODFDetectorFlow_h
22 #define RODFDetectorFlow_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <utils/common/SUMOTime.h>
35 #include <map>
36 #include <string>
37 #include <vector>
38 
39 
40 // ===========================================================================
41 // struct definitions
42 // ===========================================================================
47 struct FlowDef {
48  // Number of passenger vehicles that passed within the described time
49  double qPKW;
50  // Number of heavy duty vehicles that passed within the described time
51  double qLKW;
52  // Mean velocity of passenger vehicles within the described time
53  double vPKW;
54  // Mean velocity of heavy duty vehicles within the described time
55  double vLKW;
56  // begin time (in s)
57 // int time;
58  // probability for having a heavy duty vehicle(qKFZ!=0 ? (qLKW / qKFZ) : 0;)
59  double fLKW;
60  // initialise with 0
61  mutable double isLKW;
62  //
63  bool firstSet;
64 };
65 
66 
67 // ===========================================================================
68 // class definitions
69 // ===========================================================================
75 public:
76  RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime,
77  SUMOTime stepOffset);
79  void addFlow(const std::string& detector_id, SUMOTime timestamp,
80  const FlowDef& fd);
81  void removeFlow(const std::string& detector_id);
82  void setFlows(const std::string& detector_id, std::vector<FlowDef>&);
83 
84  const std::vector<FlowDef>& getFlowDefs(const std::string& id) const;
85  bool knows(const std::string& det_id) const;
86  double getFlowSumSecure(const std::string& id) const;
87  double getMaxDetectorFlow() const;
88  void printAbsolute() const;
89 
90  void mesoJoin(const std::string& nid, const std::vector<std::string>& oldids);
91 
92 protected:
93  std::map<std::string, std::vector<FlowDef> > myFastAccessFlows;
94  SUMOTime myBeginTime, myEndTime, myStepOffset;
95  mutable double myMaxDetectorFlow;
96 
97 private:
100 
102  RODFDetectorFlows& operator=(const RODFDetectorFlows& src);
103 
104 };
105 
106 
107 #endif
108 
109 /****************************************************************************/
110 
double fLKW
std::map< std::string, std::vector< FlowDef > > myFastAccessFlows
static double fd[10]
Definition: odrSpiral.cpp:94
A container for flows.
double vPKW
double vLKW
Definition of the traffic during a certain time containing the flows and speeds.
double qPKW
double isLKW
double qLKW
long long int SUMOTime
Definition: TraCIDefs.h:51