Improve: fix bugs; add back the cursor in screenshot; add pause in env.step

This commit is contained in:
Timothyxxx
2023-12-02 22:14:50 +08:00
parent e51ef4b91d
commit 487fb8005b
5 changed files with 36 additions and 6 deletions

View File

@@ -85,10 +85,13 @@ class DesktopEnv(gym.Env):
observation = self._get_obs()
return observation
def step(self, action):
def step(self, action, pause=0.5):
# todo: support both the action space of our-designed space and the executable code space in pyautogui
# Our action space is the set of all possible python commands insides `pyautogui`
self.controller.execute_python_command(action)
# todo: maybe for the better here we need to add a logic to wait until the rendering is done
time.sleep(pause)
observation = self._get_obs()
reward = 0 # todo: Define reward calculation for each example
done = False # todo: Define episode termination condition for each example