34 #include <fast_methods/fm/eikonalsolver.hpp>
35 #include <fast_methods/datastructures/fmuntidyqueue.hpp>
58 unsigned int n_neighs = 0;
59 bool stopWavePropagation =
false;
63 grid_->getCell(i).setArrivalTime(0);
68 unsigned int idxMin = 0;
72 grid_->getCell(idxMin).setState(FMState::FROZEN);
74 for (
unsigned int s = 0; s < n_neighs; ++s) {
76 if ( (
grid_->getCell(j).getState() == FMState::FROZEN) ||
grid_->getCell(j).isOccupied())
80 if (
grid_->getCell(j).getState() == FMState::NARROW) {
82 grid_->getCell(j).setArrivalTime(new_arrival_time);
87 grid_->getCell(j).setState(FMState::NARROW);
88 grid_->getCell(j).setArrivalTime(new_arrival_time);
95 stopWavePropagation =
true;
99 virtual void printRunInfo
102 std::cout <<
'\t' <<
name_ <<
'\n'
103 <<
'\t' <<
"Number of buckets: " <<
heap_s_ <<
'\n'
104 <<
'\t' <<
"Maximum increment " <<
heap_inc_ <<
'\n'
105 <<
'\t' <<
"Elapsed time: " <<
time_ <<
" ms\n";
Abstract class that serves as interface for the actual EikonalSolvers implemented. It requires (at least) the computeInternal method to be implemented,.
Fast Marching Method using a untidy priority queue (UFMM).
double time_
Time elapsed by the compute method.
virtual void setup()
Checks that the solver is ready to run. Sets the grid unclean.
Wraps the UntidyQueue implementation by Jerome Piovano
std::array< unsigned int, 2 *grid_t::getNDims()> neighbors_
Auxiliar array which stores the neighbor of each iteration of the computeFM() function.
virtual void clear()
Clears the solver, it is not recommended to be used out of the destructor.
virtual double solveEikonal(const int &idx)
Solves nD Eikonal equation for cell idx. If heuristics are activated, it will add the estimated trave...
FMUntidyQueue< cell_t > * narrow_band_
Heap Instance of the priority queue used.
grid_t * grid_
Grid container.
static void info(const std::string &val)
std::vector< unsigned int > init_points_
Initial index.
std::string name_
Solver name.
static bool isTimeBetterThan(double t1, double t2)
Returns true if t1 is at least epsilon-lower than t2, provides robust comparions for doubles...
virtual void reset()
Clears temporal data, so it is ready to run again.
double heap_inc_
Size (maximum increment) of the heap.
unsigned int goal_idx_
Goal index.
unsigned heap_s_
Number of buckets in the heap.
virtual void computeInternal()
Actual method that implements UFMM.
virtual void reset()
Clears temporal data, so it is ready to run again.