""" base_task.py — Abstract base class for all USAR tasks. """ from __future__ import annotations from abc import ABC, abstractmethod from typing import Tuple from ..models import ( GradeResult, ResetResult, StepResult, TaskInfo, USARAction, ) class BaseUSARTask(ABC): """All USAR tasks inherit from this.""" @property @abstractmethod def name(self) -> str: ... @property @abstractmethod def difficulty(self) -> str: ... @property @abstractmethod def threshold(self) -> float: ... @property @abstractmethod def max_steps(self) -> int: ... @abstractmethod def reset(self, seed: int) -> ResetResult: ... @abstractmethod def step(self, action: USARAction) -> StepResult: ... @abstractmethod def grade(self) -> GradeResult: ... @abstractmethod def get_info(self) -> TaskInfo: ... @property def done(self) -> bool: return self._done def _set_done(self, val: bool): self._done = val _done: bool = False