SUMO - Simulation of Urban MObility
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.dlr.de/
11 // Copyright (C) 2001-2017 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 
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class MSEdge;
41 class SUMOVehicle;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
52 public:
55 
56 
59 
60 
67  bool retrieveExistingTravelTime(const MSEdge* const e, const double t, double& value) const;
68 
69 
76  bool retrieveExistingEffort(const MSEdge* const e, const double t, double& value) const;
77 
78 
85  void addTravelTime(const MSEdge* const e, double begin, double end, double value);
86 
87 
94  void addEffort(const MSEdge* const e, double begin, double end, double value);
95 
96 
100  void removeTravelTime(const MSEdge* const e);
101 
102 
106  void removeEffort(const MSEdge* const e);
107 
108 
113  bool knowsTravelTime(const MSEdge* const e) const;
114 
115 
120  bool knowsEffort(const MSEdge* const e) const;
121 
122 
123 private:
125  std::map<const MSEdge*, ValueTimeLine<double> > myTravelTimes;
126 
128  std::map<const MSEdge*, ValueTimeLine<double> > myEfforts;
129 
130 
131 private:
134 
137 
138 
139 };
140 
141 
142 #endif
143 
144 /****************************************************************************/
145 
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:67
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.