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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // missing_desc
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <utils/common/SUMOTime.h>
26 #include <map>
27 #include <string>
28 #include <vector>
29 
30 
31 // ===========================================================================
32 // struct definitions
33 // ===========================================================================
38 struct FlowDef {
39  // Number of passenger vehicles that passed within the described time
40  double qPKW;
41  // Number of heavy duty vehicles that passed within the described time
42  double qLKW;
43  // Mean velocity of passenger vehicles within the described time
44  double vPKW;
45  // Mean velocity of heavy duty vehicles within the described time
46  double vLKW;
47  // begin time (in s)
48 // int time;
49  // probability for having a heavy duty vehicle(qKFZ!=0 ? (qLKW / qKFZ) : 0;)
50  double fLKW;
51  // initialise with 0
52  mutable double isLKW;
53  //
54  bool firstSet;
55 };
56 
57 
58 // ===========================================================================
59 // class definitions
60 // ===========================================================================
66 public:
67  RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime,
68  SUMOTime stepOffset);
70  void addFlow(const std::string& detector_id, SUMOTime timestamp,
71  const FlowDef& fd);
72  void removeFlow(const std::string& detector_id);
73  void setFlows(const std::string& detector_id, std::vector<FlowDef>&);
74 
75  const std::vector<FlowDef>& getFlowDefs(const std::string& id) const;
76  bool knows(const std::string& det_id) const;
77  double getFlowSumSecure(const std::string& id) const;
78  double getMaxDetectorFlow() const;
79  void printAbsolute() const;
80 
81  void mesoJoin(const std::string& nid, const std::vector<std::string>& oldids);
82 
83 protected:
84  std::map<std::string, std::vector<FlowDef> > myFastAccessFlows;
86  mutable double myMaxDetectorFlow;
87 
88 private:
91 
94 
95 };
long long int SUMOTime
Definition: GUI.h:35
A container for flows.
double getFlowSumSecure(const std::string &id) const
void setFlows(const std::string &detector_id, std::vector< FlowDef > &)
RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset)
std::map< std::string, std::vector< FlowDef > > myFastAccessFlows
RODFDetectorFlows(const RODFDetectorFlows &src)
Invalidated copy constructor.
void addFlow(const std::string &detector_id, SUMOTime timestamp, const FlowDef &fd)
RODFDetectorFlows & operator=(const RODFDetectorFlows &src)
Invalidated assignment operator.
void mesoJoin(const std::string &nid, const std::vector< std::string > &oldids)
const std::vector< FlowDef > & getFlowDefs(const std::string &id) const
void removeFlow(const std::string &detector_id)
double getMaxDetectorFlow() const
void printAbsolute() const
bool knows(const std::string &det_id) const
static double fd[10]
Definition: odrSpiral.cpp:99
Definition of the traffic during a certain time containing the flows and speeds.
double vPKW
double isLKW
double vLKW
double fLKW
double qLKW
double qPKW