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, FileBucket* fileBucket);
35
37 GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, FileBucket* fileBucket, 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
71 FileBucket* getFileBucket() const override;
72
76 void writeMeanData(OutputDevice& device) const;
77
79 void updateGeometry() override;
80
83
86
88 bool checkDrawFromContour() const override;
89
91 bool checkDrawToContour() const override;
92
94 bool checkDrawRelatedContour() const override;
95
97 bool checkDrawOverContour() const override;
98
100 bool checkDrawDeleteContour() const override;
101
103 bool checkDrawDeleteContourSmall() const override;
104
106 bool checkDrawSelectContour() const override;
107
109 bool checkDrawMoveContour() const override;
110
112
115 /* @brief method for getting the Attribute of an XML key
116 * @param[in] key The attribute key
117 * @return string with the value associated to key
118 */
119 std::string getAttribute(SumoXMLAttr key) const override;
120
121 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
122 * @param[in] key The attribute key
123 * @return double with the value associated to key
124 */
125 double getAttributeDouble(SumoXMLAttr key) const override;
126
127 /* @brief method for getting the Attribute of an XML key in position format
128 * @param[in] key The attribute key
129 * @return position with the value associated to key
130 */
131 Position getAttributePosition(SumoXMLAttr key) const override;
132
133 /* @brief method for getting the Attribute of an XML key in positionVector format
134 * @param[in] key The attribute key
135 * @return positionVector with the value associated to key
136 */
138
144 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
145
151 bool isValid(SumoXMLAttr key, const std::string& value) override;
152
154 std::string getPopUpID() const override;
155
157 std::string getHierarchyName() const override;
159
160protected:
162 std::string myID;
163
165 std::string myFile;
166
168 std::string myType;
169
172
175
178
180 bool myTrackVehicles = false;
181
183 std::vector<SumoXMLAttr> myWrittenAttributes;
184
186 bool myAggregate = false;
187
189 std::vector<std::string> myEdges;
190
192 std::string myEdgeFile;
193
195 std::string myExcludeEmpty;
196
198 bool myWithInternal = false;
199
201 std::vector<std::string> myDetectPersons;
202
204 double myMinSamples = 0;
205
207 double myMaxTravelTime = 0;
208
210 std::vector<std::string> myVTypes;
211
214
215private:
217 void setAttribute(SumoXMLAttr key, const std::string& value) override;
218
220 GNEMeanData(const GNEMeanData&) = delete;
221
224};
225
226/****************************************************************************/
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.
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
double myMaxTravelTime
max travel time
~GNEMeanData()
Destructor.
void writeMeanData(OutputDevice &device) const
write meanData element into a xml file
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.