Path: blob/main/src/utils/vehicle/SUMORouteLoaderControl.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2002-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 SUMORouteLoaderControl.h14/// @author Daniel Krajzewicz15/// @author Sascha Krieg16/// @author Michael Behrisch17/// @author Jakob Erdmann18/// @date Wed, 06 Nov 200219///20// Class responsible for loading of routes from some files21/****************************************************************************/22#pragma once23#include <config.h>2425#include <vector>262728// ===========================================================================29// class declarations30// ===========================================================================31class SUMORouteLoader;3233// ===========================================================================34// class definitions35// ===========================================================================36/**37* @class SUMORouteLoaderControl38*39* SUMORouteLoaderControl40* This controls is initialised with the list of route loaders and uses them41* to load routes step wise.42* The parameter myInAdvanceStepNo holds the number of time steps to read the43* routes in forward. If it is 0 (default), all routes will be read at once.44*/45class SUMORouteLoaderControl {46public:47/// @brief constructor48SUMORouteLoaderControl(SUMOTime inAdvanceStepNo);4950/// @brief destructor51~SUMORouteLoaderControl();5253/// @brief add another loader54void add(SUMORouteLoader* loader);5556/// @brief loads the next routes up to and including the given time step57void loadNext(SUMOTime step);5859/// @brief returns the timestamp of the first loaded vehicle or flow60SUMOTime getFirstLoadTime() const {61return myFirstLoadTime;62}6364/// @brief returns whether loading is completed65bool haveAllLoaded() const {66return myAllLoaded;67}6869/// @brief return a route loader70SUMORouteLoader* getFirstLoader() const;7172private:73/// @brief the first time step for which vehicles were loaded74SUMOTime myFirstLoadTime;7576/// @brief the time step up to which vehicles were loaded77SUMOTime myCurrentLoadTime;7879/// @brief the number of routes to read in forward80const SUMOTime myInAdvanceStepNo;8182/// @brief the list of route loaders83std::vector<SUMORouteLoader*> myRouteLoaders;8485/// @brief information whether all routes shall be loaded and whether they were loaded86bool myLoadAll, myAllLoaded;8788private:89/// @brief Invalidated copy constructor90SUMORouteLoaderControl(const SUMORouteLoaderControl& src);9192/// @brief Invalidated assignment operator93SUMORouteLoaderControl& operator=(const SUMORouteLoaderControl& src);94};959697