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 /****************************************************************************/
10 // A complete router's route
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef RORoute_h
24 #define RORoute_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <utils/common/Named.h>
38 #include <utils/common/RGBColor.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class ROEdge;
47 class ROVehicle;
48 class OutputDevice;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
61 class RORoute : public Named {
62 public:
73  RORoute(const std::string& id, SUMOReal costs, SUMOReal prob,
74  const std::vector<const ROEdge*>& route, const RGBColor* const color,
75  const std::vector<SUMOVehicleParameter::Stop>& stops);
76 
77 
82  RORoute(const RORoute& src);
83 
84 
86  ~RORoute();
87 
88 
93  const ROEdge* getFirst() const {
94  return myRoute[0];
95  }
96 
97 
102  const ROEdge* getLast() const {
103  return myRoute.back();
104  }
105 
106 
112  SUMOReal getCosts() const {
113  return myCosts;
114  }
115 
116 
123  return myProbability;
124  }
125 
126 
131  void setCosts(SUMOReal costs);
132 
133 
138  void setProbability(SUMOReal prob);
139 
140 
145  unsigned int size() const {
146  return (unsigned int) myRoute.size();
147  }
148 
149 
154  const std::vector<const ROEdge*>& getEdgeVector() const {
155  return myRoute;
156  }
157 
162  const RGBColor* getColor() const {
163  return myColor;
164  }
165 
166 
169  void recheckForLoops();
170 
171  OutputDevice&
172  writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh,
173  const bool withCosts, const bool withExitTimes) const;
174 
177  void addProbability(SUMOReal prob);
178 
183  const std::vector<SUMOVehicleParameter::Stop>& getStops() const {
184  return myStops;
185  }
186 
187 private:
190 
193 
195  std::vector<const ROEdge*> myRoute;
196 
199 
201  std::vector<SUMOVehicleParameter::Stop> myStops;
202 
203 
204 private:
206  RORoute& operator=(const RORoute& src);
207 
208 };
209 
210 
211 #endif
212 
213 /****************************************************************************/
214