#!/usr/bin/env python3
"""Synthetic teaching model: simple serving vs batch-aware scheduling. Not a benchmark."""
import argparse

SCENARIOS={"quiet":(3,1.0),"busy":(16,1.2),"overload":(36,1.5)}

def run(name):
    c,f=SCENARIOS[name]
    simple_cap=6/f; batch_cap=18/f
    sq=max(0,round(c-simple_cap)); bq=max(0,round(c-batch_cap))
    st=0.55+f*.18+sq*.11; bt=0.58+f*.16+bq*.07
    print(f"scenario={name} concurrency={c}")
    print(f"simple_queue={sq} simple_ttft={st:.2f}s")
    print(f"batch_queue={bq} batch_ttft={bt:.2f}s")
    diagnosis="low_pressure" if name=="quiet" else "scheduling_matters" if name=="busy" else "both_paths_saturate"
    print(f"diagnosis={diagnosis}")
    print("NOTE synthetic teaching model; not a real Ollama/vLLM benchmark")

def main():
    ap=argparse.ArgumentParser(); ap.add_argument('--scenario',choices=SCENARIOS,default='quiet'); ap.add_argument('--self-test',action='store_true'); a=ap.parse_args()
    if a.self_test:
        for s in SCENARIOS: run(s)
        print('PASS serving_scheduler_relationships')
    else: run(a.scenario)
if __name__=='__main__': main()
