17 #include <unordered_map>
85 return this->
f() < other.
f();
89 return this->
f() > other.
f();
115 virtual bool isCostBounded(
double value){
return -1.0e9<value && value<1.0e9;}
219 typedef std::unordered_map<adore::env::BorderBased::BorderID, double, adore::env::BorderBased::BorderIDHasher>
249 std::priority_queue<adore::env::BorderBased::Node, std::vector<adore::env::BorderBased::Node>,
250 std::less<adore::env::BorderBased::Node>>
252 openList.push(*startNode);
255 while (!openList.empty())
257 auto closingNode = openList.top();
259 if (closedList->find(closingNode.m_border->m_id) == closedList->end())
262 std::pair<adore::env::BorderBased::BorderID, double>(closingNode.m_border->m_id, closingNode.g()));
265 while (expansion.hasMore())
267 auto newNode = expansion.getNext();
269 if (closedList->find(newNode.m_border->m_id) == closedList->end())
275 openList.push(newNode);
295 bool search_forward,
bool allow_direction_inversion =
false)
347 bool allow_direction_inversion =
false)
352 allow_direction_inversion);
359 bool allow_direction_inversion =
false)
364 allow_direction_inversion);
Definition: bordergraph.h:108
virtual double getCostGuard()
Definition: bordergraph.h:114
virtual ~ABorderGraphCost()
Definition: bordergraph.h:110
virtual bool isCostBounded(double value)
Definition: bordergraph.h:115
virtual void assign(Node *n)=0
Definition: bordergraph.h:157
BorderGraphCostWithLaneChanges(double laneChangePenalty=100.0)
Definition: bordergraph.h:162
double m_laneChangePenalty
Definition: bordergraph.h:159
void setLaneChangePenalty(double value)
Definition: bordergraph.h:165
virtual void assign(Node *n) override
Definition: bordergraph.h:169
Definition: bordergraph.h:285
Expansion(Node *n, Border *left, Border *right, itCoordinate2Border &it, ABorderGraphCost *cost, bool search_forward, bool allow_direction_inversion=false)
Definition: bordergraph.h:294
std::vector< Border * > m_connectedBorders
Definition: bordergraph.h:290
Node * m_n
Definition: bordergraph.h:288
bool m_search_forward
Definition: bordergraph.h:291
Node getNext()
Definition: bordergraph.h:329
bool hasMore()
Definition: bordergraph.h:325
itCoordinate2Border m_it
Definition: bordergraph.h:287
ABorderGraphCost * m_cost
Definition: bordergraph.h:289
Definition: bordergraph.h:213
Expansion getPredecessors(Node *n, bool left_neighbors=true, bool right_neighbors=true, bool allow_direction_inversion=false)
Definition: bordergraph.h:346
BorderGraph()
Definition: bordergraph.h:222
std::unordered_map< adore::env::BorderBased::BorderID, double, adore::env::BorderBased::BorderIDHasher > BorderCostMap
Definition: bordergraph.h:220
void djikstra(adore::env::BorderBased::Node *startNode, BorderCostMap *closedList)
Definition: bordergraph.h:247
BorderGraph(BorderSet *borderSet, ABorderGraphCost *cost)
Definition: bordergraph.h:229
Expansion getSuccessors(Node *n, bool left_neighbors=true, bool right_neighbors=true, bool allow_direction_inversion=false)
Definition: bordergraph.h:358
void init(BorderSet *borderSet)
Definition: bordergraph.h:236
virtual ~BorderGraph()
Definition: bordergraph.h:232
ABorderGraphCost * m_cost
Definition: bordergraph.h:216
BorderSet * m_borderSet
Definition: bordergraph.h:215
void init(BorderSet *borderSet, ABorderGraphCost *cost)
Definition: bordergraph.h:241
BorderGraph(BorderSet *borderSet)
Definition: bordergraph.h:225
efficiently store borders in boost R-tree
Definition: borderset.h:99
Border * getRightNeighbor(Border *b)
get the right neighbor of a border
Definition: borderset.h:1279
itCoordinate2Border getSuccessors(Border *b)
get an interator pair for all borders which follow after b
Definition: borderset.h:996
Border * getLeftNeighbor(Border *b)
Get left neighbor of a border.
Definition: borderset.h:1252
itCoordinate2Border getPredecessors(Border *b)
get an interator pair for all borders which lead to b
Definition: borderset.h:1017
Definition: bordergraph.h:119
virtual void assign(Node *n) override
Definition: bordergraph.h:121
@ DRIVING
Definition: border.h:39
@ right
Definition: indicator_hint.h:36
@ left
Definition: indicator_hint.h:35
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
Definition: areaofeffectconverter.h:20
a functor, which hashes a BorderID object -> std::unordered_set<BorderID,BorderIDHasher> amap(0);
Definition: borderid.h:176
Coordinate m_last
Definition: borderid.h:32
Coordinate m_first
Definition: borderid.h:32
The border struct contains data of the smallest.
Definition: border.h:62
@ SAME_DIRECTION
Definition: border.h:507
bool isPredecessorOf(const BorderID &successorID)
Check whether border is a direct predecessor of another border.
Definition: border.h:333
bool isContinuousPredecessorOf(Border *other)
Check whether the border is a continuous predecessor of another border.
Definition: border.h:363
Direction getNeighborDirection()
Get the direction of the left neighbor.
Definition: border.h:517
bool isLaneChangeNeighborOf(Border *other)
Check whether the border is a lane-change-neighbor of another border.
Definition: border.h:486
double getLength()
Get the length of the border.
Definition: border.h:703
BorderID m_id
Definition: border.h:68
bool isSuccessorOf(const BorderID &predecessorID)
Check whether border is a direct successors of another border.
Definition: border.h:319
bool isContinuousSuccessorOf(Border *parent)
Check whether the border is a continuous successor of another border.
Definition: border.h:348
double distance(const Coordinate &other) const
Calculate the distance between two Coordinates.
Definition: coordinate.h:133
Definition: bordergraph.h:93
std::size_t operator()(const Node *b) const
Definition: bordergraph.h:99
BorderIDHasher bh
Definition: bordergraph.h:94
std::size_t operator()(const Node &b) const
Definition: bordergraph.h:95
Definition: bordergraph.h:28
double f() const
Definition: bordergraph.h:79
void setPredecessor(Node *predecessor)
Definition: bordergraph.h:67
Node * m_successor
Definition: bordergraph.h:32
void setG(double g)
Definition: bordergraph.h:55
void setBorder(Border *border)
Definition: bordergraph.h:51
double m_g
Definition: bordergraph.h:33
double g() const
Definition: bordergraph.h:71
Node()
Definition: bordergraph.h:45
void setH(double h)
Definition: bordergraph.h:59
double m_h
Definition: bordergraph.h:34
bool operator<(const Node &other) const
Definition: bordergraph.h:83
Node * m_predecessor
Definition: bordergraph.h:31
void setSuccessor(Node *successor)
Definition: bordergraph.h:63
double h() const
Definition: bordergraph.h:75
Node(const Node &value)
Definition: bordergraph.h:37
bool operator>(const Node &other) const
Definition: bordergraph.h:87
Border * m_border
Definition: bordergraph.h:30
Node(Border *border)
Definition: bordergraph.h:48
T1 first
Definition: borderset.h:47
T2 second
Definition: borderset.h:48