SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // A complete router's route 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef RORoute_h 00022 #define RORoute_h 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <string> 00035 #include <utils/common/Named.h> 00036 #include <utils/common/RGBColor.h> 00037 #include <utils/common/SUMOAbstractRouter.h> 00038 00039 00040 // =========================================================================== 00041 // class declarations 00042 // =========================================================================== 00043 class ROEdge; 00044 class ROVehicle; 00045 class OutputDevice; 00046 00047 00048 // =========================================================================== 00049 // class definitions 00050 // =========================================================================== 00058 class RORoute : public Named { 00059 public: 00070 RORoute(const std::string& id, SUMOReal costs, SUMOReal prob, 00071 const std::vector<const ROEdge*> &route, const RGBColor* const color) ; 00072 00073 00078 RORoute(const RORoute& src) ; 00079 00080 00082 ~RORoute() ; 00083 00084 00090 void add(ROEdge* edge) ; 00091 00092 00097 const ROEdge* getFirst() const { 00098 return myRoute[0]; 00099 } 00100 00101 00106 const ROEdge* getLast() const { 00107 return myRoute.back(); 00108 } 00109 00110 00116 SUMOReal getCosts() const { 00117 return myCosts; 00118 } 00119 00120 00126 SUMOReal getProbability() const { 00127 return myProbability; 00128 } 00129 00130 00135 void setCosts(SUMOReal costs) ; 00136 00137 00142 void setProbability(SUMOReal prob) ; 00143 00144 00149 unsigned int size() const { 00150 return (unsigned int) myRoute.size(); 00151 } 00152 00153 00158 const std::vector<const ROEdge*> &getEdgeVector() const { 00159 return myRoute; 00160 } 00161 00166 const RGBColor* getColor() const { 00167 return myColor; 00168 } 00169 00170 00173 void recheckForLoops() ; 00174 00175 OutputDevice& 00176 writeXMLDefinition(SUMOAbstractRouter<ROEdge, ROVehicle> &router, OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const; 00177 00178 00179 private: 00181 SUMOReal myCosts; 00182 00184 SUMOReal myProbability; 00185 00187 std::vector<const ROEdge*> myRoute; 00188 00190 const RGBColor* myColor; 00191 00192 private: 00194 RORoute& operator=(const RORoute& src); 00195 00196 }; 00197 00198 00199 #endif 00200 00201 /****************************************************************************/ 00202