Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Federico Ciuffardi Alves
pgMappingCooperativo
Commits
dd58a917
Commit
dd58a917
authored
Oct 20, 2020
by
Federico Ciuffardi
Browse files
comments and bug fix in DisMapIC
parent
605d18e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/GVD/DisMapIC.cpp
View file @
dd58a917
...
...
@@ -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_source
s
.
end
());
p_cd
.
parents
.
insert
(
p_
parents
.
begin
(),
p_parent
s
.
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
;
...
...
src/lib/GVD/Map.cpp
View file @
dd58a917
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment