33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
"""问题四 core+boundary 基准集配对对比:directional(最优) vs 两条搬用基线。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from project.common import (RESULTS_DIR, closed_loop_payload, episodes_markdown,
|
|
execute_variants, problem_config, write_json,
|
|
write_text)
|
|
from project.q4 import baseline, optimal
|
|
|
|
VARIANTS = (
|
|
("optimal", optimal.build_loop),
|
|
("baseline_grid", baseline.build_grid),
|
|
("baseline", baseline.build_bayes),
|
|
)
|
|
LABELS = [label for label, _ in VARIANTS]
|
|
BASE_LABEL = "baseline"
|
|
|
|
|
|
def run(quick: bool = False) -> dict:
|
|
from mcm26b.harness.suites import suite
|
|
scenes = suite("core", 4) + suite("boundary", 4)
|
|
if quick:
|
|
scenes = scenes[:4]
|
|
config = problem_config()
|
|
rows = execute_variants(scenes, VARIANTS, config)
|
|
payload = closed_loop_payload(4, "core+boundary", scenes, VARIANTS, rows,
|
|
LABELS, BASE_LABEL, config)
|
|
write_json(RESULTS_DIR / "q4.json", payload)
|
|
write_text(RESULTS_DIR / "q4.md",
|
|
episodes_markdown("问题四:混合源闭环配对对比(core+boundary 基准集)",
|
|
rows, LABELS, BASE_LABEL))
|
|
return payload
|