Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMeanData.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// Class for representing MeanData
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
34 GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, const std::string& filename);
35
37 GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, const std::string& filename, const std::string& file,
38 const std::string& type, const SUMOTime period, const SUMOTime begin, const SUMOTime end,
39 const bool trackVehicles, const std::vector<SumoXMLAttr>& writtenAttributes, const bool aggregate,
40 const std::vector<std::string>& edges, const std::string& edgeFile, const std::string& excludeEmpty,
41 const bool withInternal, const std::vector<std::string>& detectPersons, const double minSamples,
42 const double maxTravelTime, const std::vector<std::string>& vTypes, const double speedThreshold);
43
46
49
52
54 GNEMoveElement* getMoveElement() const override;
55
57 Parameterised* getParameters() override;
58
60 const Parameterised* getParameters() const override;
61
63 GUIGlObject* getGUIGlObject() override;
64
66 const GUIGlObject* getGUIGlObject() const override;
67
69
73 void writeMeanData(OutputDevice& device) const;
74
76 void updateGeometry() override;
77
80
83
85 bool checkDrawFromContour() const override;
86
88 bool checkDrawToContour() const override;
89
91 bool checkDrawRelatedContour() const override;
92
94 bool checkDrawOverContour() const override;
95
97 bool checkDrawDeleteContour() const override;
98
100 bool checkDrawDeleteContourSmall() const override;
101
103 bool checkDrawSelectContour() const override;
104
106 bool checkDrawMoveContour() const override;
107
109
112 /* @brief method for getting the Attribute of an XML key
113 * @param[in] key The attribute key
114 * @return string with the value associated to key
115 */
116 std::string getAttribute(SumoXMLAttr key) const override;
117
118 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
119 * @param[in] key The attribute key
120 * @return double with the value associated to key
121 */
122 double getAttributeDouble(SumoXMLAttr key) const override;
123
124 /* @brief method for getting the Attribute of an XML key in position format
125 * @param[in] key The attribute key
126 * @return position with the value associated to key
127 */
128 Position getAttributePosition(SumoXMLAttr key) const override;
129
130 /* @brief method for getting the Attribute of an XML key in positionVector format
131 * @param[in] key The attribute key
132 * @return positionVector with the value associated to key
133 */
135
141 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
142
148 bool isValid(SumoXMLAttr key, const std::string& value) override;
149
151 std::string getPopUpID() const override;
152
154 std::string getHierarchyName() const override;
156
157protected:
159 std::string myID;
160
162 std::string myFile;
163
165 std::string myType;
166
169
172
175
177 bool myTrackVehicles = false;
178
180 std::vector<SumoXMLAttr> myWrittenAttributes;
181
183 bool myAggregate = false;
184
186 std::vector<std::string> myEdges;
187
189 std::string myEdgeFile;
190
192 std::string myExcludeEmpty;
193
195 bool myWithInternal = false;
196
198 std::vector<std::string> myDetectPersons;
199
201 double myMinSamples = 0;
202
204 double myMaxTravelTime = 0;
205
207 std::vector<std::string> myVTypes;
208
211
212private:
214 void setAttribute(SumoXMLAttr key, const std::string& value) override;
215
217 GNEMeanData(const GNEMeanData&) = delete;
218
221};
222
223/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOTime myBegin
begin
double myMinSamples
minSamples
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this meanData
std::string myExcludeEmpty
exclude empty
std::string myEdgeFile
edge file
void updateGeometry() override
update pre-computed geometry information
Parameterised * getParameters() override
get parameters associated with this meanData
SUMOTime myEnd
end
bool myAggregate
whether the data for all edges shall be aggregated
bool checkDrawMoveContour() const override
check if draw move contour (red)
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::vector< std::string > myDetectPersons
detect persons
std::vector< std::string > myVTypes
VTypes.
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
std::string getAttribute(SumoXMLAttr key) const override
SUMOTime myPeriod
period
std::vector< SumoXMLAttr > myWrittenAttributes
bit mask for checking attributes to be written
std::string myFile
filename
std::string myID
id
double mySpeedThreshold
speed threshold
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
std::vector< std::string > myEdges
list of edges
GNEMeanData(const GNEMeanData &)=delete
Invalidated copy constructor.
bool checkDrawToContour() const override
check if draw from contour (magenta)
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this meanData
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
bool myWithInternal
width internal
bool myTrackVehicles
Whether vehicles are tracked.
bool checkDrawOverContour() const override
check if draw over contour (orange)
bool isValid(SumoXMLAttr key, const std::string &value) override
method for checking if the key and their conrrespond attribute are valids
std::string myType
type
double getAttributeDouble(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
method for setting the attribute and letting the object perform data set changes
GNEMoveElement * getMoveElement() const override
get GNEMoveElement associated with this meanData
bool checkDrawSelectContour() const override
check if draw select contour (blue)
Position getAttributePosition(SumoXMLAttr key) const override
bool checkDrawFromContour() const override
check if draw from contour (green)
GNEMeanData & operator=(const GNEMeanData &)=delete
Invalidated assignment operator.
Position getPositionInView() const
Returns element position in view.
double myMaxTravelTime
max travel time
~GNEMeanData()
Destructor.
void writeMeanData(OutputDevice &device) const
write meanData element into a xml file
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.