From 566b57a1990c6663b599624a5f54cfc81bb54984 Mon Sep 17 00:00:00 2001 From: DeepMind Date: Thu, 4 Apr 2024 13:08:24 -0700 Subject: [PATCH] Improves doc for ActionType. PiperOrigin-RevId: 621948044 --- android_env/components/action_type.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/android_env/components/action_type.py b/android_env/components/action_type.py index 6deca20..da57aa4 100644 --- a/android_env/components/action_type.py +++ b/android_env/components/action_type.py @@ -13,14 +13,37 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""The different kinds of actions that AndroidEnv supports.""" +"""The different kinds of actions that AndroidEnv supports. + +The native action space of AndroidEnv consists of a tuple consisting of +- A position (x, y) ∈ [0, 1] x [0, 1], determining the location of the action on + the screen, and +- A discrete value, indicating the action type, which is in this file. + +See https://arxiv.org/abs/2105.13231, section 2.2 for details. +""" import enum @enum.unique class ActionType(enum.IntEnum): - """Integer values to describe each supported action in AndroidEnv.""" + """Integer values to describe each supported action in AndroidEnv. + + Note for KEY* types: + - Only meaningful if connected to a _physical_ keyboard, _not_ virtual + keyboard. + - Added afterwards so they did not appear in the paper. + + Attributes: + TOUCH: Touching the screen at a location. + LIFE: Lifting the (imaginary) pointer from the screen at a location. + REPEAT: Repeating the last chosen action. + KEYDOWN: Sending a key down event. + KEYUP: Sending a key up event. + KEYPRESS: Sending a key down event, immediately followed by a key up event. + """ + TOUCH = 0 LIFT = 1 REPEAT = 2