MiniGridEnv / env /config.py
yashu2000's picture
Upload folder using huggingface_hub
a03a89b verified
"""Configuration objects for MiniGridEnv."""
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class RewardConfig:
"""Reward-shaping controls for environment step rewards."""
mode: str = "binary" # "binary" | "shaped" | "efficiency"
completion_reward: float = 1.0
failure_reward: float = 0.0
step_penalty: float = 0.0
invalid_action_penalty: float = 0.0
efficiency_bonus_weight: float = 0.5
@dataclass
class EnvConfig:
"""Episode, observation, and reproducibility settings."""
# Level selection
level_name: str = "GoToRedBall"
# Episode limits
max_steps_override: Optional[int] = None
# Reward configuration
reward: RewardConfig = field(default_factory=RewardConfig)
# Observation configuration
include_history: bool = True
max_history_length: int = 20
include_raw_grid: bool = False
# Reproducibility and optional metrics
seed: int = 42
compute_optimal: bool = False
track_carrying: bool = True