SUMO - Simulation of Urban MObility
MSEdgeWeightsStorage.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A storage for edge travel times and efforts
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 MSEdgeWeightsStorage_h
00022 #define MSEdgeWeightsStorage_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 <utils/common/SUMOTime.h>
00035 #include <utils/common/ValueTimeLine.h>
00036 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class MSEdge;
00042 class SUMOVehicle;
00043 
00044 
00045 // ===========================================================================
00046 // class definitions
00047 // ===========================================================================
00052 class MSEdgeWeightsStorage {
00053 public:
00055     MSEdgeWeightsStorage() ;
00056 
00057 
00059     ~MSEdgeWeightsStorage() ;
00060 
00061 
00069     bool retrieveExistingTravelTime(const MSEdge* const e, const SUMOVehicle* const v,
00070                                     SUMOReal t, SUMOReal& value) const ;
00071 
00072 
00080     bool retrieveExistingEffort(const MSEdge* const e, const SUMOVehicle* const v,
00081                                 SUMOReal t, SUMOReal& value) const ;
00082 
00083 
00090     void addTravelTime(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value) ;
00091 
00092 
00099     void addEffort(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value) ;
00100 
00101 
00105     void removeTravelTime(const MSEdge* const e) ;
00106 
00107 
00111     void removeEffort(const MSEdge* const e) ;
00112 
00113 
00118     bool knowsTravelTime(const MSEdge* const e) const ;
00119 
00120 
00125     bool knowsEffort(const MSEdge* const e) const ;
00126 
00127 
00128 private:
00130     std::map<MSEdge*, ValueTimeLine<SUMOReal> > myTravelTimes;
00131 
00133     std::map<MSEdge*, ValueTimeLine<SUMOReal> > myEfforts;
00134 
00135 
00136 private:
00138     MSEdgeWeightsStorage(const MSEdgeWeightsStorage&);
00139 
00141     MSEdgeWeightsStorage& operator=(const MSEdgeWeightsStorage&);
00142 
00143 
00144 };
00145 
00146 
00147 #endif
00148 
00149 /****************************************************************************/
00150 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines