<?php
require_once dirname(__DIR__).'/runtime/RuntimeManager.php';
$d=$_GET['race_date']??date('Y-m-d');
$v=$_GET['venue']??'';
$r=isset($_GET['race_num'])?(int)$_GET['race_num']:0;
$m=$_GET['mode']??'BALANCED';
$rm=new RuntimeManager();
header('Content-Type: application/json; charset=utf-8');
echo json_encode($rm->run(new RuntimeContext($d,$v,$r,$m)),JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
