feat: support for model-requested horizons

This commit is contained in:
Henri Saudubray 2025-06-25 10:41:37 +02:00
parent 685de96eec
commit ac4e066bf8
Signed by: hms
GPG key ID: 7065F57ED8856128
24 changed files with 170 additions and 93 deletions

View file

@ -29,7 +29,7 @@ let fder y yd =
else begin yd.{0} <- 0.0; yd.{1} <- 0.0; yd.{2} <- 0.0; yd.{3} <- 0.0 end;
yd
let fzer y zo = zo.{0} <- -. y.{1}; zo
let fout _ _ y = of_array [| y.{1}; y.{0} |]
let fout _ _ _ y = of_array [| y.{1}; y.{0} |]
let jump _ = true
let horizon _ = max_float
let cget s = s.lx
@ -44,9 +44,9 @@ let bouncing_ball () : (_, _, _, carray, carray, carray, zarray, carray) hrec =
let yd = cmake csize in
let zout = cmake zsize in
let zfalse = zmake 1 in
let fder _ _ y = fder y yd in
let fzer _ _ y = fzer y zout in
let step s _ = step s zfalse in
let fder _ _ _ y = fder y yd in
let fzer _ _ _ y = fzer y zout in
let step s _ _ = step s zfalse in
let state = { zin=zfalse; lx=of_array [|y'0;y0;x'0;x0|]; i=true } in
let reset _ _ = state in
{ state; fder; fzer; fout; step; reset; horizon; jump; cset; cget; zset;