Commit f54303ae authored by Benoit Barbot's avatar Benoit Barbot
Browse files

monitor

parent d9770d27
Pipeline #2152 failed with stages
in 31 seconds
......@@ -72,20 +72,21 @@ struct
Format.formatter
* (weight, bound) ZoneGraph.t
* style
* (int * float) ref
* (int * int * float) ref
* (string ->
(float Sampling.transChoice * string Sampling.transChoice) list)
let new_traj (_, _, _, mon_state, _) = mon_state := (0, 0.0)
let new_traj (_, _, _, mon_state, _) = mon_state := (0, 0, 0.0)
let init outfile rg ost parse_action =
let mon_state = ref (0, 0.0) in
let mon_state = ref (0, 0, 0.0) in
((outfile, rg, ost, mon_state, parse_action) : t)
let end_traj (outfile, _, (ost, _), mon_state, _) store_traj =
if store_traj then
fprintf outfile "%i\t%g" (fst !mon_state) (snd !mon_state);
if ost <> Void || store_traj then fprintf outfile "@."
if store_traj then (
let aper, _, duration = !mon_state in
fprintf outfile "%i\t%g" aper duration;
if ost <> Void || store_traj then fprintf outfile "@." )
let end_sampling _ = ()
......@@ -154,8 +155,8 @@ struct
let up_trans (outfile, _, (ost, _), mon_state, _) time tr i =
let t2 = int_of_float time in
(mon_state :=
let ap, tt = !mon_state in
((2 * ap) + t2, tt +. time));
let ap, size, tt = !mon_state in
((2 * ap) + t2, size + 1, tt +. time));
match ost with
| Debug when Array.length tr.ZoneGraph.weight > 0 ->
let weight, cdf, _ = tr.ZoneGraph.weight.(i) in
......@@ -171,7 +172,8 @@ struct
| StateListDelay ->
fprintf outfile "\t%i@.@." (int_of_char tr.ZoneGraph.action.[0])
| TimeAndLabels ->
fprintf outfile "%f\t%i@." (snd !mon_state)
fprintf outfile "%f\t%i@."
((fun (_, _, a) -> a) !mon_state)
(int_of_char tr.ZoneGraph.action.[0])
| StateList | Void -> ()
end
......
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