Skip to content

Commit

Permalink
fix: plan_fia logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed May 30, 2023
1 parent 27c313c commit 8be705f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,18 @@ def plan_fia(self):
# 排序
candidate_lst.sort(key=lambda x: (x.mood - x.lower_limit) / (x.upper_limit - x.lower_limit), reverse=False)
print(candidate_lst)
print(last_candidate)
name = candidate_lst[0].name
# 只有主要充能干员心情在20以上才会考虑额外干员
if plan_last and candidate_lst[0].current_mood() >= 20:
if (plan_last or candidate_lst[0].current_mood() >= 20) and not last_candidate.current_room.startswith("dorm"):
mood = last_candidate.current_mood()
is_lowest = 20 <= mood < candidate_lst[0].current_mood()
logger.debug(f'{last_candidate.name},mood:{mood}')
if self.op_data.predict_fia(copy.deepcopy(candidate_lst), mood):
name = last_candidate.name
if is_lowest:
if plan_last and self.op_data.predict_fia(copy.deepcopy(candidate_lst), mood):
name = last_candidate.name
elif not plan_last :
name = last_candidate.name
self.tasks.append(SchedulerTask(time=current_time, task_plan={fia_room: [name, '菲亚梅塔']}))

def plan_metadata(self):
Expand Down Expand Up @@ -658,7 +663,7 @@ def get_resting_plan(self, agents, exist_replacement, plan, high_free, low_free)
else:
_high += 1
# 排序
agents.sort(key=lambda x: self.op_data.operators[x].current_mood() - self.op_data.operators[x].lower_limit,
agents.sort(key=lambda y: self.op_data.operators[y].current_mood() - self.op_data.operators[y].lower_limit,
reverse=False)
# 进行位置数量的初步判定
# 对于252可能需要进行额外判定,由于 low_free 性质等同于 high_free
Expand Down Expand Up @@ -1518,7 +1523,7 @@ def get_agent_from_room(self, room, read_time_index=None):
time.sleep(3)
self.recog.update()
clue_res = self.read_screen(self.recog.img, limit=10, cord=(645, 977, 755, 1018))
if clue_res != -1:
if clue_res != 11:
self.clue_count = clue_res
logger.info(f'当前拥有线索数量为{self.clue_count}')
while self.find('room_detail') is None:
Expand Down

0 comments on commit 8be705f

Please sign in to comment.