RohitChandramouli6618 commited on
Commit
d3b81d6
Β·
1 Parent(s): 33a1e6b

Lower spread rate to 0.09, fix medium seeds, teach focused allocation strategy

Browse files
baseline/policy.py CHANGED
@@ -60,20 +60,21 @@ def build_prompt(obs: CityObservation) -> str:
60
  lines += [""]
61
 
62
  if not has_data_lag:
63
- # Easy and medium: data is accurate, allocate reduces existing infection
64
  lines += [
65
  "HOW ACTIONS WORK:",
66
- " - 'allocate': costs 1 resource, REDUCES existing infection AND slows spread",
67
- " - 'restrict': FREE, only slows future spread, does NOT reduce infection",
68
- " - 'test': costs 1 resource, gives accurate data (NOT needed here, data is real-time)",
69
  "",
70
- "DECISION RULES (follow in order):",
71
- "1. If ANY hospital is below 0.3 capacity: 'allocate' on that district IMMEDIATELY.",
72
- "2. If resources > 0: ALWAYS 'allocate' on the district with the SINGLE HIGHEST infection rate.",
73
- "3. Do NOT spread resources across multiple districts in the same turn β€” focus all pressure on the worst district.",
74
- "4. If resources = 0: 'restrict' on the highest infected district.",
75
- "5. NEVER use 'test' β€” data is already accurate.",
76
- "6. NEVER restrict a SAFE district (below 0.2) β€” you will be penalised.",
 
 
77
  ]
78
  else:
79
  # Hard task: data is 3 days old, act on growth_hint
 
60
  lines += [""]
61
 
62
  if not has_data_lag:
 
63
  lines += [
64
  "HOW ACTIONS WORK:",
65
+ " - 'allocate': costs 1 resource. REDUCES existing infection AND slows spread.",
66
+ " - 'restrict': FREE. Only slows spread. Does NOT reduce existing infection.",
67
+ " - Resources replenish by 1 each step but cannot exceed starting pool.",
68
  "",
69
+ "STRATEGY β€” follow this decision tree exactly:",
70
+ "1. If ANY hospital < 0.3 capacity β†’ 'allocate' on that district immediately.",
71
+ "2. Find the district with HIGHEST infection rate.",
72
+ "3. If it is above 0.2 and you have resources β†’ 'allocate' on it.",
73
+ "4. Keep allocating to the SAME district on the NEXT step too.",
74
+ " Only switch when that district drops below 0.2 (safe).",
75
+ "5. If resources = 0 β†’ 'restrict' on the highest infected district.",
76
+ "6. NEVER use 'test' β€” data is real-time and accurate.",
77
+ "7. NEVER restrict a district below 0.2 β€” you will be penalised.",
78
  ]
79
  else:
80
  # Hard task: data is 3 days old, act on growth_hint
server/constants.py CHANGED
@@ -43,7 +43,7 @@ HOSPITAL_BREACH_POINT = 0.00
43
  # ── Spread Mechanics ──────────────────────────────────────────────────────────
44
 
45
  SPREAD_RATE_MIN = 0.05 # Slowest possible spread rate per day
46
- SPREAD_RATE_MAX = 0.13 # Fastest possible spread rate per day
47
  GROWTH_HINT_NOISE = 0.03 # Noise on growth_rate_hint (Β± value)
48
 
49
  TREATMENT_REDUCTION = 0.10 # Allocating reduces existing infection this step
 
43
  # ── Spread Mechanics ──────────────────────────────────────────────────────────
44
 
45
  SPREAD_RATE_MIN = 0.05 # Slowest possible spread rate per day
46
+ SPREAD_RATE_MAX = 0.09 # Fastest possible spread rate per day
47
  GROWTH_HINT_NOISE = 0.03 # Noise on growth_rate_hint (Β± value)
48
 
49
  TREATMENT_REDUCTION = 0.10 # Allocating reduces existing infection this step
server/tasks/task_medium.py CHANGED
@@ -23,7 +23,7 @@ class MediumTask(BaseTask):
23
  # D1 and D3 start clean but will grow into critical within 3-4 steps.
24
  # 8 total resources for 4 districts creates genuine triage pressure β€”
25
  # agent cannot save all districts and must choose strategically.
26
- seed_infections = [0.28, 0.08, 0.25, 0.08]
27
 
28
  return CityState(
29
  day = 0,
 
23
  # D1 and D3 start clean but will grow into critical within 3-4 steps.
24
  # 8 total resources for 4 districts creates genuine triage pressure β€”
25
  # agent cannot save all districts and must choose strategically.
26
+ seed_infections = [0.28, 0.05, 0.25, 0.05]
27
 
28
  return CityState(
29
  day = 0,