Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/data/GNEMeanDataHandler.h
193871 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 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
/****************************************************************************/
14
/// @file GNEMeanDataHandler.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Nov 22
17
///
18
// Builds meanData objects for netedit
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/handlers/MeanDataHandler.h>
24
25
// ===========================================================================
26
// class declarations
27
// ===========================================================================
28
29
class GNENet;
30
class GNEEdge;
31
32
// ===========================================================================
33
// class definitions
34
// ===========================================================================
35
36
class GNEMeanDataHandler : public MeanDataHandler {
37
38
public:
39
/// @brief Constructor
40
GNEMeanDataHandler(GNENet* net, FileBucket* fileBucket, const bool allowUndoRedo);
41
42
/// @brief Destructor
43
virtual ~GNEMeanDataHandler();
44
45
/// @name build functions
46
/// @{
47
48
/// @brief Builds edgeMeanData
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
57
/// @brief Builds laneMeanData
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
66
/// @}
67
68
protected:
69
/// @brief pointer to GNENet
70
GNENet* myNet;
71
72
/// @brief allow undo/redo
73
const bool myAllowUndoRedo;
74
75
/// @brief parse edges
76
std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::vector<std::string>& edgeIDs);
77
78
/// @brief parse attributes
79
std::vector<SumoXMLAttr> parseAttributes(const SumoXMLTag tag, const std::vector<std::string>& attrStrs);
80
81
/// @brief check if given ID correspond to a duplicated mean data element
82
bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string& id);
83
84
/// @brief check if given excludeEmpty is valid
85
bool checkExcludeEmpty(const SumoXMLTag tag, const std::string& id, const std::string& excludeEmpty);
86
87
/// @brief check if given excludeEmpty is valid
88
bool checkDetectPersons(const SumoXMLTag tag, const std::string& id, const std::vector<std::string>& detectPersons);
89
90
private:
91
/// @brief invalidate default onstructor
92
GNEMeanDataHandler() = delete;
93
94
/// @brief invalidate copy constructor
95
GNEMeanDataHandler(const GNEMeanDataHandler& s) = delete;
96
97
/// @brief invalidate assignment operator
98
GNEMeanDataHandler& operator=(const GNEMeanDataHandler& s) = delete;
99
};
100
101