SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RORoute.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A complete router's route
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 RORoute_h
22 #define RORoute_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 <utils/common/Named.h>
36 #include <utils/common/RGBColor.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class ROEdge;
45 class ROVehicle;
46 class OutputDevice;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
59 class RORoute : public Named {
60 public:
71  RORoute(const std::string& id, SUMOReal costs, SUMOReal prob,
72  const std::vector<const ROEdge*>& route, const RGBColor* const color,
73  const std::vector<SUMOVehicleParameter::Stop>& stops);
74 
75 
80  RORoute(const RORoute& src);
81 
82 
84  ~RORoute();
85 
86 
91  const ROEdge* getFirst() const {
92  return myRoute[0];
93  }
94 
95 
100  const ROEdge* getLast() const {
101  return myRoute.back();
102  }
103 
104 
110  SUMOReal getCosts() const {
111  return myCosts;
112  }
113 
114 
121  return myProbability;
122  }
123 
124 
129  void setCosts(SUMOReal costs);
130 
131 
136  void setProbability(SUMOReal prob);
137 
138 
143  unsigned int size() const {
144  return (unsigned int) myRoute.size();
145  }
146 
147 
152  const std::vector<const ROEdge*>& getEdgeVector() const {
153  return myRoute;
154  }
155 
160  const RGBColor* getColor() const {
161  return myColor;
162  }
163 
164 
167  void recheckForLoops();
168 
169  OutputDevice&
170  writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh,
171  const bool withCosts, const bool withExitTimes) const;
172 
175  void addProbability(SUMOReal prob);
176 
181  const std::vector<SUMOVehicleParameter::Stop>& getStops() const {
182  return myStops;
183  }
184 
185 private:
188 
191 
193  std::vector<const ROEdge*> myRoute;
194 
197 
199  std::vector<SUMOVehicleParameter::Stop> myStops;
200 
201 
202 private:
204  RORoute& operator=(const RORoute& src);
205 
206 };
207 
208 
209 #endif
210 
211 /****************************************************************************/
212