File size: 599 Bytes
1c03487 0092607 1c03487 0092607 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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
@abstractmethod
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})"
|