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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
21 // A basic edge for routing applications
22 /****************************************************************************/
23 #ifndef ROMAEdge_h
24 #define ROMAEdge_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <map>
38 #include <vector>
39 #include <algorithm>
42 #include <router/ROEdge.h>
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
48 class ROLane;
49 class ROVehicle;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
64 class ROMAEdge : public ROEdge {
65 public:
73  ROMAEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
74 
75 
77  virtual ~ROMAEdge();
78 
86  virtual void addSuccessor(ROEdge* s, std::string dir = "");
87 
88  void setFlow(const double begin, const double end, const double flow) {
89  myFlow.add(begin, end, flow);
90  }
91 
92  double getFlow(const double time) const {
93  return myFlow.getValue(time);
94  }
95 
96  void setHelpFlow(const double begin, const double end, const double flow) {
97  myHelpFlow.add(begin, end, flow);
98  }
99 
100  double getHelpFlow(const double time) const {
101  return myHelpFlow.getValue(time);
102  }
103 
104 private:
105  std::set<ROMAEdge*> myLeftTurns;
108 
109 private:
111  ROMAEdge(const ROMAEdge& src);
112 
114  ROMAEdge& operator=(const ROMAEdge& src);
115 
116 };
117 
118 
119 #endif
120 
121 /****************************************************************************/
ValueTimeLine< double > myHelpFlow
Definition: ROMAEdge.h:107
A single lane the router may use.
Definition: ROLane.h:56
std::set< ROMAEdge * > myLeftTurns
Definition: ROMAEdge.h:105
ROMAEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition: ROMAEdge.cpp:40
void add(double begin, double end, T value)
Adds a value for a time interval into the container.
Definition: ValueTimeLine.h:68
virtual void addSuccessor(ROEdge *s, std::string dir="")
Adds information about a connected edge.
Definition: ROMAEdge.cpp:50
A vehicle as used by router.
Definition: ROVehicle.h:59
T getValue(double time) const
Returns the value for the given time.
void setHelpFlow(const double begin, const double end, const double flow)
Definition: ROMAEdge.h:96
void setFlow(const double begin, const double end, const double flow)
Definition: ROMAEdge.h:88
ValueTimeLine< double > myFlow
Definition: ROMAEdge.h:106
A basic edge for routing applications.
Definition: ROEdge.h:77
virtual ~ROMAEdge()
Destructor.
Definition: ROMAEdge.cpp:45
ROMAEdge & operator=(const ROMAEdge &src)
Invalidated assignment operator.
double getHelpFlow(const double time) const
Definition: ROMAEdge.h:100
double getFlow(const double time) const
Definition: ROMAEdge.h:92
Base class for nodes used by the router.
Definition: RONode.h:52
A basic edge for routing applications.
Definition: ROMAEdge.h:64