Skip to content

Commit

Permalink
Improves doc for ActionType.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 621948044
  • Loading branch information
DeepMind authored and copybara-github committed Apr 5, 2024
1 parent 0ad20a3 commit 9b1cdd5
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions android_env/components/action_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b1cdd5

Please sign in to comment.