SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A vehicle as used by router
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef ROVehicle_h
22 #define ROVehicle_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <iostream>
36 #include <utils/common/SUMOTime.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class RORouteDef;
46 class OutputDevice;
47 class ROEdge;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
57 class ROVehicle {
58 public:
65  ROVehicle(const SUMOVehicleParameter& pars,
66  RORouteDef* route, const SUMOVTypeParameter* type);
67 
68 
70  virtual ~ROVehicle();
71 
72 
80  return myRoute;
81  }
82 
83 
90  const SUMOVTypeParameter* getType() const {
91  return myType;
92  }
93 
94 
99  const std::string& getID() const {
100  return myParameter.id;
101  }
102 
103 
109  return myParameter.depart;
110  }
111 
112 
114  SUMOReal getMaxSpeed() const;
115 
116 
117  inline SUMOVehicleClass getVClass() const {
118  return getType() != 0 ? getType()->vehicleClass : DEFAULT_VEH_CLASS;
119  }
120 
121 
134  void saveAllAsXML(OutputDevice& os, OutputDevice* const altos,
135  OutputDevice* const typeos, bool withExitTimes) const;
136 
137 
147  virtual ROVehicle* copy(const std::string& id, unsigned int depTime, RORouteDef* newRoute) const;
148 
149 
150 protected:
153 
156 
159 
160 
161 private:
163  ROVehicle(const ROVehicle& src);
164 
166  ROVehicle& operator=(const ROVehicle& src);
167 
168 };
169 
170 
171 #endif
172 
173 /****************************************************************************/
174 
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at.
Definition: ROVehicle.h:108
const std::string & getID() const
Returns the id of the vehicle.
Definition: ROVehicle.h:99
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOVehicleParameter myParameter
The vehicle&#39;s parameter.
Definition: ROVehicle.h:152
SUMOVehicleClass getVClass() const
Definition: ROVehicle.h:117
Structure representing possible vehicle parameter.
SUMOVehicleClass vehicleClass
The vehicle&#39;s class.
const SUMOVTypeParameter * getType() const
Returns the type of the vehicle.
Definition: ROVehicle.h:90
SUMOReal getMaxSpeed() const
Returns the vehicle&#39;s maximum speed.
Definition: ROVehicle.cpp:104
RORouteDef *const myRoute
The route the vehicle takes.
Definition: ROVehicle.h:158
void saveAllAsXML(OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
Saves the complete vehicle description.
Definition: ROVehicle.cpp:63
A vehicle as used by router.
Definition: ROVehicle.h:57
ROVehicle & operator=(const ROVehicle &src)
Invalidated assignment operator.
SUMOTime depart
The vehicle&#39;s departure time.
const SUMOVTypeParameter *const myType
The type of the vehicle.
Definition: ROVehicle.h:155
A basic edge for routing applications.
Definition: ROEdge.h:67
Structure representing possible vehicle parameter.
ROVehicle(const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type)
Constructor.
Definition: ROVehicle.cpp:54
Base class for a vehicle&#39;s route definition.
Definition: RORouteDef.h:63
virtual ROVehicle * copy(const std::string &id, unsigned int depTime, RORouteDef *newRoute) const
Returns a copy of the vehicle using a new id, departure time and route.
Definition: ROVehicle.cpp:110
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
#define SUMOReal
Definition: config.h:221
const SUMOVehicleClass DEFAULT_VEH_CLASS
virtual ~ROVehicle()
Destructor.
Definition: ROVehicle.cpp:59
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
Definition: ROVehicle.h:79
std::string id
The vehicle&#39;s id.