SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SUMOVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Abstract base class for vehicle representations
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef SUMOVehicle_h
23 #define SUMOVehicle_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
36 #include <utils/common/SUMOTime.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class MSVehicleType;
45 class MSRoute;
46 class MSEdge;
47 class MSLane;
48 class MSDevice;
49 class MSPerson;
50 
51 typedef std::vector<const MSEdge*> MSEdgeVector;
52 
53 
54 // ===========================================================================
55 // class definitions
56 // ===========================================================================
61 class SUMOVehicle {
62 public:
64  virtual ~SUMOVehicle() {}
65 
69  virtual const std::string& getID() const = 0;
70 
74  virtual SUMOReal getPositionOnLane() const = 0;
75 
79  virtual SUMOReal getMaxSpeed() const = 0;
80 
84  virtual SUMOReal getSpeed() const = 0;
85 
89  virtual const MSVehicleType& getVehicleType() const = 0;
90 
92  virtual const MSRoute& getRoute() const = 0;
93 
101  virtual const MSEdge* succEdge(unsigned int nSuccs) const = 0;
102 
104  virtual bool replaceRouteEdges(const MSEdgeVector& edges, bool onInit = false) = 0;
105 
107  virtual bool replaceRoute(const MSRoute* route, bool onInit = false) = 0;
108 
118  virtual void reroute(SUMOTime t, SUMOAbstractRouter<MSEdge, SUMOVehicle>& router, bool withTaz = false) = 0;
119 
123  virtual SUMOReal getAcceleration() const = 0;
124 
129  virtual const MSEdge* getEdge() const = 0;
130 
135  virtual const SUMOVehicleParameter& getParameter() const = 0;
136 
142  virtual void onDepart() = 0;
143 
147  virtual bool isOnRoad() const = 0;
148 
152  virtual SUMOTime getDeparture() const = 0;
153 
156  virtual bool hasDeparted() const = 0;
157 
160  virtual bool hasArrived() const = 0;
161 
165  virtual unsigned int getNumberReroutes() const = 0;
166 
170  virtual const std::vector<MSDevice*>& getDevices() const = 0;
171 
178  virtual void addPerson(MSPerson* person) = 0;
179 
186  virtual bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset = 0) = 0;
187 
191  virtual bool isStopped() const = 0;
192 
193 
194  virtual SUMOReal getChosenSpeedFactor() const = 0;
195 };
196 
197 
198 #endif
199 
200 /****************************************************************************/