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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A storage for edge travel times and efforts
17 /****************************************************************************/
18 #ifndef MSEdgeWeightsStorage_h
19 #define MSEdgeWeightsStorage_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class MSEdge;
34 class SUMOVehicle;
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
45 public:
48 
49 
52 
53 
60  bool retrieveExistingTravelTime(const MSEdge* const e, const double t, double& value) const;
61 
62 
69  bool retrieveExistingEffort(const MSEdge* const e, const double t, double& value) const;
70 
71 
78  void addTravelTime(const MSEdge* const e, double begin, double end, double value);
79 
80 
87  void addEffort(const MSEdge* const e, double begin, double end, double value);
88 
89 
93  void removeTravelTime(const MSEdge* const e);
94 
95 
99  void removeEffort(const MSEdge* const e);
100 
101 
106  bool knowsTravelTime(const MSEdge* const e) const;
107 
108 
113  bool knowsEffort(const MSEdge* const e) const;
114 
115 
116 private:
118  std::map<const MSEdge*, ValueTimeLine<double> > myTravelTimes;
119 
121  std::map<const MSEdge*, ValueTimeLine<double> > myEfforts;
122 
123 
124 private:
127 
130 
131 
132 };
133 
134 
135 #endif
136 
137 /****************************************************************************/
138 
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:75
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
Representation of a vehicle.
Definition: SUMOVehicle.h:60
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.