Path: blob/main/src/netedit/elements/data/GNEMeanDataHandler.h
193871 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEMeanDataHandler.h14/// @author Pablo Alvarez Lopez15/// @date Nov 2216///17// Builds meanData objects for netedit18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/handlers/MeanDataHandler.h>2324// ===========================================================================25// class declarations26// ===========================================================================2728class GNENet;29class GNEEdge;3031// ===========================================================================32// class definitions33// ===========================================================================3435class GNEMeanDataHandler : public MeanDataHandler {3637public:38/// @brief Constructor39GNEMeanDataHandler(GNENet* net, FileBucket* fileBucket, const bool allowUndoRedo);4041/// @brief Destructor42virtual ~GNEMeanDataHandler();4344/// @name build functions45/// @{4647/// @brief Builds edgeMeanData48bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,49const std::string& file, const std::string& type, const SUMOTime period, const SUMOTime begin,50const SUMOTime end, const bool trackVehicles, const std::vector<std::string>& writtenAttributes,51const bool aggregate, const std::vector<std::string>& edgeIDs, const std::string& edgeFile,52const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,53const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes,54const double speedThreshold);5556/// @brief Builds laneMeanData57bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,58const std::string& file, const std::string& type, const SUMOTime period, const SUMOTime begin,59const SUMOTime end, const bool trackVehicles, const std::vector<std::string>& writtenAttributes,60const bool aggregate, const std::vector<std::string>& edgeIDs, const std::string& edgeFile,61const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,62const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes,63const double speedThreshold);6465/// @}6667protected:68/// @brief pointer to GNENet69GNENet* myNet;7071/// @brief allow undo/redo72const bool myAllowUndoRedo;7374/// @brief parse edges75std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::vector<std::string>& edgeIDs);7677/// @brief parse attributes78std::vector<SumoXMLAttr> parseAttributes(const SumoXMLTag tag, const std::vector<std::string>& attrStrs);7980/// @brief check if given ID correspond to a duplicated mean data element81bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string& id);8283/// @brief check if given excludeEmpty is valid84bool checkExcludeEmpty(const SumoXMLTag tag, const std::string& id, const std::string& excludeEmpty);8586/// @brief check if given excludeEmpty is valid87bool checkDetectPersons(const SumoXMLTag tag, const std::string& id, const std::vector<std::string>& detectPersons);8889private:90/// @brief invalidate default onstructor91GNEMeanDataHandler() = delete;9293/// @brief invalidate copy constructor94GNEMeanDataHandler(const GNEMeanDataHandler& s) = delete;9596/// @brief invalidate assignment operator97GNEMeanDataHandler& operator=(const GNEMeanDataHandler& s) = delete;98};99100101