shankerram3 commited on
Commit
dd7277b
·
verified ·
1 Parent(s): cddbae0

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. server/wildfire_environment.py +5 -16
server/wildfire_environment.py CHANGED
@@ -87,22 +87,9 @@ class WildfireEnvironment(Environment):
87
  # burn lifetime in ticks (balanced model)
88
  self.burn_lifetime = 3
89
 
90
- # Initialize state with minimal defaults (will be properly set in reset())
91
- self._state = WildfireState(
92
- episode_id="",
93
- step_count=0,
94
- total_burned=0,
95
- total_extinguished=0,
96
- last_action="reset",
97
- width=0,
98
- height=0,
99
- wind_dir="CALM",
100
- humidity=0.25,
101
- remaining_water=self.init_water,
102
- remaining_breaks=self.init_breaks,
103
- grid=[],
104
- burn_timers=[],
105
- )
106
 
107
  # --- Core API ---
108
 
@@ -424,5 +411,7 @@ class WildfireEnvironment(Environment):
424
  @property
425
  def state(self) -> WildfireState:
426
  """Return the current environment state."""
 
 
427
  return self._state
428
 
 
87
  # burn lifetime in ticks (balanced model)
88
  self.burn_lifetime = 3
89
 
90
+ # State will be initialized in reset() - using None as placeholder to avoid Pydantic/dataclass conflicts
91
+ # The state property should not be accessed before reset() is called
92
+ self._state: WildfireState | None = None
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
  # --- Core API ---
95
 
 
411
  @property
412
  def state(self) -> WildfireState:
413
  """Return the current environment state."""
414
+ if self._state is None:
415
+ raise RuntimeError("State not initialized. Call reset() first.")
416
  return self._state
417