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
Grégoire Grzeczkowicz
sho
Commits
4ee87a0f
Commit
4ee87a0f
authored
Nov 01, 2020
by
Grégoire Grzeczkowicz
Browse files
Penalize wrong solution
parent
9cb5952a
Changes
1
Hide whitespace changes
Inline
Side-by-side
sho/num.py
View file @
4ee87a0f
...
...
@@ -32,6 +32,13 @@ def cover_sum(sol, domain_width, sensor_range, dim):
cov
=
pb
.
coverage
(
domain
,
sensors
,
sensor_range
*
domain_width
)
s
=
np
.
sum
(
cov
)
assert
(
s
>=
len
(
sensors
))
if
len
(
sol
)
>
dim
:
s
*=
0.5
for
v
in
sol
:
if
v
<
0
:
s
+=
v
/
domain_width
if
v
>=
domain_width
:
s
-=
(
v
-
domain_width
)
/
domain_width
return
s
...
...
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