Skip to content

Commit

Permalink
Update task.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jordis-ai2 committed Jul 12, 2024
1 parent 3363fee commit a038b78
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions allenact/base_abstractions/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from allenact.base_abstractions.misc import RLStepResult
from allenact.base_abstractions.sensor import Sensor, SensorSuite
from allenact.utils.misc_utils import deprecated
from allenact.utils.system import get_logger

COMPLETE_TASK_METRICS_KEY = "__AFTER_TASK_METRICS__"
COMPLETE_TASK_CALLBACK_KEY = "__AFTER_TASK_CALLBACK__"
Expand Down Expand Up @@ -607,27 +608,33 @@ def after_step(it, task):
return srs

def reached_max_steps(self) -> bool:
get_logger().warning("Unexpected call to `reached_max_steps` in BatchedTask")
return False

def reached_terminal_state(self) -> bool:
get_logger().warning("Unexpected call to `reached_terminal_state` in BatchedTask")
return False

def is_done(self) -> bool:
return False

def num_steps_taken(self) -> int:
get_logger().warning("Unexpected call to `num_steps_taken` in BatchedTask")
return -1

def close(self) -> None:
self.executor.shutdown(cancel_futures=True)
self.tasks[0].close()

def metrics(self) -> Dict[str, Any]:
get_logger().warning("Unexpected call to `metrics` in BatchedTask")
return {}

def query_expert(self, **kwargs) -> Tuple[Any, bool]:
get_logger().warning("Unexpected call to `query_expert` in BatchedTask")
return None, False

@property
def cumulative_reward(self) -> float:
get_logger().warning("Unexpected call to `cumulative_reward` in BatchedTask")
return 0.0

0 comments on commit a038b78

Please sign in to comment.