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 
69  bool retrieveExistingTravelTime(const MSEdge* const e, const SUMOVehicle* const v,
70  SUMOReal t, SUMOReal& value) const;
71 
72 
80  bool retrieveExistingEffort(const MSEdge* const e, const SUMOVehicle* const v,
81  SUMOReal t, SUMOReal& value) const;
82 
83 
90  void addTravelTime(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value);
91 
92 
99  void addEffort(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value);
100 
101 
105  void removeTravelTime(const MSEdge* const e);
106 
107 
111  void removeEffort(const MSEdge* const e);
112 
113 
118  bool knowsTravelTime(const MSEdge* const e) const;
119 
120 
125  bool knowsEffort(const MSEdge* const e) const;
126 
127 
128 private:
130  std::map<MSEdge*, ValueTimeLine<SUMOReal> > myTravelTimes;
131 
133  std::map<MSEdge*, ValueTimeLine<SUMOReal> > myEfforts;
134 
135 
136 private:
139 
142 
143 
144 };
145 
146 
147 #endif
148 
149 /****************************************************************************/
150 
MSEdgeWeightsStorage()
Constructor.
bool retrieveExistingTravelTime(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t, SUMOReal &value) const
Returns a travel time for an edge and time if stored.
std::map< MSEdge *, ValueTimeLine< SUMOReal > > myEfforts
A map of edge->time->effort.
bool retrieveExistingEffort(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t, SUMOReal &value) const
Returns an effort for an edge and time if stored.
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:73
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
Representation of a vehicle.
Definition: SUMOVehicle.h:63
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
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.
std::map< MSEdge *, ValueTimeLine< SUMOReal > > myTravelTimes
A map of edge->time->travel time.