Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // missing_desc
17 /****************************************************************************/
18 #ifndef RODFDetectorFlow_h
19 #define RODFDetectorFlow_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <utils/common/SUMOTime.h>
28 #include <map>
29 #include <string>
30 #include <vector>
31 
32 
33 // ===========================================================================
34 // struct definitions
35 // ===========================================================================
40 struct FlowDef {
41  // Number of passenger vehicles that passed within the described time
42  double qPKW;
43  // Number of heavy duty vehicles that passed within the described time
44  double qLKW;
45  // Mean velocity of passenger vehicles within the described time
46  double vPKW;
47  // Mean velocity of heavy duty vehicles within the described time
48  double vLKW;
49  // begin time (in s)
50 // int time;
51  // probability for having a heavy duty vehicle(qKFZ!=0 ? (qLKW / qKFZ) : 0;)
52  double fLKW;
53  // initialise with 0
54  mutable double isLKW;
55  //
56  bool firstSet;
57 };
58 
59 
60 // ===========================================================================
61 // class definitions
62 // ===========================================================================
68 public:
69  RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime,
70  SUMOTime stepOffset);
72  void addFlow(const std::string& detector_id, SUMOTime timestamp,
73  const FlowDef& fd);
74  void removeFlow(const std::string& detector_id);
75  void setFlows(const std::string& detector_id, std::vector<FlowDef>&);
76 
77  const std::vector<FlowDef>& getFlowDefs(const std::string& id) const;
78  bool knows(const std::string& det_id) const;
79  double getFlowSumSecure(const std::string& id) const;
80  double getMaxDetectorFlow() const;
81  void printAbsolute() const;
82 
83  void mesoJoin(const std::string& nid, const std::vector<std::string>& oldids);
84 
85 protected:
86  std::map<std::string, std::vector<FlowDef> > myFastAccessFlows;
88  mutable double myMaxDetectorFlow;
89 
90 private:
93 
96 
97 };
98 
99 
100 #endif
101 
102 /****************************************************************************/
103 
RODFDetectorFlows
A container for flows.
Definition: RODFDetectorFlow.h:67
RODFDetectorFlows::operator=
RODFDetectorFlows & operator=(const RODFDetectorFlows &src)
Invalidated assignment operator.
FlowDef::fLKW
double fLKW
Definition: RODFDetectorFlow.h:52
SUMOTime.h
RODFDetectorFlows::myFastAccessFlows
std::map< std::string, std::vector< FlowDef > > myFastAccessFlows
Definition: RODFDetectorFlow.h:86
RODFDetectorFlows::RODFDetectorFlows
RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset)
Definition: RODFDetectorFlow.cpp:34
FlowDef::qLKW
double qLKW
Definition: RODFDetectorFlow.h:44
RODFDetectorFlows::getFlowSumSecure
double getFlowSumSecure(const std::string &id) const
Definition: RODFDetectorFlow.cpp:119
RODFDetectorFlows::printAbsolute
void printAbsolute() const
Definition: RODFDetectorFlow.cpp:172
RODFDetectorFlows::removeFlow
void removeFlow(const std::string &detector_id)
Definition: RODFDetectorFlow.cpp:99
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
RODFDetectorFlows::getMaxDetectorFlow
double getMaxDetectorFlow() const
Definition: RODFDetectorFlow.cpp:133
RODFDetectorFlows::knows
bool knows(const std::string &det_id) const
Definition: RODFDetectorFlow.cpp:105
FlowDef::firstSet
bool firstSet
Definition: RODFDetectorFlow.h:56
RODFDetectorFlows::RODFDetectorFlows
RODFDetectorFlows(const RODFDetectorFlows &src)
Invalidated copy constructor.
fd
static double fd[10]
Definition: odrSpiral.cpp:94
RODFDetectorFlows::setFlows
void setFlows(const std::string &detector_id, std::vector< FlowDef > &)
Definition: RODFDetectorFlow.cpp:84
FlowDef
Definition of the traffic during a certain time containing the flows and speeds.
Definition: RODFDetectorFlow.h:40
FlowDef::qPKW
double qPKW
Definition: RODFDetectorFlow.h:42
FlowDef::vPKW
double vPKW
Definition: RODFDetectorFlow.h:46
RODFDetectorFlows::myMaxDetectorFlow
double myMaxDetectorFlow
Definition: RODFDetectorFlow.h:88
FlowDef::vLKW
double vLKW
Definition: RODFDetectorFlow.h:48
RODFDetectorFlows::myBeginTime
SUMOTime myBeginTime
Definition: RODFDetectorFlow.h:87
RODFDetectorFlows::myStepOffset
SUMOTime myStepOffset
Definition: RODFDetectorFlow.h:87
FlowDef::isLKW
double isLKW
Definition: RODFDetectorFlow.h:54
RODFDetectorFlows::myEndTime
SUMOTime myEndTime
Definition: RODFDetectorFlow.h:87
RODFDetectorFlows::~RODFDetectorFlows
~RODFDetectorFlows()
Definition: RODFDetectorFlow.cpp:40
RODFDetectorFlows::getFlowDefs
const std::vector< FlowDef > & getFlowDefs(const std::string &id) const
Definition: RODFDetectorFlow.cpp:111
config.h
RODFDetectorFlows::addFlow
void addFlow(const std::string &detector_id, SUMOTime timestamp, const FlowDef &fd)
Definition: RODFDetectorFlow.cpp:44
RODFDetectorFlows::mesoJoin
void mesoJoin(const std::string &nid, const std::vector< std::string > &oldids)
Definition: RODFDetectorFlow.cpp:155