/****************************************************************************/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 NBPTLineCont.h14/// @author Gregor Laemmel15/// @date Tue, 20 Mar 201716///17// Container for NBPTLine during netbuild18/****************************************************************************/19#pragma once20#include <config.h>2122#include <vector>23#include "utils/router/SUMOAbstractRouter.h"24#include "NBEdgeCont.h"25#include "NBPTLine.h"26#include "NBVehicle.h"272829// ===========================================================================30// class definitions31// ===========================================================================32class NBPTLineCont {33public:34/// @brief destructor35~NBPTLineCont();3637/// @brief insert new line38bool insert(NBPTLine* ptLine);3940NBPTLine* retrieve(const std::string& lineID);4142const std::map<std::string, NBPTLine*>& getLines() const {43return myPTLines;44}4546void process(NBEdgeCont& ec, NBPTStopCont& sc, bool routeOnly = false);4748/// @brief replace the edge with the given edge list in all lines49void replaceEdge(const std::string& edgeID, const EdgeVector& replacement);5051/// @brief select the correct stop on superposed rail edges52void fixBidiStops(const NBEdgeCont& ec);5354/// @brief filter out edges that were removed due to --geometry.remove55void removeInvalidEdges(const NBEdgeCont& ec);5657/// @brief ensure that all turn lanes have sufficient permissions58void fixPermissions();5960std::set<std::string> getServedPTStops();61private:6263static const int FWD;64static const int BWD;6566/// @brief The map of names to pt lines67std::map<std::string, NBPTLine*> myPTLines;6869/// @brief find directional edge for all stops of the line70void reviseStops(NBPTLine* line, const NBEdgeCont& ec, NBPTStopCont& sc);7172void reviseSingleWayStops(NBPTLine* line, const NBEdgeCont& ec, NBPTStopCont& sc);7374/* @brief find way element corresponding to the stop75* @note: if the edge id is updated, the stop extent is recomputed */76std::shared_ptr<NBPTStop> findWay(NBPTLine* line, std::shared_ptr<NBPTStop> stop, const NBEdgeCont& ec, NBPTStopCont& sc) const;7778void constructRoute(NBPTLine* myPTLine, const NBEdgeCont& cont);7980static double getCost(const NBEdgeCont& ec, SUMOAbstractRouter<NBRouterEdge, NBVehicle>& router,81const std::shared_ptr<NBPTStop> from, const std::shared_ptr<NBPTStop> to, const NBVehicle* veh);8283static std::string getWayID(const std::string& edgeID);8485/// @brief The map of edge ids to lines that use this edge in their route86std::map<std::string, std::set<NBPTLine*> > myPTLineLookup;87};888990