Skip to content
Snippets Groups Projects
Commit 1a65c0c4 authored by erwan's avatar erwan
Browse files

fix: silent configurations are necessarily legitimate

parent 12ea9fd6
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 25/01/2023 (at 10:47) by Erwan Jahier> *) (* Time-stamp: <modified the 27/02/2023 (at 14:12) by Erwan Jahier> *)
open Register open Register
open Topology open Topology
...@@ -72,7 +72,7 @@ let update_neighbors config neighbors = StringMap.map ...@@ -72,7 +72,7 @@ let update_neighbors config neighbors = StringMap.map
let (update_config: 'v Conf.t -> 'v t -> 'v t) = let (update_config: 'v Conf.t -> 'v t -> 'v t) =
fun e st -> fun e st ->
let verb = !Register.verbose_level > 0 in let verb = !Register.verbose_level > 2 in
if verb then Printf.eprintf " ===> update_neighbor_env\n%!"; if verb then Printf.eprintf " ===> update_neighbor_env\n%!";
{ st with neighbors = update_neighbors e st.neighbors ; config = e } { st with neighbors = update_neighbors e st.neighbors ; config = e }
...@@ -409,7 +409,8 @@ let (compute_potentiel: 'v t -> float) = ...@@ -409,7 +409,8 @@ let (compute_potentiel: 'v t -> float) =
let (legitimate: 'v t -> bool) = fun st -> let (legitimate: 'v t -> bool) = fun st ->
match Register.get_legitimate () with match Register.get_legitimate () with
| None -> false | None -> (* check if st is silent *)
get_enable_processes st |> snd |> List.flatten |> List.for_all not
| Some ulf -> | Some ulf ->
let pidl = List.map (fun p -> p.Process.pid) st.network in let pidl = List.map (fun p -> p.Process.pid) st.network in
ulf pidl (neigbors_of_pid st) ulf pidl (neigbors_of_pid st)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment