RORouteDef_Alternatives.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A route with alternative routes
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 RORouteDef_Alternatives_h
00020 #define RORouteDef_Alternatives_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 <vector>
00034 #include "RORouteDef.h"
00035 #include <utils/common/RGBColor.h>
00036 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class ROEdge;
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00051 class RORouteDef_Alternatives : public RORouteDef {
00052 public:
00054     RORouteDef_Alternatives(const std::string &id,
00055                             unsigned int lastUsed, SUMOReal gawronBeta, SUMOReal gawronA, int maxRoutes) throw();
00056 
00058     virtual ~RORouteDef_Alternatives() throw();
00059 
00062     virtual void addLoadedAlternative(RORoute *alternative);
00063 
00065     RORoute *buildCurrentRoute(SUMOAbstractRouter<ROEdge,ROVehicle> &router, SUMOTime begin,
00066                                const ROVehicle &veh) const;
00067 
00069     void addAlternative(SUMOAbstractRouter<ROEdge,ROVehicle> &router,
00070                         const ROVehicle *const, RORoute *current, SUMOTime begin);
00071 
00073     RORouteDef *copy(const std::string &id) const;
00074 
00075     void invalidateLast();
00076 
00077     void removeLast();
00078 
00079     virtual OutputDevice &writeXMLDefinition(SUMOAbstractRouter<ROEdge,ROVehicle> &router,
00080             OutputDevice &dev, const ROVehicle * const veh,
00081             bool asAlternatives, bool withExitTimes) const;
00082 
00083 private:
00085     int findRoute(RORoute *opt) const;
00086 
00089     SUMOReal gawronF(SUMOReal pdr, SUMOReal pds, SUMOReal x);
00090 
00093     SUMOReal gawronG(SUMOReal a, SUMOReal x);
00094 
00095 private:
00097     mutable bool myNewRoute;
00098 
00100     mutable int myLastUsed;
00101 
00103     typedef std::vector<RORoute*> AlternativesVector;
00104 
00106     AlternativesVector myAlternatives;
00107 
00109     SUMOReal myGawronBeta;
00110 
00112     SUMOReal myGawronA;
00113 
00115     int myMaxRouteNumber;
00116 
00117 
00118 private:
00120     RORouteDef_Alternatives(const RORouteDef_Alternatives &src);
00121 
00123     RORouteDef_Alternatives &operator=(const RORouteDef_Alternatives &src);
00124 
00125 };
00126 
00127 
00128 #endif
00129 
00130 /****************************************************************************/
00131 

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