RORoute.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A complete router's route
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef RORoute_h
00020 #define RORoute_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include <utils/common/Named.h>
00034 #include <utils/common/RGBColor.h>
00035 #include <utils/common/SUMOAbstractRouter.h>
00036 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class ROEdge;
00042 class OutputDevice;
00043 
00044 
00045 // ===========================================================================
00046 // class definitions
00047 // ===========================================================================
00055 class RORoute : public Named {
00056 public:
00067     RORoute(const std::string &id, SUMOReal costs, SUMOReal prob,
00068             const std::vector<const ROEdge*> &route, const RGBColor * const color) throw();
00069 
00070 
00075     RORoute(const RORoute &src) throw();
00076 
00077 
00079     ~RORoute() throw();
00080 
00081 
00087     void add(ROEdge *edge) throw();
00088 
00089 
00094     const ROEdge *getFirst() const throw() {
00095         return myRoute[0];
00096     }
00097 
00098 
00103     const ROEdge *getLast() const throw() {
00104         return myRoute.back();
00105     }
00106 
00107 
00113     SUMOReal getCosts() const throw() {
00114         return myCosts;
00115     }
00116 
00117 
00123     SUMOReal getProbability() const throw() {
00124         return myProbability;
00125     }
00126 
00127 
00132     void setCosts(SUMOReal costs) throw();
00133 
00134 
00139     void setProbability(SUMOReal prob) throw();
00140 
00141 
00146     unsigned int size() const throw() {
00147         return (unsigned int) myRoute.size();
00148     }
00149 
00150 
00155     const std::vector<const ROEdge*> &getEdgeVector() const throw() {
00156         return myRoute;
00157     }
00158 
00163     const RGBColor * const getColor() const throw() {
00164         return myColor;
00165     }
00166 
00167 
00170     void recheckForLoops() throw();
00171 
00172     OutputDevice &
00173     writeXMLDefinition(SUMOAbstractRouter<ROEdge,ROVehicle> &router, OutputDevice &dev, const ROVehicle * const veh, bool asAlternatives, bool withExitTimes) const;
00174 
00175 
00176 private:
00178     SUMOReal myCosts;
00179 
00181     SUMOReal myProbability;
00182 
00184     std::vector<const ROEdge*> myRoute;
00185 
00187     const RGBColor *myColor;
00188 
00189 private:
00191     RORoute &operator=(const RORoute &src);
00192 
00193 };
00194 
00195 
00196 #endif
00197 
00198 /****************************************************************************/
00199 

Generated on Wed May 5 00:06:36 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6