Download server/tasks/base.py from TheRubberDuckDebuggers/cascade-containment: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/spaces/TheRubberDuckDebuggers/cascade-containment/resolve/main/server/tasks/base.py
- Command line
-
hf download hf://spaces/TheRubberDuckDebuggers/cascade-containment/server/tasks/base.py
-
curl -L -o base.py https://huggingface.co/spaces/TheRubberDuckDebuggers/cascade-containment/resolve/main/server/tasks/base.py
599 Bytes
| import sys | |
| import os | |
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) | |
| from abc import ABC, abstractmethod | |
| from models import CityState | |
| class BaseTask(ABC): | |
| name: str | |
| num_districts: int | |
| max_steps: int | |
| resource_pool: int | |
| data_lag_days: int | |
| def build_initial_state(self) -> CityState: | |
| """Return a fresh CityState for a new episode. Called by environment.reset().""" | |
| ... | |
| def __repr__(self) -> str: | |
| return f"Task(name={self.name}, districts={self.num_districts}, steps={self.max_steps})" | |