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

comments and bug fix in DisMapIC

parent 605d18e7
......@@ -120,7 +120,7 @@ void DisMapIC::process_raise(pos p) {
if (min_d < MAXFLOAT) {
p_cd.dist = min_d;
p_cd.parents.clear();
p_cd.parents.insert(p_closest_sources.begin(), p_closest_sources.end());
p_cd.parents.insert(p_parents.begin(), p_parents.end());
p_cd.sources.clear();
p_cd.sources.insert(p_closest_sources.begin(), p_closest_sources.end());
p_cd.is_cleared = false;
......@@ -146,8 +146,8 @@ void DisMapIC::set_consistent_borders(vector<pos> obstructed_to_free) {
}
}
}
//std::cout << "consistent borders" << endl;
//print_property(inserted, m->g);
std::cout << "consistent borders" << endl;
print_property(inserted, m->g);
}
void DisMapIC::set_source(pos p) {
......@@ -177,9 +177,10 @@ void DisMapIC::obstruct(pos p) {
void DisMapIC::update_distance_map(pos_set source_to_true, pos_set source_to_false){
vector<pos> obstructed_to_free,free_to_obstructed;
// set obstructed_to_free and free_to_obstructed
for(auto it = m->changes.begin(); it!=m->changes.end(); it++){
pos p = it->first;
// source status changes and obstruction status change are mutally exclusive
// source status changes and obstruction status change should be (?) mutally exclusive
// and source status changes have priority
if(is_elem(source_to_false,p) || is_elem(source_to_true,p)){
continue;
......
......@@ -4,6 +4,7 @@ cell_type& Map::operator[](pos p){
return cell(g,p);
}
// updates the map representation and the changes are stored in the changes map
void Map::update(grid g) {
this->changes.clear();
int mapWidth = g.size();
......
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