Line data Source code
1 : /****************************************************************************/ 2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo 3 : // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others. 4 : // This program and the accompanying materials are made available under the 5 : // terms of the Eclipse Public License 2.0 which is available at 6 : // https://www.eclipse.org/legal/epl-2.0/ 7 : // This Source Code may also be made available under the following Secondary 8 : // Licenses when the conditions for such availability set forth in the Eclipse 9 : // Public License 2.0 are satisfied: GNU General Public License, version 2 10 : // or later which is available at 11 : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html 12 : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later 13 : /****************************************************************************/ 14 : /// @file ROJTRRouter.h 15 : /// @author Daniel Krajzewicz 16 : /// @author Michael Behrisch 17 : /// @date Tue, 20 Jan 2004 18 : /// 19 : // Computes routes using junction turning percentages 20 : /****************************************************************************/ 21 : #pragma once 22 : #include <config.h> 23 : 24 : #include <utils/router/SUMOAbstractRouter.h> 25 : #include <router/RORoutable.h> 26 : 27 : 28 : // =========================================================================== 29 : // class declarations 30 : // =========================================================================== 31 : class RONet; 32 : class ROEdge; 33 : class ROJTREdge; 34 : 35 : 36 : // =========================================================================== 37 : // class definitions 38 : // =========================================================================== 39 : /** 40 : * @class ROJTRRouter 41 : * @brief Computes routes using junction turning percentages 42 : */ 43 : class ROJTRRouter : public SUMOAbstractRouter<ROEdge, ROVehicle> { 44 : public: 45 : /** @brief Constructor 46 : * @param[in] unbuildIsWarningOnly Whether not closed routes shall not yield in an error 47 : * @param[in] acceptAllDestinations If false, only sinks will be used as final edges 48 : * @param[in] maxEdges The maximum number of edges a route may have 49 : * @param[in] ignoreClasses Whether routing shall be done without regarding vehicle classes 50 : * @param[in] allowLoops Whether a vehicle may reuse a road 51 : * @param[in] discountSources Whether upstream flow shall be discounted from source flows 52 : */ 53 : ROJTRRouter(bool unbuildIsWarningOnly, 54 : bool acceptAllDestinations, int maxEdges, bool ignoreClasses, 55 : bool allowLoops, 56 : bool discountSources); 57 : 58 : 59 : /// @brief Destructor 60 : ~ROJTRRouter(); 61 : 62 0 : virtual SUMOAbstractRouter<ROEdge, ROVehicle>* clone() { 63 0 : return new ROJTRRouter(myUnbuildIsWarningOnly, myAcceptAllDestination, myMaxEdges, myIgnoreClasses, myAllowLoops, myDiscountSources); 64 : } 65 : 66 : /// @name Implementatios of SUMOAbstractRouter 67 : /// @{ 68 : 69 : /** @brief Computes a route 70 : * 71 : * The description how routes are computed is given in the user documentation 72 : * @param[in] from The edge the vehicle starts at 73 : * @param[in] to The destination edge - invalid here 74 : * @param[in] vehicle The vehicle to compute the route for 75 : * @param[in] time The departure time of the vehicle 76 : * @param[filled] into The list of edges to store the route into 77 : */ 78 : bool compute(const ROEdge* from, const ROEdge* to, const ROVehicle* const vehicle, 79 : SUMOTime time, ConstROEdgeVector& into, bool silent = false); 80 : /// @} 81 : 82 : private: 83 : /// @brief Whether unbuildable routes shall be reported as warniings, not errors 84 : const bool myUnbuildIsWarningOnly; 85 : 86 : /// @brief Whether all edges may be used as route end 87 : const bool myAcceptAllDestination; 88 : 89 : /// @brief The maximum number of edges a route may have 90 : const int myMaxEdges; 91 : 92 : /// @brief Whether vehicle class information shall be ignored 93 : const bool myIgnoreClasses; 94 : 95 : /// @brief Whether a vehicle may reuse a road 96 : const bool myAllowLoops; 97 : 98 : /// @brief Whether upstream flows shall be discounted from source flows 99 : const bool myDiscountSources; 100 : };