Skip to content

Commit

Permalink
Record max_steps in base_agent so that an agent may have different be…
Browse files Browse the repository at this point in the history
…havior when reaching the last step.

PiperOrigin-RevId: 680600677
  • Loading branch information
The android_world Authors committed Oct 1, 2024
1 parent f98dfc2 commit f6e21d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions android_world/agents/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def __init__(
)
self._transition_pause = transition_pause

self._max_steps = None

@property
def transition_pause(self) -> float | None:
return self._transition_pause
Expand All @@ -88,6 +90,9 @@ def env(self) -> interface.AsyncEnv:
def env(self, env: interface.AsyncEnv) -> None:
self._env = env

def set_max_steps(self, max_steps: int) -> None:
self._max_steps = max_steps

def reset(self, go_home: bool = False) -> None:
"""Resets the agent."""
self.env.reset(go_home=go_home)
Expand Down

0 comments on commit f6e21d1

Please sign in to comment.