Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/guinetload/GUIDetectorBuilder.h
169665 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 GUIDetectorBuilder.h
15
/// @author Daniel Krajzewicz
16
/// @author Michael Behrisch
17
/// @date Tue, 22 Jul 2003
18
///
19
// Builds detectors for guisim
20
/****************************************************************************/
21
#pragma once
22
#include <config.h>
23
24
#include <string>
25
#include <netload/NLDetectorBuilder.h>
26
27
28
// ===========================================================================
29
// class declarations
30
// ===========================================================================
31
class MSNet;
32
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
37
/**
38
* @class GUIDetectorBuilder
39
* @brief Builds detectors for guisim
40
*
41
* This class overrides NLDetectorBuilder's detector creation methods in order
42
* to build guisim-classes instead of microsim-classes.
43
*
44
* @see NLDetectorBuilder
45
*/
46
class GUIDetectorBuilder : public NLDetectorBuilder {
47
public:
48
/** @brief Constructor
49
*
50
* @param[in] net The network to which's detector control built detector shall be added
51
*/
52
GUIDetectorBuilder(MSNet& net);
53
54
55
/// @brief Destructor
56
~GUIDetectorBuilder();
57
58
59
/// @name Detector creating methods
60
///
61
/// Override NLDetectorBuilder methods.
62
/// @{
63
64
/** @brief Creates an instance of an e1 detector using the given values
65
*
66
* Simply calls the GUIInductLoop constructor
67
*
68
* @param[in] id The id the detector shall have
69
* @param[in] lane The lane the detector is placed at
70
* @param[in] pos The position on the lane the detector is placed at
71
* @param[in] length The optional length of the detector
72
* @param[in] vTypes which vehicle types are considered
73
* @param[in] show Whether to show the detector in the gui if available
74
*/
75
virtual MSDetectorFileOutput* createInductLoop(const std::string& id,
76
MSLane* lane, double pos, double length,
77
const std::string name, const std::string& vTypes,
78
const std::string& nextEdges,
79
int detectPersons,
80
bool show) override;
81
82
83
/** @brief Creates an instance of an e1 detector using the given values
84
*
85
* Simply calls the MSInductLoop constructor
86
*
87
* @param[in] id The id the detector shall have
88
* @param[in] lane The lane the detector is placed at
89
* @param[in] pos The position on the lane the detector is placed at
90
* @param[in] od The output device the loop shall use
91
*/
92
virtual MSDetectorFileOutput* createInstantInductLoop(const std::string& id,
93
MSLane* lane, double pos, const std::string& od, const std::string name,
94
const std::string& vTypes, const std::string& nextEdges) override;
95
96
/** @brief Creates a GUIE2Collector instance, overrides MSE2Collector::createE2Detector()
97
*
98
* Simply calls the GUIE2Collector constructor
99
*
100
* @see GUIE2Collector Constructor documentation
101
*/
102
virtual MSE2Collector* createE2Detector(const std::string& id,
103
DetectorUsage usage, MSLane* lane, double pos, double endPos, double length,
104
SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
105
const std::string name, const std::string& vTypes,
106
const std::string& nextEdges,
107
int detectPersons, bool showDetector) override;
108
109
virtual MSE2Collector* createE2Detector(const std::string& id,
110
DetectorUsage usage, std::vector<MSLane*> lanes, double pos, double endPos,
111
SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
112
const std::string name, const std::string& vTypes,
113
const std::string& nextEdges,
114
int detectPersons, bool showDetector) override;
115
116
117
/** @brief Creates an instance of an e3 detector using the given values
118
*
119
* Simply calls the GUIE3Collector constructor.
120
*
121
* @param[in] id The id the detector shall have
122
* @param[in] entries The list of this detector's entries
123
* @param[in] exits The list of this detector's exits
124
* @param[in] haltingSpeedThreshold Detector parameter: the speed a vehicle's speed must be below to be assigned as jammed
125
* @param[in] haltingTimeThreshold Detector parameter: the time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed
126
*/
127
virtual MSDetectorFileOutput* createE3Detector(const std::string& id,
128
const CrossSectionVector& entries,
129
const CrossSectionVector& exits,
130
double haltingSpeedThreshold,
131
SUMOTime haltingTimeThreshold,
132
const std::string name, const std::string& vTypes,
133
const std::string& nextEdges,
134
int detectPersons, bool openEntry, bool expectArrival) override;
135
/// @}
136
137
138
};
139
140