Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMeanDataHandler.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// Builds meanData objects for netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
29class GNENet;
30class GNEEdge;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
37
38public:
40 GNEMeanDataHandler(GNENet* net, FileBucket* fileBucket, const bool allowUndoRedo);
41
43 virtual ~GNEMeanDataHandler();
44
47
49 bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,
50 const std::string& file, const std::string& type, const SUMOTime period, const SUMOTime begin,
51 const SUMOTime end, const bool trackVehicles, const std::vector<std::string>& writtenAttributes,
52 const bool aggregate, const std::vector<std::string>& edgeIDs, const std::string& edgeFile,
53 const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,
54 const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes,
55 const double speedThreshold);
56
58 bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,
59 const std::string& file, const std::string& type, const SUMOTime period, const SUMOTime begin,
60 const SUMOTime end, const bool trackVehicles, const std::vector<std::string>& writtenAttributes,
61 const bool aggregate, const std::vector<std::string>& edgeIDs, const std::string& edgeFile,
62 const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,
63 const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes,
64 const double speedThreshold);
65
67
68protected:
71
73 const bool myAllowUndoRedo;
74
76 std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::vector<std::string>& edgeIDs);
77
79 std::vector<SumoXMLAttr> parseAttributes(const SumoXMLTag tag, const std::vector<std::string>& attrStrs);
80
82 bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string& id);
83
85 bool checkExcludeEmpty(const SumoXMLTag tag, const std::string& id, const std::string& excludeEmpty);
86
87private:
90
93
96};
long long int SUMOTime
Definition GUI.h:36
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEMeanDataHandler(const GNEMeanDataHandler &s)=delete
invalidate copy constructor
std::vector< SumoXMLAttr > parseAttributes(const SumoXMLTag tag, const std::vector< std::string > &attrStrs)
parse attributes
bool checkExcludeEmpty(const SumoXMLTag tag, const std::string &id, const std::string &excludeEmpty)
check if given excludeEmpty is valid
GNEMeanDataHandler()=delete
invalidate default onstructor
bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &file, const std::string &type, const SUMOTime period, const SUMOTime begin, const SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edgeIDs, const std::string &edgeFile, const std::string &excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)
Builds edgeMeanData.
bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string &id)
check if given ID correspond to a duplicated mean data element
virtual ~GNEMeanDataHandler()
Destructor.
const bool myAllowUndoRedo
allow undo/redo
bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &file, const std::string &type, const SUMOTime period, const SUMOTime begin, const SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edgeIDs, const std::string &edgeFile, const std::string &excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)
Builds laneMeanData.
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::vector< std::string > &edgeIDs)
parse edges
GNEMeanDataHandler & operator=(const GNEMeanDataHandler &s)=delete
invalidate assignment operator
GNENet * myNet
pointer to GNENet