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 class RONet;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
58 class ROVehicle {
59 public:
66  ROVehicle(const SUMOVehicleParameter& pars,
67  RORouteDef* route, const SUMOVTypeParameter* type,
68  const RONet* net);
69 
70 
72  virtual ~ROVehicle();
73 
74 
82  return myRoute;
83  }
84 
85 
92  const SUMOVTypeParameter* getType() const {
93  return myType;
94  }
95 
96 
101  const std::string& getID() const {
102  return myParameter.id;
103  }
104 
105 
111  return myParameter.depart;
112  }
113 
114  const std::vector<const ROEdge*>& getStopEdges() const {
115  return myStopEdges;
116  }
117 
119  SUMOReal getMaxSpeed() const;
120 
121 
122  inline SUMOVehicleClass getVClass() const {
123  return getType() != 0 ? getType()->vehicleClass : DEFAULT_VEH_CLASS;
124  }
125 
126 
139  void saveAllAsXML(OutputDevice& os, OutputDevice* const altos,
140  OutputDevice* const typeos, bool withExitTimes) const;
141 
142 
143 private:
149  void addStop(const SUMOVehicleParameter::Stop& stopPar, const RONet* net);
150 
151 
152 protected:
155 
158 
161 
163  std::vector<const ROEdge*> myStopEdges;
164 
165 
166 private:
168  ROVehicle(const ROVehicle& src);
169 
171  ROVehicle& operator=(const ROVehicle& src);
172 
173 };
174 
175 
176 #endif
177 
178 /****************************************************************************/
179 
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at.
Definition: ROVehicle.h:110
const std::string & getID() const
Returns the id of the vehicle.
Definition: ROVehicle.h:101
ROVehicle(const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net)
Constructor.
Definition: ROVehicle.cpp:55
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOVehicleParameter myParameter
The vehicle&#39;s parameter.
Definition: ROVehicle.h:154
SUMOVehicleClass getVClass() const
Definition: ROVehicle.h:122
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:92
SUMOReal getMaxSpeed() const
Returns the vehicle&#39;s maximum speed.
Definition: ROVehicle.cpp:156
RORouteDef *const myRoute
The route the vehicle takes.
Definition: ROVehicle.h:160
void saveAllAsXML(OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
Saves the complete vehicle description.
Definition: ROVehicle.cpp:115
A vehicle as used by router.
Definition: ROVehicle.h:58
ROVehicle & operator=(const ROVehicle &src)
Invalidated assignment operator.
void addStop(const SUMOVehicleParameter::Stop &stopPar, const RONet *net)
Adds a stop to this vehicle.
Definition: ROVehicle.cpp:71
const std::vector< const ROEdge * > & getStopEdges() const
Definition: ROVehicle.h:114
SUMOTime depart
The vehicle&#39;s departure time.
const SUMOVTypeParameter *const myType
The type of the vehicle.
Definition: ROVehicle.h:157
A basic edge for routing applications.
Definition: ROEdge.h:67
The router&#39;s network representation.
Definition: RONet.h:65
Structure representing possible vehicle parameter.
Definition of vehicle stop (position and duration)
Base class for a vehicle&#39;s route definition.
Definition: RORouteDef.h:63
std::vector< const ROEdge * > myStopEdges
The edges where the vehicle stops.
Definition: ROVehicle.h:163
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
#define SUMOReal
Definition: config.h:215
const SUMOVehicleClass DEFAULT_VEH_CLASS
virtual ~ROVehicle()
Destructor.
Definition: ROVehicle.cpp:111
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
Definition: ROVehicle.h:81
std::string id
The vehicle&#39;s id.