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, const std::string& filename, const bool allowUndoRedo);
41
43 virtual ~GNEMeanDataHandler();
44
46 bool postParserTasks();
47
50
52 bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,
53 const std::string& file, const std::string& type, const SUMOTime period, const SUMOTime begin,
54 const SUMOTime end, const bool trackVehicles, const std::vector<std::string>& writtenAttributes,
55 const bool aggregate, const std::vector<std::string>& edgeIDs, const std::string& edgeFile,
56 const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,
57 const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes,
58 const double speedThreshold);
59
61 bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,
62 const std::string& file, const std::string& type, const SUMOTime period, const SUMOTime begin,
63 const SUMOTime end, const bool trackVehicles, const std::vector<std::string>& writtenAttributes,
64 const bool aggregate, const std::vector<std::string>& edgeIDs, const std::string& edgeFile,
65 const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,
66 const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes,
67 const double speedThreshold);
68
70
71protected:
74
76 const bool myAllowUndoRedo;
77
79 std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::vector<std::string>& edgeIDs);
80
82 std::vector<SumoXMLAttr> parseAttributes(const SumoXMLTag tag, const std::vector<std::string>& attrStrs);
83
85 bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string& id);
86
88 bool checkExcludeEmpty(const SumoXMLTag tag, const std::string& id, const std::string& excludeEmpty);
89
90private:
93
96
99};
long long int SUMOTime
Definition GUI.h:36
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEMeanDataHandler(const GNEMeanDataHandler &s)=delete
invalidate copy constructor
bool postParserTasks()
run post parser tasks
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
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42