From 99fc0158b0b985590f49f0a2f69695fd723c6c4a Mon Sep 17 00:00:00 2001 From: ydy0615 Date: Sun, 28 Dec 2025 09:39:20 +0800 Subject: [PATCH] feat: add fallback to pretend_list in plan_next_actions logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the decision flow in `plan_next_actions` to consider the `pretend_list` when no suitable target is found in `regard_list` within the 10‑unit time threshold. The new fallback selects a destination from `pretend_list` if its travel time is under 8 units, improving target selection robustness. --- CTF/backend/mypolicy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CTF/backend/mypolicy.py b/CTF/backend/mypolicy.py index f740faf..7439115 100644 --- a/CTF/backend/mypolicy.py +++ b/CTF/backend/mypolicy.py @@ -222,6 +222,10 @@ def plan_next_actions(req): f,lentime = myMap.closest_in_range(p["posX"],p["posY"],regard_list) if f is not None and lentime<=10: dest = (f[0],f[1]) + else : + f,lentime = myMap.closest_in_range(p["posX"],p["posY"],pretend_list) + if f is not None and lentime<8: + dest = (f[0],f[1]) else: f,temp = myMap.closest_in_range(p["posX"],p["posY"],regard_list) if f is not None: