00001 /****************************************************************************/ 00007 // Some helping methods for router 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 ROHelper_h 00020 #define ROHelper_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 <functional> 00033 #include <vector> 00034 #include "ROEdge.h" 00035 #include "ROVehicle.h" 00036 00037 00038 // =========================================================================== 00039 // class definitions 00040 // =========================================================================== 00048 class ROVehicleByDepartureComperator : public std::less<ROVehicle*> { 00049 public: 00051 explicit ROVehicleByDepartureComperator() throw() { } 00052 00054 ~ROVehicleByDepartureComperator() throw() { } 00055 00067 bool operator()(ROVehicle *veh1, ROVehicle *veh2) const throw() { 00068 if (veh1->getDepartureTime()==veh2->getDepartureTime()) { 00069 return veh1->getID()>veh2->getID(); 00070 } 00071 return veh1->getDepartureTime()>veh2->getDepartureTime(); 00072 } 00073 }; 00074 00075 00080 namespace ROHelper { 00089 /* 00090 SUMOReal recomputeCosts(SUMOAbstractRouter<ROEdge,ROVehicle> &router, 00091 const std::vector<const ROEdge*> &edges, 00092 const ROVehicle * const v, SUMOTime time) throw(); 00093 */ 00094 00099 void recheckForLoops(std::vector<const ROEdge*> &edges) throw(); 00100 00101 } 00102 00103 00105 std::ostream &operator<<(std::ostream &os, const std::vector<const ROEdge*> &ev); 00106 00107 00108 00109 #endif 00110 00111 /****************************************************************************/ 00112
1.5.6