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 /****************************************************************************/
9 // A vehicle as used by router
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2002-2014 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 ROVehicle_h
23 #define ROVehicle_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 <string>
36 #include <iostream>
37 #include <utils/common/SUMOTime.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class RORouteDef;
47 class OutputDevice;
48 class ROEdge;
49 class RONet;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
59 class ROVehicle {
60 public:
67  ROVehicle(const SUMOVehicleParameter& pars,
68  RORouteDef* route, const SUMOVTypeParameter* type,
69  const RONet* net);
70 
71 
73  virtual ~ROVehicle();
74 
75 
83  return myRoute;
84  }
85 
86 
93  const SUMOVTypeParameter* getType() const {
94  return myType;
95  }
96 
97 
102  const std::string& getID() const {
103  return myParameter.id;
104  }
105 
106 
112  return myParameter.depart;
113  }
114 
115  const std::vector<const ROEdge*>& getStopEdges() const {
116  return myStopEdges;
117  }
118 
120  SUMOReal getMaxSpeed() const;
121 
122 
123  inline SUMOVehicleClass getVClass() const {
124  return getType() != 0 ? getType()->vehicleClass : SVC_IGNORING;
125  }
126 
127 
140  void saveAllAsXML(OutputDevice& os, OutputDevice* const altos,
141  OutputDevice* const typeos, bool withExitTimes) const;
142 
143 
144 private:
150  void addStop(const SUMOVehicleParameter::Stop& stopPar, const RONet* net);
151 
152 
153 protected:
156 
159 
162 
164  std::vector<const ROEdge*> myStopEdges;
165 
166 
167 private:
169  ROVehicle(const ROVehicle& src);
170 
172  ROVehicle& operator=(const ROVehicle& src);
173 
174 };
175 
176 
177 #endif
178 
179 /****************************************************************************/
180 
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at.
Definition: ROVehicle.h:111
const std::string & getID() const
Returns the id of the vehicle.
Definition: ROVehicle.h:102
ROVehicle(const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net)
Constructor.
Definition: ROVehicle.cpp:56
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOVehicleParameter myParameter
The vehicle's parameter.
Definition: ROVehicle.h:155
SUMOVehicleClass getVClass() const
Definition: ROVehicle.h:123
Structure representing possible vehicle parameter.
SUMOVehicleClass vehicleClass
The vehicle's class.
const SUMOVTypeParameter * getType() const
Returns the type of the vehicle.
Definition: ROVehicle.h:93
SUMOReal getMaxSpeed() const
Returns the vehicle's maximum speed.
Definition: ROVehicle.cpp:157
RORouteDef *const myRoute
The route the vehicle takes.
Definition: ROVehicle.h:161
void saveAllAsXML(OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
Saves the complete vehicle description.
Definition: ROVehicle.cpp:116
A vehicle as used by router.
Definition: ROVehicle.h:59
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:72
const std::vector< const ROEdge * > & getStopEdges() const
Definition: ROVehicle.h:115
SUMOTime depart
The vehicle's departure time.
const SUMOVTypeParameter *const myType
The type of the vehicle.
Definition: ROVehicle.h:158
A basic edge for routing applications.
Definition: ROEdge.h:69
The router's network representation.
Definition: RONet.h:67
Structure representing possible vehicle parameter.
Definition of vehicle stop (position and duration)
Base class for a vehicle's route definition.
Definition: RORouteDef.h:64
std::vector< const ROEdge * > myStopEdges
The edges where the vehicle stops.
Definition: ROVehicle.h:164
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:215
virtual ~ROVehicle()
Destructor.
Definition: ROVehicle.cpp:112
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
Definition: ROVehicle.h:82
vehicles ignoring classes
std::string id
The vehicle's id.