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-2024 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
24
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
34
35public:
37 GNEMeanData(GNENet* net, SumoXMLTag tag, const std::string& id);
38
40 GNEMeanData(GNENet* net, SumoXMLTag tag, std::string ID, std::string file, SUMOTime period,
41 SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector<SumoXMLAttr>& writtenAttributes,
42 const bool aggregate, const std::vector<std::string>& edges, const std::string& edgeFile,
43 std::string excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,
44 const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes, const double speedThreshold);
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 checkDrawSelectContour() const;
86
88 bool checkDrawMoveContour() const;
89
91
94 /* @brief method for getting the Attribute of an XML key
95 * @param[in] key The attribute key
96 * @return string with the value associated to key
97 */
98 std::string getAttribute(SumoXMLAttr key) const;
99
100 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
101 * @param[in] key The attribute key
102 * @return double with the value associated to key
103 */
104 double getAttributeDouble(SumoXMLAttr key) const;
105
111 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
112
118 bool isValid(SumoXMLAttr key, const std::string& value);
119
121 std::string getPopUpID() const;
122
124 std::string getHierarchyName() const;
126
129
130protected:
132 std::string myID;
133
135 std::string myFile;
136
139
142
145
147 bool myTrackVehicles = false;
148
150 std::vector<SumoXMLAttr> myWrittenAttributes;
151
153 bool myAggregate = false;
154
156 std::vector<std::string> myEdges;
157
159 std::string myEdgeFile;
160
162 std::string myExcludeEmpty;
163
165 bool myWithInternal = false;
166
168 std::vector<std::string> myDetectPersons;
169
171 double myMinSamples = 0;
172
174 double myMaxTravelTime = 0;
175
177 std::vector<std::string> myVTypes;
178
181
182private:
184 void setAttribute(SumoXMLAttr key, const std::string& value);
185
187 GNEMeanData(const GNEMeanData&) = delete;
188
191};
192
193/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
Definition GNEMeanData.h:33
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 checkDrawFromContour() const
check if draw from contour (green)
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37