Eclipse SUMO - Simulation of Urban MObility
ROMAEdge.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 /****************************************************************************/
22 // A basic edge for routing applications
23 /****************************************************************************/
24 #pragma once
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
29 #include <vector>
30 #include <algorithm>
33 #include <router/ROEdge.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class ROLane;
40 class ROVehicle;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
55 class ROMAEdge : public ROEdge {
56 public:
64  ROMAEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
65 
66 
68  virtual ~ROMAEdge();
69 
77  virtual void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");
78 
79  void setFlow(const double begin, const double end, const double flow) {
80  myFlow.add(begin, end, flow);
81  }
82 
83  double getFlow(const double time) const {
84  return myFlow.getValue(time);
85  }
86 
87  void setHelpFlow(const double begin, const double end, const double flow) {
88  myHelpFlow.add(begin, end, flow);
89  }
90 
91  double getHelpFlow(const double time) const {
92  return myHelpFlow.getValue(time);
93  }
94 
95 private:
96  std::set<ROMAEdge*> myLeftTurns;
99 
100 private:
102  ROMAEdge(const ROMAEdge& src);
103 
106 
107 };
A basic edge for routing applications.
Definition: ROEdge.h:70
A single lane the router may use.
Definition: ROLane.h:48
A basic edge for routing applications.
Definition: ROMAEdge.h:55
double getHelpFlow(const double time) const
Definition: ROMAEdge.h:91
virtual ~ROMAEdge()
Destructor.
Definition: ROMAEdge.cpp:37
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition: ROMAEdge.cpp:42
void setFlow(const double begin, const double end, const double flow)
Definition: ROMAEdge.h:79
double getFlow(const double time) const
Definition: ROMAEdge.h:83
ValueTimeLine< double > myHelpFlow
Definition: ROMAEdge.h:98
ROMAEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition: ROMAEdge.cpp:32
ValueTimeLine< double > myFlow
Definition: ROMAEdge.h:97
void setHelpFlow(const double begin, const double end, const double flow)
Definition: ROMAEdge.h:87
ROMAEdge(const ROMAEdge &src)
Invalidated copy constructor.
ROMAEdge & operator=(const ROMAEdge &src)
Invalidated assignment operator.
std::set< ROMAEdge * > myLeftTurns
Definition: ROMAEdge.h:96
Base class for nodes used by the router.
Definition: RONode.h:43
A vehicle as used by router.
Definition: ROVehicle.h:50
T getValue(double time) const
Returns the value for the given time.
Definition: ValueTimeLine.h:93
void add(double begin, double end, T value)
Adds a value for a time interval into the container.
Definition: ValueTimeLine.h:59