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