Spaces:
Sleeping
Sleeping
| """ | |
| 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.""" | |
| def name(self) -> str: ... | |
| def difficulty(self) -> str: ... | |
| def threshold(self) -> float: ... | |
| def max_steps(self) -> int: ... | |
| def reset(self, seed: int) -> ResetResult: ... | |
| def step(self, action: USARAction) -> StepResult: ... | |
| def grade(self) -> GradeResult: ... | |
| def get_info(self) -> TaskInfo: ... | |
| def done(self) -> bool: | |
| return self._done | |
| def _set_done(self, val: bool): | |
| self._done = val | |
| _done: bool = False | |