fix a small bug in computer_13 action space

This commit is contained in:
rhythmcao
2024-06-11 14:22:31 +08:00
parent 1c50770817
commit c121869219
2 changed files with 2 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ class PythonController:
return
action_type = action["action_type"]
parameters = action["parameters"] if "parameters" in action else {}
parameters = action["parameters"] if "parameters" in action else {param: action[param] for param in action if param != 'action_type'}
move_mode = random.choice(
["pyautogui.easeInQuad", "pyautogui.easeOutQuad", "pyautogui.easeInOutQuad", "pyautogui.easeInBounce",
"pyautogui.easeInElastic"])

View File

@@ -236,7 +236,7 @@ class DesktopEnv(gym.Env):
info = {}
# handle the special actions
if action in ['WAIT', 'FAIL', 'DONE']:
if action in ['WAIT', 'FAIL', 'DONE'] or (type(action) == dict and action['action_type'] in ['WAIT', 'FAIL', 'DONE']):
if action == 'WAIT':
time.sleep(pause)
elif action == 'FAIL':