def get_starting_location(self):
rows_with_points = self.hits.max(axis=1)
max_row = np.nonzero(rows_with_points)[0].max()
# TODO: if max_row == 215, we should exit
row = self.hits[max_row, :]
idx = np.nonzero(row)[0]
col = np.random.choice(idx)
col = np.random.randint(col - 2, col + 2)
loc = [min(STATE.layout.rows - 1, max_row + 10), col]
assert self.max_row <= max_row
self.max_row = max_row
return loc
#def get_starting_location(self):
# rows_with_points = self.hits.max(axis=1)
# max_row = np.nonzero(rows_with_points)[0].max()
# loc = [min(STATE.layout.rows - 1, max_row + 10), np.random.randint(STATE.layout.columns)]
#assert self.max_row <= max_row
#self.max_row = max_row
#return loc
dla.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录