SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSEdgeWeightsStorage.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A storage for edge travel times and efforts
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSEdgeWeightsStorage_h
22 #define MSEdgeWeightsStorage_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <utils/common/SUMOTime.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class MSEdge;
42 class SUMOVehicle;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
53 public:
56 
57 
60 
61 
68  bool retrieveExistingTravelTime(const MSEdge* const e, const SUMOReal t, SUMOReal& value) const;
69 
70 
77  bool retrieveExistingEffort(const MSEdge* const e, const SUMOReal t, SUMOReal& value) const;
78 
79 
86  void addTravelTime(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value);
87 
88 
95  void addEffort(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value);
96 
97 
101  void removeTravelTime(const MSEdge* const e);
102 
103 
107  void removeEffort(const MSEdge* const e);
108 
109 
114  bool knowsTravelTime(const MSEdge* const e) const;
115 
116 
121  bool knowsEffort(const MSEdge* const e) const;
122 
123 
124 private:
126  std::map<const MSEdge*, ValueTimeLine<SUMOReal> > myTravelTimes;
127 
129  std::map<const MSEdge*, ValueTimeLine<SUMOReal> > myEfforts;
130 
131 
132 private:
135 
138 
139 
140 };
141 
142 
143 #endif
144 
145 /****************************************************************************/
146 
MSEdgeWeightsStorage()
Constructor.
A storage for edge travel times and efforts.
void addEffort(const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
Adds an effort information for an edge and a time span.
void addTravelTime(const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
Adds a travel time information for an edge and a time span.
A road/street connecting two junctions.
Definition: MSEdge.h:74
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
Representation of a vehicle.
Definition: SUMOVehicle.h:64
std::map< const MSEdge *, ValueTimeLine< SUMOReal > > myEfforts
A map of edge->time->effort.
void removeTravelTime(const MSEdge *const e)
Removes the travel time information for an edge.
~MSEdgeWeightsStorage()
Destructor.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
#define SUMOReal
Definition: config.h:215
bool retrieveExistingEffort(const MSEdge *const e, const SUMOReal t, SUMOReal &value) const
Returns an effort for an edge and time if stored.
MSEdgeWeightsStorage & operator=(const MSEdgeWeightsStorage &)
Invalidated assignment operator.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
bool retrieveExistingTravelTime(const MSEdge *const e, const SUMOReal t, SUMOReal &value) const
Returns a travel time for an edge and time if stored.
std::map< const MSEdge *, ValueTimeLine< SUMOReal > > myTravelTimes
A map of edge->time->travel time.