Commit 9bce1e64 authored by johann dreo's avatar johann dreo
Browse files

fix: less conservative assert

parent 896dd361
...@@ -23,7 +23,7 @@ def to_sensors(sol): ...@@ -23,7 +23,7 @@ def to_sensors(sol):
def cover_sum(sol, domain_width, sensor_range): def cover_sum(sol, domain_width, sensor_range):
"""Compute the coverage quality of the given vector.""" """Compute the coverage quality of the given vector."""
assert(0 < sensor_range <= math.sqrt(2)) assert(0 < sensor_range <= domain_width * math.sqrt(2))
assert(0 < domain_width) assert(0 < domain_width)
assert(len(sol)>0) assert(len(sol)>0)
domain = np.zeros((domain_width,domain_width)) domain = np.zeros((domain_width,domain_width))
......
...@@ -21,7 +21,6 @@ def coverage(domain, sensors, sensor_range): ...@@ -21,7 +21,6 @@ def coverage(domain, sensors, sensor_range):
for x in sensors: for x in sensors:
if distance(x,p) < sensor_range: if distance(x,p) < sensor_range:
domain[py][px] = 1 domain[py][px] = 1
break
return domain return domain
......
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