23 #include <unordered_map>
101 double continuity = 1.0;
107 Border* next = it.current()->second;
115 if(successor==0 ||
r<continuity)
176 bool previousCostSet =
false;
177 double previousCost = 0.0;
181 previousCost = previousCostResult->second.getCombinedCost();
182 previousCostSet =
true;
185 double minCost = 0.0;
190 Border* next = it.current()->second;
199 double nextCost = nextCostResult->second.getCombinedCost();
201 if( (previousCostSet && nextCost>=previousCost) || (successor!=0 && nextCost>=minCost) )
continue;
357 m_list.push_back(current);
376 m_list.push_back(current);
397 adoreMatrix<double,4,0> data;
401 for(
auto it =
m_list.begin(); it!=
m_list.end(); it++,it2++ )
403 bool inverted = *it2;
404 int new_count = (*it)->m_path->getData().nc();
405 const adoreMatrix<double>& new_data = (*it)->m_path->getData();
406 for(
int i=0;i<new_count;i++)
409 int idx_combined = i + count;
412 idx_new = new_count - i - 1;
414 for(
int d=1;d<=3;d++)
416 data(d,idx_combined) = new_data(d,idx_new);
424 data(0,i) = data(0,i-1) + std::sqrt( (data(1,i)-data(1,i-1))*(data(1,i)-data(1,i-1))
425 +(data(2,i)-data(2,i-1))*(data(2,i)-data(2,i-1))
426 +(data(3,i)-data(3,i-1))*(data(3,i)-data(3,i-1)) );
This class chooses the successor with the lowest cost until an upper limit on distance is reached.
Definition: borderaccumulator.h:136
BorderCostMap * m_borderID2Cost
Definition: borderaccumulator.h:140
Border * m_current
Definition: borderaccumulator.h:138
virtual void getNextBorder(Border *&border, bool &inverted) override
Get the next border.
Definition: borderaccumulator.h:169
void setContinueOnIncreasingCost(bool value)
set continuation on increasing cost
Definition: borderaccumulator.h:165
double m_distance
Definition: borderaccumulator.h:139
BASFollowNavigation(Border *border, BorderSet *borderSet, BorderCostMap *borderID2Cost, double max_distance)
Construct a new BASFollowNavigation object.
Definition: borderaccumulator.h:151
bool m_continueOnIncreasingCost
Definition: borderaccumulator.h:141
This class chooses the straightest successor of a border until an upper limit on distance is reached.
Definition: borderaccumulator.h:78
double m_distance
Definition: borderaccumulator.h:81
BASFollowStraight(Border *border, BorderSet *borderSet, double max_distance)
Construct a new BASFollowStraight object.
Definition: borderaccumulator.h:91
virtual void getNextBorder(Border *&border, bool &inverted) override
Get the next border.
Definition: borderaccumulator.h:97
Border * m_current
Definition: borderaccumulator.h:80
This class choses the left/right neighbors of a border sequence.
Definition: borderaccumulator.h:231
virtual void getNextBorder(Border *&border, bool &inverted) override
Get the next border.
Definition: borderaccumulator.h:261
BAContainer * m_list
Definition: borderaccumulator.h:234
Direction m_direction
Definition: borderaccumulator.h:245
BAContainer::iterator m_current
Definition: borderaccumulator.h:233
BASNeighbor(BAContainer *list, BorderSet *borderSet, Direction direction)
Construct a new BASNeighbor object.
Definition: borderaccumulator.h:254
Direction
Direction of BorderAccumulator.
Definition: borderaccumulator.h:241
@ LEFT
Definition: borderaccumulator.h:242
@ RIGHT
Definition: borderaccumulator.h:242
This class defines how successors of a border should be chosen.
Definition: borderaccumulator.h:44
BorderSet * m_borderSet
Definition: borderaccumulator.h:46
BorderAccumulationStrategy()
Definition: borderaccumulator.h:49
virtual void getNextBorder(Border *&border, bool &inverted)=0
Get the next border.
bool borderValid(Border *b)
Check whether a border is valid.
Definition: borderaccumulator.h:66
This class collects a sequence of borders, according to chosen BorderAccumulationStrategy.
Definition: borderaccumulator.h:293
BAContainer m_list
Definition: borderaccumulator.h:295
void append(Border *current, bool inverted)
**
Definition: borderaccumulator.h:353
double m_distance
Definition: borderaccumulator.h:297
int m_point_count
Definition: borderaccumulator.h:298
void clear()
Clear the BorderAccumulator.
Definition: borderaccumulator.h:312
adore::mad::LLinearPiecewiseFunctionM< double, 3 > function_type
Definition: borderaccumulator.h:300
BorderAccumulator(BorderAccumulationStrategy *bas)
Construct a new Border Accumulator object and initialize it with a BorderAccumulationStrategy.
Definition: borderaccumulator.h:325
BorderAccumulator()
Construct a new BorderAccumulator object and do an empty initialization.
Definition: borderaccumulator.h:305
void append(BorderAccumulationStrategy *bas)
Accumulate the data from the BorderAccumulationStrategy.
Definition: borderaccumulator.h:366
std::vector< bool > m_list_inverted
Definition: borderaccumulator.h:296
BAContainer * getBorders()
Get the Accumulated Borders.
Definition: borderaccumulator.h:386
void defineFunction(function_type &f)
Create (with new) a function, which contains all accumulated border paths.
Definition: borderaccumulator.h:395
Definition: bordercostmap.h:31
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
bool isConnected(const BorderID &a, const BorderID &b)
check whether end of border a is beginning of border b
Definition: borderset.h:1381
bool borderTypeValid(Border *b)
check whether border type is in allowed types of set
Definition: borderset.h:204
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
std::vector< Border * > BAContainer
Definition: borderaccumulator.h:35
r
Definition: adore_suppress_lanechanges.py:209
Definition: areaofeffectconverter.h:20
The border struct contains data of the smallest.
Definition: border.h:62
@ OPPOSITE_DIRECTION
Definition: border.h:507
Tborderpath * m_path
Definition: border.h:70
Direction getNeighborDirection()
Get the direction of the left neighbor.
Definition: border.h:517
double getLength()
Get the length of the border.
Definition: border.h:703
BorderID m_id
Definition: border.h:68
double getContinuityRating(Border *next)
Get the continuity rating.
Definition: border.h:803
BorderID * m_left
Definition: border.h:69
T1 & current()
Definition: borderset.h:50