Commit 8a9b0c86 authored by Benoit Barbot's avatar Benoit Barbot
Browse files

progress

parent ceaf4c74
Pipeline #1685 passed with stages
in 31 seconds
......@@ -21,9 +21,8 @@ let computation outfile task =
end))) in
let module FunIt = Semantic.Make (Bound) (Weight) in
let module M = MainLoop.Make (FunIt) (struct let smp = task.frequency end) in
let rgpoly =
let weights,rgpoly =
if task.npoly > 0 then (
if task.verbose>0 then (
Format.printf "Computing Distribution[%s; %s] -> %i: ["
......@@ -33,14 +32,14 @@ let computation outfile task =
flush stdout;
Format.print_flush ()
);
let _,rgp = FunIt.iterate_functionnal ~update:(fun () ->
let w,rgp = FunIt.iterate_functionnal ~update:(fun () ->
if !is_stopped then raise Interrupted;
Format.printf "|"; Format.print_flush ())
rg task.npoly in
if task.verbose>0 then Format.printf "] [%.2fs]@." (Common.check_time ());
rgp
w,rgp
) else
snd @@ FunIt.iterate_functionnal rg 0
FunIt.iterate_functionnal rg 0
in
if task.print_rg then (
......@@ -51,6 +50,30 @@ let computation outfile task =
Format.printf "%a@." (ZoneGraph.print Bound.print) rgpoly;
Js_of_ocaml.Worker.post_message (Graph (String.escaped (Buffer.contents buff)))
);
(* Compute s from expected_duration *)
let smp = match task.expected_duration with
None -> task.frequency
| Some target ->
if task.verbose>0 then (
Format.printf "Computing laplace parameter s for E[T]=%g " target; flush stdout;
Format.print_flush ();
);
match FunIt.compute_s target weights rgpoly with
Error (low,mid,up) ->
Format.printf "range:[%g; %g; %g]@." low mid up;
Format.printf "Target outside range, aborting@.";
exit 1
| Ok ( x, (low,mid,up), nt) ->
if task.verbose>0 then (
Format.printf "range:[%g; %g; %g]" low mid up;
Format.printf " -> s=%g;E[T]=%g [%.2fs]@." x nt (Common.check_time ());
);
Some x in
let module M = MainLoop.Make (FunIt) (struct let smp = smp end) in
let template_word = match task.sampling_meth with
Exact -> Array.make task.npoly (Semantic.Fixed,Semantic.Fixed)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment