From 7a983db5e879279f529963ff619bec60becb999e Mon Sep 17 00:00:00 2001 From: The android_world Authors Date: Tue, 22 Oct 2024 10:25:57 -0700 Subject: [PATCH] Add real device simulator to AndroidEnv loader. PiperOrigin-RevId: 688601471 --- android_world/agents/random_agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android_world/agents/random_agent.py b/android_world/agents/random_agent.py index 785ea0c..d045052 100644 --- a/android_world/agents/random_agent.py +++ b/android_world/agents/random_agent.py @@ -68,6 +68,8 @@ def _generate_random_action( action_details['text'] = ''.join( random.choices(text_characters, k=10) ) # Random text of length 10 + elif action_type == json_action.SWIPE: + action_details['direction'] = random.choice(scroll_directions) elif action_type == json_action.SCROLL: action_details['direction'] = random.choice(scroll_directions)