feat: lift runtime into language, start of zelus 2024 compatibility
This commit is contained in:
parent
dc8d941b84
commit
ffc583985a
37 changed files with 1154 additions and 143 deletions
30
exm/zelus/cradle/main.ml
Normal file
30
exm/zelus/cradle/main.ml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
open Std
|
||||
|
||||
let input2 _ = ()
|
||||
let output2 (now, (h, (p0, v0), (p1, v1))) =
|
||||
Format.printf "%.10e\t%.10e\t%.10e\n" now p0 p1
|
||||
|
||||
let input3 _ = ()
|
||||
let output3 (now, (p0, p1, p2, h1, h2)) =
|
||||
Format.printf "%.10e\t%.10e\t%.10e\t%.10e\t%.10e\t%.10e\n"
|
||||
now p0 (p1 +. 1.0) (p2 +. 2.0) (h1 +. 3.0) (h2 +. 4.0)
|
||||
|
||||
let input_main _ = ()
|
||||
let output_main (now, ()) = ()
|
||||
|
||||
let three = ref false
|
||||
let main = ref false
|
||||
|
||||
let toggle y n () =
|
||||
y := true;
|
||||
List.iter (fun n -> n := false) n
|
||||
|
||||
let () =
|
||||
Runtime.register_args [
|
||||
"-three", Arg.Unit (toggle three [main]), "\tUse the third model";
|
||||
"-main", Arg.Unit (toggle main [three]), "\tUse the main model";
|
||||
];
|
||||
if !main then Runtime.go input_main Cradle.main output_main
|
||||
else if !three then Runtime.go input3 Cradle.cradle3 output3
|
||||
else Runtime.go input2 Cradle.cradle2 output2
|
||||
Loading…
Add table
Add a link
Reference in a new issue