File size: 1,388 Bytes
248cbb9
73b708a
 
 
 
4e608c3
 
 
248cbb9
 
 
 
 
 
 
4e608c3
 
248cbb9
 
4e608c3
 
 
 
 
 
 
 
 
 
248cbb9
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from pydantic import BaseModel, Field
from typing import Dict, Literal, List, Optional

class ResetRequest(BaseModel):
    task_id: str = "easy_spring"

class Observation(BaseModel):
    time_step: int
    reservoir_level: float = Field(description="Current fresh water stored (Megaliters)")
    water_salinity: float = Field(description="PPM of salt in the water. >500 is unsafe.")
    energy_price: float = Field(description="Current grid energy price ($/MWh)")
    membrane_fouling: float = Field(description="0.0 is clean, 1.0 is totally blocked")
    city_demand: float = Field(description="Water demand for this step (Megaliters)")
    weather_condition: Literal["Normal", "Heatwave", "Storm"] = Field(description="Current weather event affecting parameters")
    maintenance_cooldown: int = Field(description="Steps until a cleaning crew is available again")

class Action(BaseModel):
    production_rate: float = Field(description="Desired water output (ML/step), 0.0 to 50.0")
    run_cleaning: bool = Field(description="If True, halts production to chemically wash membranes (requires crew)")

class StepResult(BaseModel):
    observation: Observation
    reward: float
    done: bool
    info: Dict

class TaskConfig(BaseModel):
    task_id: str
    max_steps: int
    reservoir_capacity: float
    base_demand: float
    price_volatility: float
    weather_pattern: List[str]