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>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class ROEdge;
44 class ROVehicle;
45 class OutputDevice;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
58 class RORoute : public Named {
59 public:
70  RORoute(const std::string& id, SUMOReal costs, SUMOReal prob,
71  const std::vector<const ROEdge*>& route, const RGBColor* const color);
72 
73 
78  RORoute(const RORoute& src);
79 
80 
82  ~RORoute();
83 
84 
90  void add(ROEdge* edge);
91 
92 
97  const ROEdge* getFirst() const {
98  return myRoute[0];
99  }
100 
101 
106  const ROEdge* getLast() const {
107  return myRoute.back();
108  }
109 
110 
116  SUMOReal getCosts() const {
117  return myCosts;
118  }
119 
120 
127  return myProbability;
128  }
129 
130 
135  void setCosts(SUMOReal costs);
136 
137 
142  void setProbability(SUMOReal prob);
143 
144 
149  unsigned int size() const {
150  return (unsigned int) myRoute.size();
151  }
152 
153 
158  const std::vector<const ROEdge*>& getEdgeVector() const {
159  return myRoute;
160  }
161 
166  const RGBColor* getColor() const {
167  return myColor;
168  }
169 
170 
173  void recheckForLoops();
174 
175  OutputDevice&
176  writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh,
177  const bool withCosts, const bool withExitTimes) const;
178 
181  void addProbability(SUMOReal prob);
182 
183 private:
186 
189 
191  std::vector<const ROEdge*> myRoute;
192 
195 
196 
197 private:
199  RORoute& operator=(const RORoute& src);
200 
201 };
202 
203 
204 #endif
205 
206 /****************************************************************************/
207