Line data Source code
1 : /****************************************************************************/ 2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo 3 : // Copyright (C) 2002-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 NBVehicle.h 15 : /// @author Daniel Krajzewicz 16 : /// @author Michael Behrisch 17 : /// @author Jakob Erdmann 18 : /// @date Sept 2002 19 : /// 20 : // A vehicle as used by router 21 : /****************************************************************************/ 22 : #pragma once 23 : #include <config.h> 24 : 25 : #include <string> 26 : #include <iostream> 27 : #include <utils/vehicle/SUMOVTypeParameter.h> 28 : 29 : 30 : // =========================================================================== 31 : // class declarations 32 : // =========================================================================== 33 : 34 : 35 : // =========================================================================== 36 : // class definitions 37 : // =========================================================================== 38 : /** 39 : * @class NBVehicle 40 : * @brief A vehicle as used by router 41 : */ 42 : class NBVehicle { 43 : public: 44 : /** @brief Constructor 45 : * 46 : * @param[in] pars Parameter of this vehicle 47 : * @param[in] route The definition of the route the vehicle shall use 48 : * @param[in] type The type of the vehicle 49 : */ 50 1209 : NBVehicle(const std::string& id, SUMOVehicleClass vClass): 51 1209 : myID(id), myVClass(vClass), myLength(getDefaultVehicleLength(vClass)) {} 52 : 53 : const std::string& getID() const { 54 0 : return myID; 55 : } 56 : 57 : SUMOVehicleClass getVClass() const { 58 1145 : return myVClass; 59 : } 60 : 61 : /** @brief Returns whether this object is ignoring transient permission 62 : * changes (during routing) 63 : */ 64 : bool ignoreTransientPermissions() const { 65 : return false; 66 : }; 67 : 68 : double getLength() const { 69 : return myLength; 70 : } 71 : 72 : /// @brief Destructor 73 1209 : virtual ~NBVehicle() {} 74 : 75 : 76 : private: 77 : /// @brief vehicle ID for error reporting 78 : std::string myID; 79 : 80 : /// @brief The vehicle class of the vehicle 81 : SUMOVehicleClass myVClass; 82 : 83 : /// @brief The length of the vehicle (for rail-routing) 84 : double myLength; 85 : 86 : 87 : private: 88 : /// @brief Invalidated copy constructor 89 : NBVehicle(const NBVehicle& src); 90 : 91 : /// @brief Invalidated assignment operator 92 : NBVehicle& operator=(const NBVehicle& src); 93 : 94 : };