Eclipse SUMO - Simulation of Urban MObility
SUMOTrafficObject.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Abstract base class for vehicle and person representations
16 /****************************************************************************/
17 #ifndef SUMOTrafficObject_h
18 #define SUMOTrafficObject_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <vector>
27 #include <typeinfo>
28 #include <utils/common/SUMOTime.h>
29 #include <utils/common/Named.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MSVehicleType;
37 class MSEdge;
38 class MSLane;
39 class Position;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 public:
51  virtual ~SUMOTrafficObject() {}
52 
56  virtual bool isVehicle() const = 0;
57 
61  virtual const std::string& getID() const = 0;
62 
66  virtual const MSVehicleType& getVehicleType() const = 0;
67 
71  virtual bool isStopped() const = 0;
72 
77  virtual const MSEdge* getEdge() const = 0;
78 
82  virtual double getSlope() const = 0;
83 
84  virtual double getChosenSpeedFactor() const = 0;
85 
89  virtual SUMOVehicleClass getVClass() const = 0;
90 
94  virtual double getMaxSpeed() const = 0;
95 
96  virtual SUMOTime getWaitingTime() const = 0;
97 
101  virtual double getSpeed() const = 0;
102 
103  // This definition was introduced to make the MSVehicle's previousSpeed Refs. #2579
107  virtual double getPreviousSpeed() const = 0;
108 
109 
113  virtual double getAcceleration() const = 0;
114 
118  virtual double getPositionOnLane() const = 0;
119 
123  virtual double getBackPositionOnLane(const MSLane* lane) const = 0;
124 
125 
133  virtual Position getPosition(const double offset = 0) const = 0;
134 
137  virtual double getAngle() const = 0;
138 
141  virtual bool hasArrived() const = 0;
142 
143 };
144 
145 
146 #endif
147 
148 /****************************************************************************/
virtual ~SUMOTrafficObject()
Destructor.
long long int SUMOTime
Definition: SUMOTime.h:35
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle&#39;s type.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
virtual const std::string & getID() const =0
Get the vehicle&#39;s ID.
virtual double getAcceleration() const =0
Returns the vehicle&#39;s acceleration.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
virtual bool isVehicle() const =0
Get the vehicle&#39;s ID.
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle&#39;s access class.
virtual double getChosenSpeedFactor() const =0
The car-following model and parameter.
Definition: MSVehicleType.h:66
virtual double getAngle() const =0
Returns the objects angle in degrees.
virtual double getBackPositionOnLane(const MSLane *lane) const =0
Get the vehicle&#39;s back position along the given lane.
A road/street connecting two junctions.
Definition: MSEdge.h:76
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
virtual double getSlope() const =0
Returns the slope of the road at vehicle&#39;s position.
virtual double getPreviousSpeed() const =0
Returns the vehicle&#39;s previous speed.
Representation of a vehicle or person.
virtual bool hasArrived() const =0
Returns whether this vehicle has arrived.
virtual double getPositionOnLane() const =0
Get the vehicle&#39;s position along the lane.
virtual double getMaxSpeed() const =0
Returns the vehicle&#39;s maximum speed.
virtual double getSpeed() const =0
Returns the vehicle&#39;s current speed.
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
virtual SUMOTime getWaitingTime() const =0