Eclipse 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-2019 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 /****************************************************************************/
15 // A storage for edge travel times and efforts
16 /****************************************************************************/
17 #ifndef MSEdgeWeightsStorage_h
18 #define MSEdgeWeightsStorage_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class MSEdge;
33 class SUMOVehicle;
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
44 public:
47 
48 
51 
52 
59  bool retrieveExistingTravelTime(const MSEdge* const e, const double t, double& value) const;
60 
61 
68  bool retrieveExistingEffort(const MSEdge* const e, const double t, double& value) const;
69 
70 
77  void addTravelTime(const MSEdge* const e, double begin, double end, double value);
78 
79 
86  void addEffort(const MSEdge* const e, double begin, double end, double value);
87 
88 
92  void removeTravelTime(const MSEdge* const e);
93 
94 
98  void removeEffort(const MSEdge* const e);
99 
100 
105  bool knowsTravelTime(const MSEdge* const e) const;
106 
107 
112  bool knowsEffort(const MSEdge* const e) const;
113 
114 
115 private:
117  std::map<const MSEdge*, ValueTimeLine<double> > myTravelTimes;
118 
120  std::map<const MSEdge*, ValueTimeLine<double> > myEfforts;
121 
122 
123 private:
126 
129 
130 
131 };
132 
133 
134 #endif
135 
136 /****************************************************************************/
137 
MSEdgeWeightsStorage::knowsEffort
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
Definition: MSEdgeWeightsStorage.cpp:119
MSEdgeWeightsStorage::MSEdgeWeightsStorage
MSEdgeWeightsStorage()
Constructor.
Definition: MSEdgeWeightsStorage.cpp:30
ValueTimeLine.h
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSEdgeWeightsStorage::addEffort
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
Definition: MSEdgeWeightsStorage.cpp:82
MSEdgeWeightsStorage
A storage for edge travel times and efforts.
Definition: MSEdgeWeightsStorage.h:43
MSEdgeWeightsStorage::knowsTravelTime
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
Definition: MSEdgeWeightsStorage.cpp:113
MSEdgeWeightsStorage::myEfforts
std::map< const MSEdge *, ValueTimeLine< double > > myEfforts
A map of edge->time->effort.
Definition: MSEdgeWeightsStorage.h:120
MSEdgeWeightsStorage::retrieveExistingTravelTime
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
Definition: MSEdgeWeightsStorage.cpp:39
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSEdgeWeightsStorage::removeEffort
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
Definition: MSEdgeWeightsStorage.cpp:104
MSEdgeWeightsStorage::retrieveExistingEffort
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
Definition: MSEdgeWeightsStorage.cpp:54
MSEdgeWeightsStorage::addTravelTime
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
Definition: MSEdgeWeightsStorage.cpp:69
MSEdgeWeightsStorage::operator=
MSEdgeWeightsStorage & operator=(const MSEdgeWeightsStorage &)
Invalidated assignment operator.
config.h
MSEdgeWeightsStorage::~MSEdgeWeightsStorage
~MSEdgeWeightsStorage()
Destructor.
Definition: MSEdgeWeightsStorage.cpp:34
MSEdgeWeightsStorage::removeTravelTime
void removeTravelTime(const MSEdge *const e)
Removes the travel time information for an edge.
Definition: MSEdgeWeightsStorage.cpp:95
MSEdgeWeightsStorage::myTravelTimes
std::map< const MSEdge *, ValueTimeLine< double > > myTravelTimes
A map of edge->time->travel time.
Definition: MSEdgeWeightsStorage.h:117