Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/dfrouter/RODFDetectorFlow.h
169666 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file RODFDetectorFlow.h
15
/// @author Daniel Krajzewicz
16
/// @author Eric Nicolay
17
/// @author Michael Behrisch
18
/// @date Thu, 16.03.2006
19
///
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
// ===========================================================================
34
/**
35
* @class FlowDef
36
* @brief Definition of the traffic during a certain time containing the flows and speeds
37
*/
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
// ===========================================================================
61
/**
62
* @class RODFDetectorFlows
63
* @brief A container for flows
64
*/
65
class RODFDetectorFlows {
66
public:
67
RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime,
68
SUMOTime stepOffset);
69
~RODFDetectorFlows();
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;
85
SUMOTime myBeginTime, myEndTime, myStepOffset;
86
mutable double myMaxDetectorFlow;
87
88
private:
89
/// @brief Invalidated copy constructor
90
RODFDetectorFlows(const RODFDetectorFlows& src);
91
92
/// @brief Invalidated assignment operator
93
RODFDetectorFlows& operator=(const RODFDetectorFlows& src);
94
95
};
96
97