Eclipse SUMO - Simulation of Urban MObility
ROJTREdge.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2004-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 /****************************************************************************/
20 // An edge the jtr-router may route through
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <string>
26 #include <map>
27 #include <vector>
29 #include <router/ROEdge.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class ROLane;
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
48 class ROJTREdge : public ROEdge {
49 public:
57  ROJTREdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
58 
59 
61  ~ROJTREdge();
62 
63 
74  void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");
75 
76 
84  void addFollowerProbability(ROJTREdge* follower,
85  double begTime, double endTime, double probability);
86 
87 
94  ROJTREdge* chooseNext(const ROVehicle* const veh, double time, const std::set<const ROEdge*>& avoid) const;
95 
96 
100  void setTurnDefaults(const std::vector<double>& defs);
101 
103  int getSourceFlow() const {
104  return mySourceFlows;
105  }
106 
108  void changeSourceFlow(int value) {
109  mySourceFlows += value;
110  }
111 
112 private:
114  typedef std::map<ROJTREdge*, ValueTimeLine<double>*, ComparatorIdLess> FollowerUsageCont;
115 
118 
120  std::vector<double> myParsedTurnings;
121 
123  //ValueTimeLine<int> mySourceFlows;
125 
126 private:
128  ROJTREdge(const ROJTREdge& src);
129 
132 
133 
134 };
A basic edge for routing applications.
Definition: ROEdge.h:70
An edge the jtr-router may route through.
Definition: ROJTREdge.h:48
void changeSourceFlow(int value)
register flow on this edge
Definition: ROJTREdge.h:108
std::map< ROJTREdge *, ValueTimeLine< double > *, ComparatorIdLess > FollowerUsageCont
Definition of a map that stores the probabilities of using a certain follower over time.
Definition: ROJTREdge.h:114
void addFollowerProbability(ROJTREdge *follower, double begTime, double endTime, double probability)
adds the information about the percentage of using a certain follower
Definition: ROJTREdge.cpp:60
void setTurnDefaults(const std::vector< double > &defs)
Sets the turning definition defaults.
Definition: ROJTREdge.cpp:108
ROJTREdge * chooseNext(const ROVehicle *const veh, double time, const std::set< const ROEdge * > &avoid) const
Returns the next edge to use.
Definition: ROJTREdge.cpp:72
FollowerUsageCont myFollowingDefs
Storage for the probabilities of using a certain follower over time.
Definition: ROJTREdge.h:117
ROJTREdge(const ROJTREdge &src)
invalidated copy constructor
int getSourceFlow() const
register source flow on this edge
Definition: ROJTREdge.h:103
ROJTREdge & operator=(const ROJTREdge &src)
invalidated assignment operator
ROJTREdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition: ROJTREdge.cpp:36
int mySourceFlows
the flows departing from this edge in the given time
Definition: ROJTREdge.h:124
void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition: ROJTREdge.cpp:50
~ROJTREdge()
Destructor.
Definition: ROJTREdge.cpp:42
std::vector< double > myParsedTurnings
The defaults for turnings.
Definition: ROJTREdge.h:120
A single lane the router may use.
Definition: ROLane.h:48
Base class for nodes used by the router.
Definition: RONode.h:43
A vehicle as used by router.
Definition: ROVehicle.h:50
Function-object for stable sorting of objects acting like Named without being derived (SUMOVehicle)
Definition: Named.h:30