Commit 54847e96 authored by  tawada's avatar tawada

Update resolver

parent 55ace496
......@@ -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):
......
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