Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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, const SUMOTime period,
38 const SUMOTime begin, const SUMOTime end, const bool trackVehicles, const std::vector<SumoXMLAttr>& writtenAttributes,
39 const bool aggregate, const std::vector<std::string>& edges, const std::string& edgeFile,
40 const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,
41 const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes, const double speedThreshold);
42
45
48
52 void writeMeanData(OutputDevice& device) const;
53
56
58 const GUIGlObject* getGUIGlObject() const;
59
61 void updateGeometry();
62
65
68
70 bool checkDrawFromContour() const;
71
73 bool checkDrawToContour() const;
74
76 bool checkDrawRelatedContour() const;
77
79 bool checkDrawOverContour() const;
80
82 bool checkDrawDeleteContour() const;
83
85 bool checkDrawDeleteContourSmall() const;
86
88 bool checkDrawSelectContour() const;
89
91 bool checkDrawMoveContour() const;
92
94
97 /* @brief method for getting the Attribute of an XML key
98 * @param[in] key The attribute key
99 * @return string with the value associated to key
100 */
101 std::string getAttribute(SumoXMLAttr key) const;
102
103 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
104 * @param[in] key The attribute key
105 * @return double with the value associated to key
106 */
107 double getAttributeDouble(SumoXMLAttr key) const;
108
114 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
115
121 bool isValid(SumoXMLAttr key, const std::string& value);
122
124 std::string getPopUpID() const;
125
127 std::string getHierarchyName() const;
129
132
133protected:
135 std::string myID;
136
138 std::string myFile;
139
142
145
148
150 bool myTrackVehicles = false;
151
153 std::vector<SumoXMLAttr> myWrittenAttributes;
154
156 bool myAggregate = false;
157
159 std::vector<std::string> myEdges;
160
162 std::string myEdgeFile;
163
165 std::string myExcludeEmpty;
166
168 bool myWithInternal = false;
169
171 std::vector<std::string> myDetectPersons;
172
174 double myMinSamples = 0;
175
177 double myMaxTravelTime = 0;
178
180 std::vector<std::string> myVTypes;
181
184
185private:
187 void setAttribute(SumoXMLAttr key, const std::string& value);
188
190 GNEMeanData(const GNEMeanData&) = delete;
191
194};
195
196/****************************************************************************/
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
std::string myExcludeEmpty
exclude empty
std::string myEdgeFile
edge file
bool checkDrawOverContour() const
check if draw over contour (orange)
SUMOTime myEnd
end
bool myAggregate
whether the data for all edges shall be aggregated
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
bool checkDrawSelectContour() const
check if draw select contour (blue)
std::vector< std::string > myDetectPersons
detect persons
std::vector< std::string > myVTypes
VTypes.
const Parameterised::Map & getACParametersMap() const
get parameters map
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
SUMOTime myPeriod
period
std::vector< SumoXMLAttr > myWrittenAttributes
bit mask for checking attributes to be written
std::string myFile
filename
double getAttributeDouble(SumoXMLAttr key) const
std::string myID
id
double mySpeedThreshold
speed threshold
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::vector< std::string > myEdges
list of edges
GNEMeanData(const GNEMeanData &)=delete
Invalidated copy constructor.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool checkDrawDeleteContourSmall() const
check if draw delete contour small (pink/white)
bool checkDrawFromContour() const
check if draw from contour (green)
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
void updateGeometry()
update pre-computed geometry information
bool myWithInternal
width internal
bool myTrackVehicles
Whether vehicles are tracked.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool checkDrawToContour() const
check if draw from contour (magenta)
std::string getAttribute(SumoXMLAttr key) const
GNEMeanData & operator=(const GNEMeanData &)=delete
Invalidated assignment operator.
Position getPositionInView() const
Returns element position in view.
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
bool checkDrawMoveContour() const
check if draw move contour (red)
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37