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-2023 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 void updateGeometry();
59
62
65 /* @brief method for getting the Attribute of an XML key
66 * @param[in] key The attribute key
67 * @return string with the value associated to key
68 */
69 std::string getAttribute(SumoXMLAttr key) const;
70
71 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
72 * @param[in] key The attribute key
73 * @return double with the value associated to key
74 */
75 double getAttributeDouble(SumoXMLAttr key) const;
76
82 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
83
89 bool isValid(SumoXMLAttr key, const std::string& value);
90
92 std::string getPopUpID() const;
93
95 std::string getHierarchyName() const;
97
100
101protected:
103 std::string myID;
104
106 std::string myFile;
107
110
113
116
118 bool myTrackVehicles = false;
119
121 std::vector<SumoXMLAttr> myWrittenAttributes;
122
124 bool myAggregate = false;
125
127 std::vector<std::string> myEdges;
128
130 std::string myEdgeFile;
131
133 std::string myExcludeEmpty;
134
136 bool myWithInternal = false;
137
139 std::vector<std::string> myDetectPersons;
140
142 double myMinSamples = 0;
143
145 double myMaxTravelTime = 0;
146
148 std::vector<std::string> myVTypes;
149
152
153private:
155 void setAttribute(SumoXMLAttr key, const std::string& value);
156
158 GNEMeanData(const GNEMeanData&) = delete;
159
162};
163
164/****************************************************************************/
165
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
SUMOTime myEnd
end
bool myAggregate
whether the data for all edges shall be aggregated
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)
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)
std::string getAttribute(SumoXMLAttr key) const
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37