Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
adc2018-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
adc2018
adc2018-system
Commits
54847e96
Commit
54847e96
authored
Aug 09, 2018
by
tawada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update resolver
parent
55ace496
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
resolver.py
resolver/resolver.py
+6
-2
No files found.
resolver/resolver.py
View file @
54847e96
...
...
@@ -156,7 +156,7 @@ class MAP:
return
points
[
e
]
def
isblank
(
self
,
points
):
"""
空白
"""
"""
座標リストのうちラインで埋まっている座標をTrue, ラインで埋まっている座標をFalseとして返す
"""
l
=
np
.
array
([],
dtype
=
bool
)
for
point
in
points
:
if
self
.
map
[
tuple
(
point
)]
==
0
:
...
...
@@ -166,6 +166,7 @@ class MAP:
return
points
[
l
]
def
istip
(
self
,
points
):
"""不明:線を伸ばしているとき, 注目している点がその先端かどうかを返す"""
l
=
np
.
array
([],
dtype
=
bool
)
for
point
in
points
:
nlist
=
self
.
neighbour
(
point
)
...
...
@@ -220,19 +221,22 @@ class MAP:
self
.
map
[
self
.
map
==
n_line
]
=
0
q
=
[]
#コスト, 座標, ラインが引かれた方向
heapq
.
heappush
(
q
,
(
0
,
self
.
line
[
i
][
0
],
[
0
,
0
,
0
]))
while
True
:
if
q
==
[]:
break
(
priority
,
point
,
direction
)
=
heapq
.
heappop
(
q
)
if
point
==
self
.
line
[
i
][
1
]:
break
next_points
=
point
+
dlist
boollist
=
isregular
(
next_points
)
for
n
,
d
in
zip
(
next_points
[
boollist
],
dlist
[
boollist
]):
if
self
.
map
[
tuple
(
n
)]
!=
0
:
continue
if
len
(
isregular
(
next_point
))
==
0
:
continue
if
np
.
array_equal
(
direction
,
d
):
i
heapq
.
heappush
((
priority
+
1
))
def
generate
(
self
,
linenum
,
maxlength
):
...
...
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