|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // A storage for edge travel times and efforts 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 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 MSEdgeWeightsStorage_h 00020 #define MSEdgeWeightsStorage_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 <utils/common/SUMOTime.h> 00033 #include <utils/common/ValueTimeLine.h> 00034 00035 00036 // =========================================================================== 00037 // class declarations 00038 // =========================================================================== 00039 class MSEdge; 00040 class SUMOVehicle; 00041 00042 00043 // =========================================================================== 00044 // class definitions 00045 // =========================================================================== 00050 class MSEdgeWeightsStorage { 00051 public: 00053 MSEdgeWeightsStorage() throw(); 00054 00055 00057 ~MSEdgeWeightsStorage() throw(); 00058 00059 00067 bool retrieveExistingTravelTime(const MSEdge* const e, const SUMOVehicle* const v, 00068 SUMOReal t, SUMOReal& value) const throw(); 00069 00070 00078 bool retrieveExistingEffort(const MSEdge* const e, const SUMOVehicle* const v, 00079 SUMOReal t, SUMOReal& value) const throw(); 00080 00081 00088 void addTravelTime(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value) throw(); 00089 00090 00097 void addEffort(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value) throw(); 00098 00099 00103 void removeTravelTime(const MSEdge* const e) throw(); 00104 00105 00109 void removeEffort(const MSEdge* const e) throw(); 00110 00111 00116 bool knowsTravelTime(const MSEdge* const e) const throw(); 00117 00118 00123 bool knowsEffort(const MSEdge* const e) const throw(); 00124 00125 00126 private: 00128 std::map<MSEdge*, ValueTimeLine<SUMOReal> > myTravelTimes; 00129 00131 std::map<MSEdge*, ValueTimeLine<SUMOReal> > myEfforts; 00132 00133 00134 private: 00136 MSEdgeWeightsStorage(const MSEdgeWeightsStorage&); 00137 00139 MSEdgeWeightsStorage& operator=(const MSEdgeWeightsStorage&); 00140 00141 00142 }; 00143 00144 00145 #endif 00146 00147 /****************************************************************************/ 00148