Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NBVehicle.h
Go to the documentation of this file.
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/****************************************************************************/
20// A vehicle as used by router
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
25#include <string>
26#include <iostream>
28
29
30// ===========================================================================
31// class declarations
32// ===========================================================================
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
42class NBVehicle {
43public:
50 NBVehicle(const std::string& id, SUMOVehicleClass vClass):
51 myID(id), myVClass(vClass), myLength(getDefaultVehicleLength(vClass)) {}
52
53 const std::string& getID() const {
54 return myID;
55 }
56
58 return myVClass;
59 }
60
65 return false;
66 };
67
68 double getLength() const {
69 return myLength;
70 }
71
73 virtual ~NBVehicle() {}
74
75
76private:
78 std::string myID;
79
82
84 double myLength;
85
86
87private:
89 NBVehicle(const NBVehicle& src);
90
93
94};
double getDefaultVehicleLength(const SUMOVehicleClass vc)
Returns the default vehicle length This put into a function so it can be used by NBVehicle.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
A vehicle as used by router.
Definition NBVehicle.h:42
virtual ~NBVehicle()
Destructor.
Definition NBVehicle.h:73
NBVehicle(const NBVehicle &src)
Invalidated copy constructor.
double myLength
The length of the vehicle (for rail-routing)
Definition NBVehicle.h:84
std::string myID
vehicle ID for error reporting
Definition NBVehicle.h:78
bool ignoreTransientPermissions() const
Returns whether this object is ignoring transient permission changes (during routing)
Definition NBVehicle.h:64
SUMOVehicleClass myVClass
The vehicle class of the vehicle.
Definition NBVehicle.h:81
double getLength() const
Definition NBVehicle.h:68
NBVehicle(const std::string &id, SUMOVehicleClass vClass)
Constructor.
Definition NBVehicle.h:50
SUMOVehicleClass getVClass() const
Definition NBVehicle.h:57
NBVehicle & operator=(const NBVehicle &src)
Invalidated assignment operator.
const std::string & getID() const
Definition NBVehicle.h:53