SUMO - Simulation of Urban MObility
MSEdgeWeightsStorage.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // A storage for edge travel times and efforts
19 /****************************************************************************/
20 #ifndef MSEdgeWeightsStorage_h
21 #define MSEdgeWeightsStorage_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSEdge;
40 class SUMOVehicle;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
51 public:
54 
55 
58 
59 
66  bool retrieveExistingTravelTime(const MSEdge* const e, const double t, double& value) const;
67 
68 
75  bool retrieveExistingEffort(const MSEdge* const e, const double t, double& value) const;
76 
77 
84  void addTravelTime(const MSEdge* const e, double begin, double end, double value);
85 
86 
93  void addEffort(const MSEdge* const e, double begin, double end, double value);
94 
95 
99  void removeTravelTime(const MSEdge* const e);
100 
101 
105  void removeEffort(const MSEdge* const e);
106 
107 
112  bool knowsTravelTime(const MSEdge* const e) const;
113 
114 
119  bool knowsEffort(const MSEdge* const e) const;
120 
121 
122 private:
124  std::map<const MSEdge*, ValueTimeLine<double> > myTravelTimes;
125 
127  std::map<const MSEdge*, ValueTimeLine<double> > myEfforts;
128 
129 
130 private:
133 
136 
137 
138 };
139 
140 
141 #endif
142 
143 /****************************************************************************/
144 
MSEdgeWeightsStorage()
Constructor.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
A storage for edge travel times and efforts.
A road/street connecting two junctions.
Definition: MSEdge.h:80
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
void removeTravelTime(const MSEdge *const e)
Removes the travel time information for an edge.
std::map< const MSEdge *, ValueTimeLine< double > > myEfforts
A map of edge->time->effort.
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
~MSEdgeWeightsStorage()
Destructor.
MSEdgeWeightsStorage & operator=(const MSEdgeWeightsStorage &)
Invalidated assignment operator.
std::map< const MSEdge *, ValueTimeLine< double > > myTravelTimes
A map of edge->time->travel time.
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.