ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
conflictset.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Daniel Heß - initial API and implementation
13  ********************************************************************************/
14 
15 
16 #pragma once
17 #include <vector>
18 #include "trafficobject.h"
19 #include "limitline.h"
20 
21 namespace adore
22 {
23 namespace view
24 {
31 {
32 private:
33  double startProgress_;
34  double endProgress_;
37  bool hasPriority_;
40 public:
42  {
45  hasEndProgress_ = false;
46  hasPriority_ = true;
47  }
51  double getStartProgress() const
52  {
53  return startProgress_;
54  }
58  double getEndProgress() const
59  {
60  return endProgress_;
61  }
65  bool hasEndProgress() const
66  {
67  return hasEndProgress_;
68  }
72  double getWaitingPosition() const
73  {
74  return waitingPosition_;
75  }
79  bool hasPriority() const
80  {
81  return hasPriority_;
82  }
83  /*
84  * getCrossTraffic - returns a set of traffic objects approaching the conflict zone with higher priority.
85  * The AV has to yield to cross traffic, before entering a conflict zone.
86  * Cross traffic is ordered by EntranceTime.
87  */
89  {
90  return &crossTraffic_;
91  }
95  const LimitLine &getLimitLine() const
96  {
97  return limitLine_;
98  }
99 
100 public:
101  void setStartProgress(double value)
102  {
103  startProgress_ = value;
104  }
105  void setEndProgress(double value)
106  {
107  endProgress_ = value;
108  }
109  void setHasEndProgress(bool value)
110  {
111  hasEndProgress_ = value;
112  }
113  void setWaitingPosition(double value)
114  {
115  waitingPosition_ = value;
116  }
121  void setPriority(bool value)
122  {
123  hasPriority_ = value;
124  }
125  void setCrossTraffic(TrafficQueue &trafficqueue)
126  {
127  crossTraffic_ = trafficqueue;
128  }
129  void setLimitLine(LimitLine &limitline)
130  {
131  limitLine_ = limitline;
132  }
133 };
135 {
136 public:
137 
138  ConflictArea() = default;
139  // TODO investigate if calling delete on derived classes will cause memory leaks
140  virtual ~ConflictArea() = default; // -Wdelete-non-virtual-dtor
141 
142  virtual unsigned int getNumberOfConflictZones() const = 0;
143 
148  virtual double getStartProgress() const=0;
149 
153  virtual double getEndProgress() const=0;
154 
158  virtual bool hasEndProgress() const=0;
159 
163  virtual double getWaitingPosition() const=0;
164 
169  virtual std::vector<ConflictZone*> getConflictZones() const = 0;
170 };
176 {
177 public:
181  virtual bool isValid() const = 0;
186  virtual std::vector<ConflictArea*> getConflictAreas() const = 0; // TODO
187 };
188 } // namespace view
189 } // namespace adore
Definition: conflictset.h:135
virtual double getStartProgress() const =0
virtual ~ConflictArea()=default
virtual double getWaitingPosition() const =0
virtual unsigned int getNumberOfConflictZones() const =0
virtual double getEndProgress() const =0
virtual std::vector< ConflictZone * > getConflictZones() const =0
virtual bool hasEndProgress() const =0
Definition: conflictset.h:176
virtual std::vector< ConflictArea * > getConflictAreas() const =0
virtual bool isValid() const =0
Definition: conflictset.h:31
void setWaitingPosition(double value)
Definition: conflictset.h:113
void setCrossTraffic(TrafficQueue &trafficqueue)
Definition: conflictset.h:125
TrafficQueue * getCrossTraffic()
Definition: conflictset.h:88
bool hasEndProgress() const
Definition: conflictset.h:65
double waitingPosition_
Definition: conflictset.h:36
bool hasPriority_
Definition: conflictset.h:37
bool hasEndProgress_
Definition: conflictset.h:35
const LimitLine & getLimitLine() const
Definition: conflictset.h:95
double startProgress_
Definition: conflictset.h:33
TrafficQueue crossTraffic_
Definition: conflictset.h:38
ConflictZone()
Definition: conflictset.h:41
void setPriority(bool value)
Definition: conflictset.h:121
void setLimitLine(LimitLine &limitline)
Definition: conflictset.h:129
double endProgress_
Definition: conflictset.h:34
LimitLine limitLine_
Definition: conflictset.h:39
double getWaitingPosition() const
Definition: conflictset.h:72
void setStartProgress(double value)
Definition: conflictset.h:101
void setEndProgress(double value)
Definition: conflictset.h:105
double getEndProgress() const
Definition: conflictset.h:58
double getStartProgress() const
Definition: conflictset.h:51
void setHasEndProgress(bool value)
Definition: conflictset.h:109
bool hasPriority() const
Definition: conflictset.h:79
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
adoreMatrix< T, N, M > max(adoreMatrix< T, N, M > a, const adoreMatrix< T, N, M > &b)
Definition: adoremath.h:686
std::vector< TrafficObject > TrafficQueue
Definition: trafficobject.h:183
Definition: areaofeffectconverter.h:20
Definition: limitline.h:26