Commit 66a3fb08 authored by erwan's avatar erwan
Browse files

Fix: in no custom mode, enable values were not printed

parent 44fa68e2
(* Time-stamp: <modified the 17/03/2019 (at 11:50) by Erwan Jahier> *)
(* Time-stamp: <modified the 18/03/2019 (at 09:21) by Erwan Jahier> *)
(* XXX Je pourrais utiliser Lwt pour rendre step non-bloquant, ce qui
permettrait d'accelerer la simu sur les machines qui ont plusieurs
......@@ -76,7 +76,7 @@ let (print_step : int -> int -> SasArg.t -> Env.t -> Process.t list -> string ->
Printf.printf "\n#step %s\n" (string_of_int (n-i+1)) ;
Printf.printf "%s #outs " activate_val; flush stdout
);
Printf.printf "%s %s\n" (StringOf.env_rif e pl) enable_val;
Printf.printf "%s %s\n" (StringOf.env_rif e pl) enable_val;
flush stdout
)
else (
......@@ -88,9 +88,8 @@ let (print_step : int -> int -> SasArg.t -> Env.t -> Process.t list -> string ->
exception Silent of int
let (simustep: int -> int -> SasArg.t -> Process.t list -> string ->
(Process.t * Topology.neighbor list) list -> Env.t -> Env.t * string) =
(Process.t * Topology.neighbor list) list -> Env.t -> Env.t * string) =
fun n i args pl activate_val pl_n e ->
let custom = args.demon = Demon.Custom in
(* 1: Get enable processes *)
let all = List.fold_left
(fun acc (p,nl) ->
......@@ -104,13 +103,12 @@ let (simustep: int -> int -> SasArg.t -> Process.t list -> string ->
assert (List.length pl = List.length all);
let all = List.rev all in
let enab_ll =
if not custom then [] else
List.map2
(fun p al ->
let al = List.map (fun (_,_,a) -> a) al in
List.map (fun a_static -> List.mem a_static al) p.actions)
pl
all
List.map2
(fun p al ->
let al = List.map (fun (_,_,a) -> a) al in
List.map (fun a_static -> List.mem a_static al) p.actions)
pl
all
in
let enable_val =
String.concat " " (List.map (fun b -> if b then "t" else "f")
......
Supports Markdown
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