30 lines
826 B
OCaml
30 lines
826 B
OCaml
|
|
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
|