Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sielskyi Yevhenii
sho
Commits
9bce1e64
Commit
9bce1e64
authored
Dec 16, 2019
by
johann dreo
Browse files
fix: less conservative assert
parent
896dd361
Changes
2
Hide whitespace changes
Inline
Side-by-side
sho/num.py
View file @
9bce1e64
...
...
@@ -23,7 +23,7 @@ def to_sensors(sol):
def
cover_sum
(
sol
,
domain_width
,
sensor_range
):
"""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
(
len
(
sol
)
>
0
)
domain
=
np
.
zeros
((
domain_width
,
domain_width
))
...
...
sho/pb.py
View file @
9bce1e64
...
...
@@ -21,7 +21,6 @@ def coverage(domain, sensors, sensor_range):
for
x
in
sensors
:
if
distance
(
x
,
p
)
<
sensor_range
:
domain
[
py
][
px
]
=
1
break
return
domain
...
...
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