Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSEdgeWeightsStorage.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A storage for edge travel times and efforts
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
25
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30class MSEdge;
31class SUMOVehicle;
32
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
42public:
45
46
49
50
57 bool retrieveExistingTravelTime(const MSEdge* const e, const double t, double& value) const;
58
59
66 bool retrieveExistingEffort(const MSEdge* const e, const double t, double& value) const;
67
68
75 void addTravelTime(const MSEdge* const e, double begin, double end, double value);
76
77
84 void addEffort(const MSEdge* const e, double begin, double end, double value);
85
86
90 void removeTravelTime(const MSEdge* const e);
91
92
96 void removeEffort(const MSEdge* const e);
97
98
103 bool knowsTravelTime(const MSEdge* const e) const;
104
105
110 bool knowsEffort(const MSEdge* const e) const;
111
112
113private:
115 std::map<const MSEdge*, ValueTimeLine<double> > myTravelTimes;
116
118 std::map<const MSEdge*, ValueTimeLine<double> > myEfforts;
119
120
121private:
124
127
128
129};
A road/street connecting two junctions.
Definition MSEdge.h:77
A storage for edge travel times and efforts.
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
MSEdgeWeightsStorage(const MSEdgeWeightsStorage &)
Invalidated copy constructor.
std::map< const MSEdge *, ValueTimeLine< double > > myTravelTimes
A map of edge->time->travel time.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
MSEdgeWeightsStorage & operator=(const MSEdgeWeightsStorage &)
Invalidated assignment operator.
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
std::map< const MSEdge *, ValueTimeLine< double > > myEfforts
A map of edge->time->effort.
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
void removeTravelTime(const MSEdge *const e)
Removes the travel time information for an edge.
Representation of a vehicle.
Definition SUMOVehicle.h:62