Path: blob/main/src/netedit/elements/data/GNEMeanDataHandler.h
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 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// ===========================================================================3435/// @class GNEMeanDataHandler36class GNEMeanDataHandler : public MeanDataHandler {3738public:39/// @brief Constructor40GNEMeanDataHandler(GNENet* net, const std::string& filename, const bool allowUndoRedo);4142/// @brief Destructor43virtual ~GNEMeanDataHandler();4445/// @brief run post parser tasks46bool postParserTasks();4748/// @name build functions49/// @{50/// @brief Builds edgeMeanData51bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,52const std::string& file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles,53const std::vector<std::string>& writtenAttributes, const bool aggregate, const std::vector<std::string>& edgeIDs,54const std::string& edgeFile, std::string excludeEmpty, const bool withInternal,55const std::vector<std::string>& detectPersons, const double minSamples, const double maxTravelTime,56const std::vector<std::string>& vTypes, const double speedThreshold);5758/// @brief Builds laneMeanData59bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id,60const std::string& file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles,61const std::vector<std::string>& writtenAttributes, const bool aggregate, const std::vector<std::string>& edgeIDs,62const std::string& edgeFile, std::string excludeEmpty, const bool withInternal,63const std::vector<std::string>& detectPersons, const double minSamples, const double maxTravelTime,64const std::vector<std::string>& vTypes, const double speedThreshold);6566/// @}6768protected:69/// @brief pointer to GNENet70GNENet* myNet;7172/// @brief allow undo/redo73const bool myAllowUndoRedo;7475/// @brief parse edges76std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::vector<std::string>& edgeIDs);7778/// @brief parse attributes79std::vector<SumoXMLAttr> parseAttributes(const SumoXMLTag tag, const std::vector<std::string>& attrStrs);8081/// @brief check if given ID correspond to a duplicated mean data element82bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string& id);8384/// @brief check if given excludeEmpty is valid85bool checkExcludeEmpty(const SumoXMLTag tag, const std::string& id, const std::string& excludeEmpty);8687private:88/// @brief invalidate default onstructor89GNEMeanDataHandler() = delete;9091/// @brief invalidate copy constructor92GNEMeanDataHandler(const GNEMeanDataHandler& s) = delete;9394/// @brief invalidate assignment operator95GNEMeanDataHandler& operator=(const GNEMeanDataHandler& s) = delete;96};979899