Commit b55e9900 authored by Federico Ciuffardi's avatar Federico Ciuffardi
Browse files

some comments to start frontier-critic algorithm

parent 9f38d42e
#include "DisMapIC.h"
DisMapIC::DisMapIC(Map* m, vector<cell_type> obstructed_types){
DisMapIC::DisMapIC(Map* m, vector<cell_type> obstructed_types, pos_set* frontiers){
this->m = m;
this->obstructed_types = obstructed_types;
this->frontiers = frontiers;
// CellData
......@@ -48,6 +49,11 @@ bool DisMapIC::valid(CellData cd){
return false;
void DisMapIC::save_frontier_old_sources(pos frontier){
frontiers_old_sources[frontier] = cell_data[frontier].sources;
void DisMapIC::process_lower(pos p) {
CellData& p_cd = cell_data[p];
......@@ -55,6 +55,14 @@ class DisMapIC{
pos_set voro_to_false;
pos_set voro_to_true;
//specific for critical distance map, incremental set that has all the frontiers
pos_set* frontiers;
//boost::unordered_map<pos, pos_set> frontiers_old_sources;
//pos_set new_frontiers;
//void save_frontier_old_sources(pos frontier);
void update_distance_map(pos_set source_to_true, pos_set source_to_false);
DisMapIC(Map* m, vector<cell_type> obstructed_types);
DisMapIC(Map* m, vector<cell_type> obstructed_types, pos_set* frontiers);
......@@ -697,11 +697,34 @@ void GVDIC::update_possible_crit(pos_set to_add_gvd, pos_set to_erase_gvd) {
// pcrit distance map
void GVDIC::update_possible_crit_distance_map(){
// update frontiers
/*disMapIC->frontiers.insert(frontier_to_true.begin(), frontier_to_true.end());
for(auto it = frontier_to_false.begin(); it != frontier_to_false.end(); it++){
pos frontier = *it;
// erase frontiers, so they are no longer consider for the recognition of new critics
//disMapIC->save_frontier_old_source(f_pos); should be already saved from last iteration??
//cout<<"posibles criticos "<<possible_crit_to_true<<endl;
//cout<<"ex posibles criticos "<<possible_crit_to_false<<endl;
/*void GVDIC::update_crit(){
//old crits
//for each frontier_to_false and frontier changed remove frontier from old sources
//delete from crit frontiers
// if no longer crit then
//delete from crit
//delete from old_source frontier the ones in frontier_to_false
//new crits
//for each forntier that changed
//add crit or update crit
......@@ -743,6 +766,7 @@ boost::tuple<criticals_info, GVD> GVDIC::get_points_of_interest(grid gt) {
// print_property(possible_crit,gt);
// post increment
old_gt = gt;
......@@ -752,7 +776,7 @@ boost::tuple<criticals_info, GVD> GVDIC::get_points_of_interest(grid gt) {
m = new Map();
disMapIC = new DisMapIC(m,{Occupied,Unknown});
disMapIC = new DisMapIC(m,{Occupied,Unknown}, &frontiers);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment