Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ROMAEdge.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-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/****************************************************************************/
22// A basic edge for routing applications
23/****************************************************************************/
24#pragma once
25#include <config.h>
26
27#include <string>
28#include <map>
29#include <vector>
30#include <algorithm>
33#include <router/ROEdge.h>
34
35
36// ===========================================================================
37// class declarations
38// ===========================================================================
39class ROLane;
40class ROVehicle;
41
42
43// ===========================================================================
44// class definitions
45// ===========================================================================
55class ROMAEdge : public ROEdge {
56public:
64 ROMAEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
65
66
68 virtual ~ROMAEdge();
69
77 virtual void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");
78
79 void setFlow(const double begin, const double end, const double flow) {
80 myFlow.add(begin, end, flow);
81 }
82
83 double getFlow(const double time) const {
84 return myFlow.getValue(time);
85 }
86
87 void setHelpFlow(const double begin, const double end, const double flow) {
88 myHelpFlow.add(begin, end, flow);
89 }
90
91 double getHelpFlow(const double time) const {
92 return myHelpFlow.getValue(time);
93 }
94
95private:
96 std::set<ROMAEdge*> myLeftTurns;
99
100private:
102 ROMAEdge(const ROMAEdge& src);
103
106
107};
A basic edge for routing applications.
Definition ROEdge.h:72
A single lane the router may use.
Definition ROLane.h:48
A basic edge for routing applications.
Definition ROMAEdge.h:55
ROMAEdge & operator=(const ROMAEdge &src)
Invalidated assignment operator.
double getHelpFlow(const double time) const
Definition ROMAEdge.h:91
virtual ~ROMAEdge()
Destructor.
Definition ROMAEdge.cpp:37
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition ROMAEdge.cpp:42
void setFlow(const double begin, const double end, const double flow)
Definition ROMAEdge.h:79
double getFlow(const double time) const
Definition ROMAEdge.h:83
ValueTimeLine< double > myHelpFlow
Definition ROMAEdge.h:98
ValueTimeLine< double > myFlow
Definition ROMAEdge.h:97
void setHelpFlow(const double begin, const double end, const double flow)
Definition ROMAEdge.h:87
ROMAEdge(const ROMAEdge &src)
Invalidated copy constructor.
std::set< ROMAEdge * > myLeftTurns
Definition ROMAEdge.h:96
Base class for nodes used by the router.
Definition RONode.h:46
A vehicle as used by router.
Definition ROVehicle.h:50
T getValue(double time) const
Returns the value for the given time.
void add(double begin, double end, T value)
Adds a value for a time interval into the container.