/****************************************************************************/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 ROMAEdge.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Christian Roessel17/// @author Laura Bieker18/// @author Michael Behrisch19/// @date Sept 200220///21// A basic edge for routing applications22/****************************************************************************/23#pragma once24#include <config.h>2526#include <string>27#include <map>28#include <vector>29#include <algorithm>30#include <utils/common/ValueTimeLine.h>31#include <utils/common/SUMOVehicleClass.h>32#include <router/ROEdge.h>333435// ===========================================================================36// class declarations37// ===========================================================================38class ROLane;39class ROVehicle;404142// ===========================================================================43// class definitions44// ===========================================================================45/**46* @class ROMAEdge47* @brief A basic edge for routing applications48*49* The edge contains two time lines, one for the travel time and one for a second50* measure which may be used for computing the costs of a route. After loading51* the weights, it is needed to call "buildTimeLines" in order to initialise52* these time lines.53*/54class ROMAEdge : public ROEdge {55public:56/** @brief Constructor57*58* @param[in] id The id of the edge59* @param[in] from The node the edge begins at60* @param[in] to The node the edge ends at61* @param[in] index The numeric id of the edge62*/63ROMAEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority, const std::string& type);646566/// Destructor67virtual ~ROMAEdge();6869/** @brief Adds information about a connected edge.70*71* In addition to ROEdge::addSuccessor it keeps track of left turns.72*73* @param[in] s The edge to add74* @todo What about vehicle-type aware connections?75*/76virtual void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");7778void setFlow(const double begin, const double end, const double flow) {79myFlow.add(begin, end, flow);80}8182double getFlow(const double time) const {83return myFlow.getValue(time);84}8586void setHelpFlow(const double begin, const double end, const double flow) {87myHelpFlow.add(begin, end, flow);88}8990double getHelpFlow(const double time) const {91return myHelpFlow.getValue(time);92}9394private:95std::set<ROMAEdge*> myLeftTurns;96ValueTimeLine<double> myFlow;97ValueTimeLine<double> myHelpFlow;9899private:100/// @brief Invalidated copy constructor101ROMAEdge(const ROMAEdge& src);102103/// @brief Invalidated assignment operator104ROMAEdge& operator=(const ROMAEdge& src);105106};107108109