Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMultiEntryExitDetector.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-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/****************************************************************************/
18// multi entry-exit (E3) detector
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
35
53 GNEMultiEntryExitDetector(const std::string& id, GNENet* net, FileBucket* fileBucket, const Position pos, const SUMOTime freq, const std::string& outputFilename,
54 const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,
55 const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const bool openEntry,
56 const bool expectedArrival, const Parameterised::Map& parameters);
57
60
63
65 GNEMoveElement* getMoveElement() const override;
66
68 Parameterised* getParameters() override;
69
71 const Parameterised* getParameters() const override;
72
74
77
81 void writeAdditional(OutputDevice& device) const override;
82
84 bool isAdditionalValid() const override;
85
87 std::string getAdditionalProblem() const override;
88
90 void fixAdditionalProblem() override;
91
93
96
98 bool checkDrawMoveContour() const override;
99
101
104
106 void updateGeometry() override;
107
109 Position getPositionInView() const override;
110
112 void updateCenteringBoundary(const bool updateGrid) override;
113
115 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
116
118
121
124 std::string getParentName() const override;
125
130 void drawGL(const GUIVisualizationSettings& s) const override;
131
133
136
137 /* @brief method for getting the Attribute of an XML key
138 * @param[in] key The attribute key
139 * @return string with the value associated to key
140 */
141 std::string getAttribute(SumoXMLAttr key) const override;
142
143 /* @brief method for getting the Attribute of an XML key in double format
144 * @param[in] key The attribute key
145 * @return double with the value associated to key
146 */
147 double getAttributeDouble(SumoXMLAttr key) const override;
148
149 /* @brief method for getting the Attribute of an XML key in position format
150 * @param[in] key The attribute key
151 * @return position with the value associated to key
152 */
153 Position getAttributePosition(SumoXMLAttr key) const override;
154
155 /* @brief method for getting the Attribute of an XML key in positionVector format
156 * @param[in] key The attribute key
157 * @return positionVector with the value associated to key
158 */
160
161 /* @brief method for setting the attribute and letting the object perform additional changes
162 * @param[in] key The attribute key
163 * @param[in] value The new value
164 * @param[in] undoList The undoList on which to register changes
165 */
166 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
167
168 /* @brief method for checking if the key and their conrrespond attribute are valids
169 * @param[in] key The attribute key
170 * @param[in] value The value associated to key key
171 * @return true if the value is valid, false in other case
172 */
173 bool isValid(SumoXMLAttr key, const std::string& value) override;
174
176 std::string getPopUpID() const override;
177
179 std::string getHierarchyName() const override;
180
182
183protected:
186
188 std::string myOutputFilename;
189
191 std::vector<std::string> myVehicleTypes;
192
194 std::vector<std::string> myNextEdges;
195
197 std::string myDetectPersons;
198
201
204
206 bool myOpenEntry = false;
207
209 bool myExpectedArrival = false;
210
211private:
213 bool checkChildAdditionalRestriction() const override;
214
216 void setAttribute(SumoXMLAttr key, const std::string& value) override;
217
220
223};
long long int SUMOTime
Definition GUI.h:36
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool myExpectedArrival
flag for enable/disable expected arrival
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
GNEMultiEntryExitDetector & operator=(const GNEMultiEntryExitDetector &)=delete
Invalidated assignment operator.
std::vector< std::string > myNextEdges
next edges
double getAttributeDouble(SumoXMLAttr key) const override
std::vector< std::string > myVehicleTypes
attribute vehicle types
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getParentName() const override
Returns the name of the parent object.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
std::string myOutputFilename
fielname of E3 detector
SUMOTime myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
GNEMultiEntryExitDetector(const GNEMultiEntryExitDetector &)=delete
Invalidated copy constructor.
Parameterised * getParameters() override
get parameters associated with this multiEntryExitDetector
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string myDetectPersons
detect persons
~GNEMultiEntryExitDetector()
GNEMultiEntryExitDetector Destructor.
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getAttribute(SumoXMLAttr key) const override
bool checkDrawMoveContour() const override
check if draw move contour (red)
SUMOTime myPeriod
period of E3 detector
void updateGeometry() override
update pre-computed geometry information
bool checkChildAdditionalRestriction() const override
check restriction with the number of children
bool myOpenEntry
@brie open entry
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this multiEntryExitDetector
Position getPositionInView() const override
Returns position of additional in view.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Position getAttributePosition(SumoXMLAttr key) const override
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.