Commit 6ab7b451 authored by erwan's avatar erwan
Browse files

Do not raise an error when an algorithm becomes silent.

parent 6b9a3b9c
(* 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 =
| Synchronous (* select all actions *)
......@@ -147,29 +147,34 @@ let (f: bool -> bool -> t -> 'v Process.t list ->
bool list list * 'v pna list) =
fun dummy_input verbose_mode daemon pl neigbors_of_pid e all enab get_action_value ->
let nall = remove_empty_list all in
if nall = [] then failwith "Silent";
if daemon <> Custom && dummy_input then
ignore (RifRead.bool verbose_mode ((List.hd pl).pid) "");
match daemon with
| Synchronous ->
let al = synchrone nall in
get_activate_val al pl, al
| Central ->
let al = central nall in
get_activate_val al pl, al
| LocallyCentral ->
let al = locally_central_pna nall in
get_activate_val al pl, al
| Distributed ->
let al = distributed nall in
get_activate_val al pl, al
| Greedy ->
let al = Evil.greedy verbose_mode e pl neigbors_of_pid nall in
get_activate_val al pl, al
| GreedyCentral ->
let al = Evil.greedy_central verbose_mode e pl neigbors_of_pid nall in
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
if nall = [] then (
Printf.printf "Warning: the algorithm is now Silent\n%!";
get_activate_val [] pl, []
)
else (
if daemon <> Custom && dummy_input then
ignore (RifRead.bool verbose_mode ((List.hd pl).pid) "");
match daemon with
| Synchronous ->
let al = synchrone nall in
get_activate_val al pl, al
| Central ->
let al = central nall in
get_activate_val al pl, al
| LocallyCentral ->
let al = locally_central_pna nall in
get_activate_val al pl, al
| Distributed ->
let al = distributed nall in
get_activate_val al pl, al
| Greedy ->
let al = Evil.greedy verbose_mode e pl neigbors_of_pid nall in
get_activate_val al pl, al
| GreedyCentral ->
let al = Evil.greedy_central verbose_mode e pl neigbors_of_pid nall in
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
)
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