/****************************************************************************/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 MSEdgeWeightsStorage.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date 02.11.200917///18// A storage for edge travel times and efforts19/****************************************************************************/20#pragma once21#include <config.h>2223#include <utils/common/ValueTimeLine.h>242526// ===========================================================================27// class declarations28// ===========================================================================29class MSEdge;30class SUMOVehicle;313233// ===========================================================================34// class definitions35// ===========================================================================36/**37* @class MSEdgeWeightsStorage38* @brief A storage for edge travel times and efforts39*/40class MSEdgeWeightsStorage {41public:42/// @brief Constructor43MSEdgeWeightsStorage();444546/// @brief Destructor47~MSEdgeWeightsStorage();484950/** @brief Returns a travel time for an edge and time if stored51* @param[in] e The edge for which the travel time shall be retrieved52* @param[in] t The time for which the travel time shall be retrieved53* @param[in] value The value if the requested edge/time is described54* @return Whether the requested edge/time is described55*/56bool retrieveExistingTravelTime(const MSEdge* const e, const double t, double& value) const;575859/** @brief Returns an effort for an edge and time if stored60* @param[in] e The edge for which the effort shall be retrieved61* @param[in] t The time for which the effort shall be retrieved62* @param[in] value The value if the requested edge/time is described63* @return Whether the requested edge/time is described64*/65bool retrieveExistingEffort(const MSEdge* const e, const double t, double& value) const;666768/** @brief Adds a travel time information for an edge and a time span69* @param[in] e The described edge70* @param[in] begin The begin of the described time span71* @param[in] end The end of the described time span72* @param[in] value The travel time value for this edge and time span73*/74void addTravelTime(const MSEdge* const e, double begin, double end, double value);757677/** @brief Adds an effort information for an edge and a time span78* @param[in] e The described edge79* @param[in] begin The begin of the described time span80* @param[in] end The end of the described time span81* @param[in] value Theeffort value for this edge and time span82*/83void addEffort(const MSEdge* const e, double begin, double end, double value);848586/** @brief Removes the travel time information for an edge87* @param[in] e The described edge88*/89void removeTravelTime(const MSEdge* const e);909192/** @brief Removes the effort information for an edge93* @param[in] e The described edge94*/95void removeEffort(const MSEdge* const e);969798/** @brief Returns the information whether any travel time is known for the given edge99* @param[in] e The investigated edge100* @return Whether any travel time information about this edge is stored101*/102bool knowsTravelTime(const MSEdge* const e) const;103104105/** @brief Returns the information whether any effort is known for the given edge106* @param[in] e The investigated edge107* @return Whether any travel time information about this edge is stored108*/109bool knowsEffort(const MSEdge* const e) const;110111112private:113/// @brief A map of edge->time->travel time114std::map<const MSEdge*, ValueTimeLine<double> > myTravelTimes;115116/// @brief A map of edge->time->effort117std::map<const MSEdge*, ValueTimeLine<double> > myEfforts;118119120private:121/// @brief Invalidated copy constructor.122MSEdgeWeightsStorage(const MSEdgeWeightsStorage&);123124/// @brief Invalidated assignment operator.125MSEdgeWeightsStorage& operator=(const MSEdgeWeightsStorage&);126127128};129130131