ver Jan31st

merged from main to zdy
This commit is contained in:
David Chang
2024-01-31 10:55:58 +08:00
93 changed files with 3252 additions and 304 deletions

24
main.py
View File

@@ -3,6 +3,7 @@ import json
import logging
import os
import sys
import time
from desktop_env.envs.desktop_env import DesktopEnv
@@ -59,14 +60,14 @@ def human_agent():
done = False
trajectory = [
{
"action_type": "MOVE_TO",
"parameters": {
"x": 754,
"y": 1057
}
},
{"action_type": "CLICK", "parameters": {"button": "right", "num_clicks": 1}}
# {
# "action_type": "MOVE_TO",
# "parameters": {
# "x": 754,
# "y": 1057
# }
# },
# {"action_type": "CLICK", "parameters": {"button": "right", "num_clicks": 1}}
]
for i in range(len(trajectory)):
@@ -90,13 +91,14 @@ def human_agent():
logger.info("The episode is done.")
break
#input("PAUSING")
input("Press Enter to start human operation...")
human_start_time = time.time()
input("Press Enter to finish human operation.")
print("Time elapsed of human operation: %.2f" % (time.time() - human_start_time))
result = env.evaluate()
logger.info("Result: %.2f", result)
#input("PAUSING")
# env.close()
logger.info("Environment closed.")