SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ROMAEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
11 // A basic edge for routing applications
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 #ifndef ROMAEdge_h
25 #define ROMAEdge_h
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <string>
38 #include <map>
39 #include <vector>
40 #include <algorithm>
43 #include <router/ROEdge.h>
44 
45 
46 // ===========================================================================
47 // class declarations
48 // ===========================================================================
49 class ROLane;
50 class ROVehicle;
51 
52 
53 // ===========================================================================
54 // class definitions
55 // ===========================================================================
65 class ROMAEdge : public ROEdge {
66 public:
74  ROMAEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
75 
76 
78  virtual ~ROMAEdge();
79 
87  virtual void addSuccessor(ROEdge* s, std::string dir = "");
88 
89  void setFlow(const SUMOReal begin, const SUMOReal end, const SUMOReal flow) {
90  myFlow.add(begin, end, flow);
91  }
92 
93  SUMOReal getFlow(const SUMOReal time) const {
94  return myFlow.getValue(time);
95  }
96 
97  void setHelpFlow(const SUMOReal begin, const SUMOReal end, const SUMOReal flow) {
98  myHelpFlow.add(begin, end, flow);
99  }
100 
101  SUMOReal getHelpFlow(const SUMOReal time) const {
102  return myHelpFlow.getValue(time);
103  }
104 
105 private:
106  std::set<ROMAEdge*> myLeftTurns;
109 
110 private:
112  ROMAEdge(const ROMAEdge& src);
113 
115  ROMAEdge& operator=(const ROMAEdge& src);
116 
117 };
118 
119 
120 #endif
121 
122 /****************************************************************************/
A single lane the router may use.
Definition: ROLane.h:57
SUMOReal getFlow(const SUMOReal time) const
Definition: ROMAEdge.h:93
std::set< ROMAEdge * > myLeftTurns
Definition: ROMAEdge.h:106
void setFlow(const SUMOReal begin, const SUMOReal end, const SUMOReal flow)
Definition: ROMAEdge.h:89
ValueTimeLine< SUMOReal > myHelpFlow
Definition: ROMAEdge.h:108
ROMAEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition: ROMAEdge.cpp:45
void add(SUMOReal begin, SUMOReal end, T value)
Adds a value for a time interval into the container.
Definition: ValueTimeLine.h:69
virtual void addSuccessor(ROEdge *s, std::string dir="")
Adds information about a connected edge.
Definition: ROMAEdge.cpp:55
ValueTimeLine< SUMOReal > myFlow
Definition: ROMAEdge.h:107
A vehicle as used by router.
Definition: ROVehicle.h:60
void setHelpFlow(const SUMOReal begin, const SUMOReal end, const SUMOReal flow)
Definition: ROMAEdge.h:97
T getValue(SUMOReal time) const
Returns the value for the given time.
A basic edge for routing applications.
Definition: ROEdge.h:77
SUMOReal getHelpFlow(const SUMOReal time) const
Definition: ROMAEdge.h:101
virtual ~ROMAEdge()
Destructor.
Definition: ROMAEdge.cpp:50
ROMAEdge & operator=(const ROMAEdge &src)
Invalidated assignment operator.
#define SUMOReal
Definition: config.h:214
Base class for nodes used by the router.
Definition: RONode.h:53
A basic edge for routing applications.
Definition: ROMAEdge.h:65