Skip to content

Commit

Permalink
fix: improve robustness of agent arrangement (#122)
Browse files Browse the repository at this point in the history
* fix: improve robustness of agent arrangement

issued #121
  • Loading branch information
LingweiMeng authored Jun 8, 2022
1 parent 4308351 commit 6601750
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Binary file added arknights_mower/resources/arrange_empty_room.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions arknights_mower/solvers/base_construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,13 @@ def agent_arrange(self, plan: tp.BasePlan) -> None:
y = (block[0][1]+block[2][1])//2
self.tap((x, y))

# 清空已工作中的干员
if self.find('arrange_clean') is not None:
self.tap_element('arrange_clean')
else:
# 对于只有一个干员的房间,没有清空按钮,需要点击干员清空
self.tap((self.recog.w*0.38, self.recog.h*0.3), interval=0)
# 若不是空房间,则清空工作中的干员
if self.find('arrange_empty_room') is None:
if self.find('arrange_clean') is not None:
self.tap_element('arrange_clean')
else:
# 对于只有一个干员的房间,没有清空按钮,需要点击干员清空
self.tap((self.recog.w*0.38, self.recog.h*0.3), interval=0)

try:
if base_room_list[idx].startswith('dormitory'):
Expand Down

0 comments on commit 6601750

Please # to comment.