/****************************************************************************/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 RODFDetFlowLoader.h14/// @author Daniel Krajzewicz15/// @author Eric Nicolay16/// @author Michael Behrisch17/// @date Thu, 16.03.200618///19// A loader for detector flows20/****************************************************************************/21#pragma once22#include <config.h>2324#include <string>25#include <vector>26#include <utils/importio/NamedColumnsParser.h>27#include <utils/common/UtilExceptions.h>28#include "RODFDetector.h"29#include "RODFDetectorFlow.h"303132// ===========================================================================33// class definitions34// ===========================================================================35/**36* @class RODFDetFlowLoader37* @brief A loader for detector flows38*/39class RODFDetFlowLoader {40public:41/** @brief Constructor42*43* @param[in] dets Definitions of known detectors44* @param[in, filled] into Container to store read values into45* @param[in] startTime The first time step for which values shall be read46* @param[in] endTime The last time step for which values shall be read47* @param[in] timeOffset The offset which shall be applied to the read times48*/49RODFDetFlowLoader(const RODFDetectorCon& dets, RODFDetectorFlows& into,50SUMOTime startTime, SUMOTime endTime,51SUMOTime timeOffset, SUMOTime timeScale);525354/// @brief Destructor55~RODFDetFlowLoader();565758/** @brief Reads the given file assuming it contains detector values59*60* Reads the first line, first, and parses it assuming it contains61* the names of the columns that follow within the next lines.62*63* Then, the rest of the file is read and the read values for vehicle/heavy vehicle64* amounts and speeds are stored into "myStorage". Values that lie65* before "myStartTime" and behind "myEndTime" as well as values66* which refer to an unknown detector are omitted.67*68* @param[in] file The name of the file to read69* @exception IOError Not yet implemented!70* @exception ProcessError Thrown if a value could not be parsed properly or a needed value is missing71*/72void read(const std::string& file);737475private:76/// @brief The container for read detector values77RODFDetectorFlows& myStorage;7879/// @brief The time offset to apply to read time values80const SUMOTime myTimeOffset;8182/// @brief The time scale to apply to read time values83const SUMOTime myTimeScale;8485/// @brief The first and the last time step to read86const SUMOTime myStartTime, myEndTime;8788/// @brief The value extractor89NamedColumnsParser myLineHandler;9091/// @brief Container holding known detectors92const RODFDetectorCon& myDetectorContainer;9394/// @brief Whether a warning about overriding boundaries was already written95bool myHaveWarnedAboutOverridingBoundaries;9697/// @brief Whether a warning about partial definitions was already written98bool myHaveWarnedAboutPartialDefs;99100101private:102/// @brief Invalidated copy constructor103RODFDetFlowLoader(const RODFDetFlowLoader& src);104105/// @brief Invalidated assignment operator106RODFDetFlowLoader& operator=(const RODFDetFlowLoader& src);107108};109110111