SUMO - Simulation of Urban MObility

RORoute.h

Go to the documentation of this file.
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 OutputDevice;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00057 class RORoute : public Named {
00058 public:
00069     RORoute(const std::string& id, SUMOReal costs, SUMOReal prob,
00070             const std::vector<const ROEdge*> &route, const RGBColor* const color) ;
00071 
00072 
00077     RORoute(const RORoute& src) ;
00078 
00079 
00081     ~RORoute() ;
00082 
00083 
00089     void add(ROEdge* edge) ;
00090 
00091 
00096     const ROEdge* getFirst() const {
00097         return myRoute[0];
00098     }
00099 
00100 
00105     const ROEdge* getLast() const {
00106         return myRoute.back();
00107     }
00108 
00109 
00115     SUMOReal getCosts() const {
00116         return myCosts;
00117     }
00118 
00119 
00125     SUMOReal getProbability() const {
00126         return myProbability;
00127     }
00128 
00129 
00134     void setCosts(SUMOReal costs) ;
00135 
00136 
00141     void setProbability(SUMOReal prob) ;
00142 
00143 
00148     unsigned int size() const {
00149         return (unsigned int) myRoute.size();
00150     }
00151 
00152 
00157     const std::vector<const ROEdge*> &getEdgeVector() const {
00158         return myRoute;
00159     }
00160 
00165     const RGBColor* getColor() const {
00166         return myColor;
00167     }
00168 
00169 
00172     void recheckForLoops() ;
00173 
00174     OutputDevice&
00175     writeXMLDefinition(SUMOAbstractRouter<ROEdge, ROVehicle> &router, OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const;
00176 
00177 
00178 private:
00180     SUMOReal myCosts;
00181 
00183     SUMOReal myProbability;
00184 
00186     std::vector<const ROEdge*> myRoute;
00187 
00189     const RGBColor* myColor;
00190 
00191 private:
00193     RORoute& operator=(const RORoute& src);
00194 
00195 };
00196 
00197 
00198 #endif
00199 
00200 /****************************************************************************/
00201 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines