Skip to content
Snippets Groups Projects
Commit 6ab7b451 authored by erwan's avatar erwan
Browse files

Do not raise an error when an algorithm becomes silent.

parent 6b9a3b9c
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 27/05/2021 (at 09:06) by Erwan Jahier> *) (* Time-stamp: <modified the 31/05/2021 (at 11:22) by Erwan Jahier> *)
type t = type t =
| Synchronous (* select all actions *) | Synchronous (* select all actions *)
...@@ -147,29 +147,34 @@ let (f: bool -> bool -> t -> 'v Process.t list -> ...@@ -147,29 +147,34 @@ let (f: bool -> bool -> t -> 'v Process.t list ->
bool list list * 'v pna list) = bool list list * 'v pna list) =
fun dummy_input verbose_mode daemon pl neigbors_of_pid e all enab get_action_value -> fun dummy_input verbose_mode daemon pl neigbors_of_pid e all enab get_action_value ->
let nall = remove_empty_list all in let nall = remove_empty_list all in
if nall = [] then failwith "Silent"; if nall = [] then (
if daemon <> Custom && dummy_input then Printf.printf "Warning: the algorithm is now Silent\n%!";
ignore (RifRead.bool verbose_mode ((List.hd pl).pid) ""); get_activate_val [] pl, []
match daemon with )
| Synchronous -> else (
let al = synchrone nall in if daemon <> Custom && dummy_input then
get_activate_val al pl, al ignore (RifRead.bool verbose_mode ((List.hd pl).pid) "");
| Central -> match daemon with
let al = central nall in | Synchronous ->
get_activate_val al pl, al let al = synchrone nall in
| LocallyCentral -> get_activate_val al pl, al
let al = locally_central_pna nall in | Central ->
get_activate_val al pl, al let al = central nall in
| Distributed -> get_activate_val al pl, al
let al = distributed nall in | LocallyCentral ->
get_activate_val al pl, al let al = locally_central_pna nall in
| Greedy -> get_activate_val al pl, al
let al = Evil.greedy verbose_mode e pl neigbors_of_pid nall in | Distributed ->
get_activate_val al pl, al let al = distributed nall in
| GreedyCentral -> get_activate_val al pl, al
let al = Evil.greedy_central verbose_mode e pl neigbors_of_pid nall in | Greedy ->
get_activate_val al pl, al let al = Evil.greedy verbose_mode e pl neigbors_of_pid nall in
| Bad i -> get_activate_val al pl, al
let al = Evil.bad i e nall in | GreedyCentral ->
get_activate_val al pl, al let al = Evil.greedy_central verbose_mode e pl neigbors_of_pid nall in
| Custom -> custom all pl enab get_action_value get_activate_val al pl, al
| Bad i ->
let al = Evil.bad i e nall in
get_activate_val al pl, al
| Custom -> custom all pl enab get_action_value
)
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