multi-agent-strat / tasks.py
Avnishjain's picture
Upload 21 files
6888575 verified
"""Task fixtures for the multi-agent strategy benchmark."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Dict
@dataclass(frozen=True)
class TaskSpec:
task_id: str
difficulty: str
objective: str
max_turns: int
rule_shift_interval: int
random_shift_chance: float
opponent_profile: str
fog_noise: int
target_margin: float
seed: int
TASKS: Dict[str, TaskSpec] = {
"easy_frontier_probe": TaskSpec(
task_id="easy_frontier_probe",
difficulty="easy",
objective=(
"Outperform a mostly aggressive rival by adapting to periodic rule changes "
"while operating with light fog-of-war."
),
max_turns=12,
rule_shift_interval=4,
random_shift_chance=0.05,
opponent_profile="aggressive",
fog_noise=1,
target_margin=6.0,
seed=101,
),
"medium_alliance_shuffle": TaskSpec(
task_id="medium_alliance_shuffle",
difficulty="medium",
objective=(
"Compete with an adaptive rival under moderate uncertainty and faster "
"policy shifts in the global rulebook."
),
max_turns=14,
rule_shift_interval=3,
random_shift_chance=0.15,
opponent_profile="adaptive",
fog_noise=2,
target_margin=9.0,
seed=202,
),
"hard_chaos_conclave": TaskSpec(
task_id="hard_chaos_conclave",
difficulty="hard",
objective=(
"Beat a deceptive rival with heavy fog-of-war while rules evolve rapidly "
"and unpredictably."
),
max_turns=16,
rule_shift_interval=2,
random_shift_chance=0.3,
opponent_profile="deceptive",
fog_noise=3,
target_margin=12.0,
seed=303,
),
}
TASK_ORDER = ["easy_frontier_probe", "medium_alliance_shuffle", "hard_chaos_conclave"]
def get_task(task_id: str) -> TaskSpec:
if task_id not in TASKS:
valid = ", ".join(TASKS)
raise ValueError(f"Unknown task_id '{task_id}'. Valid ids: {valid}")
return TASKS[task_id]