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.org/sumo
3 // Copyright (C) 2001-2018 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 /****************************************************************************/
19 // A basic edge for routing applications
20 /****************************************************************************/
21 #ifndef ROMAEdge_h
22 #define ROMAEdge_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #include <config.h>
29 
30 #include <string>
31 #include <map>
32 #include <vector>
33 #include <algorithm>
36 #include <router/ROEdge.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class ROLane;
43 class ROVehicle;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
58 class ROMAEdge : public ROEdge {
59 public:
67  ROMAEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
68 
69 
71  virtual ~ROMAEdge();
72 
80  virtual void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");
81 
82  void setFlow(const double begin, const double end, const double flow) {
83  myFlow.add(begin, end, flow);
84  }
85 
86  double getFlow(const double time) const {
87  return myFlow.getValue(time);
88  }
89 
90  void setHelpFlow(const double begin, const double end, const double flow) {
91  myHelpFlow.add(begin, end, flow);
92  }
93 
94  double getHelpFlow(const double time) const {
95  return myHelpFlow.getValue(time);
96  }
97 
98 private:
99  std::set<ROMAEdge*> myLeftTurns;
102 
103 private:
105  ROMAEdge(const ROMAEdge& src);
106 
108  ROMAEdge& operator=(const ROMAEdge& src);
109 
110 };
111 
112 
113 #endif
114 
115 /****************************************************************************/
ValueTimeLine< double > myHelpFlow
Definition: ROMAEdge.h:101
A single lane the router may use.
Definition: ROLane.h:50
std::set< ROMAEdge * > myLeftTurns
Definition: ROMAEdge.h:99
ROMAEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition: ROMAEdge.cpp:34
void add(double begin, double end, T value)
Adds a value for a time interval into the container.
Definition: ValueTimeLine.h:62
A vehicle as used by router.
Definition: ROVehicle.h:53
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition: ROMAEdge.cpp:44
T getValue(double time) const
Returns the value for the given time.
Definition: ValueTimeLine.h:96
void setHelpFlow(const double begin, const double end, const double flow)
Definition: ROMAEdge.h:90
void setFlow(const double begin, const double end, const double flow)
Definition: ROMAEdge.h:82
ValueTimeLine< double > myFlow
Definition: ROMAEdge.h:100
A basic edge for routing applications.
Definition: ROEdge.h:72
virtual ~ROMAEdge()
Destructor.
Definition: ROMAEdge.cpp:39
ROMAEdge & operator=(const ROMAEdge &src)
Invalidated assignment operator.
double getHelpFlow(const double time) const
Definition: ROMAEdge.h:94
double getFlow(const double time) const
Definition: ROMAEdge.h:86
Base class for nodes used by the router.
Definition: RONode.h:46
A basic edge for routing applications.
Definition: ROMAEdge.h:58