SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // Some helping methods for router 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 ROHelper_h 00022 #define ROHelper_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 <functional> 00035 #include <vector> 00036 #include "ROEdge.h" 00037 #include "ROVehicle.h" 00038 00039 00040 // =========================================================================== 00041 // class definitions 00042 // =========================================================================== 00050 class ROVehicleByDepartureComperator : public std::less<ROVehicle*> { 00051 public: 00053 explicit ROVehicleByDepartureComperator() { } 00054 00056 ~ROVehicleByDepartureComperator() { } 00057 00069 bool operator()(ROVehicle* veh1, ROVehicle* veh2) const { 00070 if (veh1->getDepartureTime() == veh2->getDepartureTime()) { 00071 return veh1->getID() > veh2->getID(); 00072 } 00073 return veh1->getDepartureTime() > veh2->getDepartureTime(); 00074 } 00075 }; 00076 00077 00082 namespace ROHelper { 00091 /* 00092 SUMOReal recomputeCosts(SUMOAbstractRouter<ROEdge,ROVehicle> &router, 00093 const std::vector<const ROEdge*> &edges, 00094 const ROVehicle * const v, SUMOTime time) ; 00095 */ 00096 00101 void recheckForLoops(std::vector<const ROEdge*> &edges) ; 00102 00103 } 00104 00105 00107 std::ostream& operator<<(std::ostream& os, const std::vector<const ROEdge*> &ev); 00108 00109 00110 00111 #endif 00112 00113 /****************************************************************************/ 00114