diff --git a/lib/sasacore/exhaustSearch.ml b/lib/sasacore/exhaustSearch.ml index 625ea810c43eb48ae413a0451d36cb95d88db111..d56251dd0608967866e9e2adb190d481f0f7484f 100644 --- a/lib/sasacore/exhaustSearch.ml +++ b/lib/sasacore/exhaustSearch.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 27/02/2023 (at 15:25) by Erwan Jahier> *) +(* Time-stamp: <modified the 01/03/2023 (at 15:10) by Erwan Jahier> *) open LocalSearch @@ -178,7 +178,7 @@ let (bnb : out_channel -> bool -> 'v ss -> Some(x, t)); visiting = visiting; visited = visited; - cut = (fun psol n -> if psol.cost >= n.cost then ( + cut = (fun psol n -> if not args.es_dont_cut && psol.cost >= n.cost then ( if do_log args then pf log "%d: cut at depth %d of cost %.1f<=%.1f\n%!" !cpt n.d n.cost psol.cost; true @@ -241,8 +241,6 @@ let (bnb : out_channel -> bool -> 'v ss -> cpt_of_last_improvement := nsol.cpt; run_more nsol more ) else ( - pf log "==> I've found a path of length %d! (after #%d steps)\n%!" nsol.d !cpt; - pf stdout "==> I've found a path of length %d (after #%d steps)\n%!" nsol.d !cpt; run_more psol more ) in diff --git a/lib/sasacore/sasArg.ml b/lib/sasacore/sasArg.ml index 72a818ad8d7fae9ac60ade6d25492043c4fd1cb9..b41664eee103ed5e02fa970861189e6ca7f7308a 100644 --- a/lib/sasacore/sasArg.ml +++ b/lib/sasacore/sasArg.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 09/02/2023 (at 09:46) by Erwan Jahier> *) +(* Time-stamp: <modified the 01/03/2023 (at 12:21) by Erwan Jahier> *) type init_search = No_init_search | Local of int | Global of int | Annealing of int @@ -15,6 +15,7 @@ type t = { mutable es_dfs: bool; mutable es_tabu_mode: bool; mutable es_continue_after_best: bool; + mutable es_dont_cut: bool; mutable rif: bool; mutable output_file_name: string option; mutable no_data_file: bool; @@ -54,6 +55,7 @@ let (make_args : unit -> t) = es_dfs = false; es_tabu_mode = true; es_continue_after_best = false; + es_dont_cut= false; rif = false; output_file_name = None; no_data_file = false; @@ -175,7 +177,11 @@ let (mkoptab : string array -> t -> unit) = mkopt args ~hide:true ["--es-continue-when-best-sol-found"] (Arg.Unit(fun () -> args.es_continue_after_best <- true)) - ["For experiment purposes: do not stop when |path(sol)|=pot(init)" ]; + ["Do not stop when |path(sol)|=pot(init): this is necessary when E.x phi'(c)>0 (pseudo pot)" ]; + + mkopt args ~hide:true ["--es-dont-cut"] + (Arg.Unit(fun () -> args.es_dont_cut <- true)) + ["Do not cut path when n.cost < prev_sol.cost : this is useful when E.x phi'(c)>0 (pseudo pot)" ]; (* mkopt args ["--bad-daemon";"-bd"] ~arg:" <int>" *) diff --git a/lib/sasacore/sasArg.mli b/lib/sasacore/sasArg.mli index 97dbd04304ee61c86db8fc278c5beb0fad6371f4..a134b188dc218d6f269b51e9eaa0e39aa5047b1f 100644 --- a/lib/sasacore/sasArg.mli +++ b/lib/sasacore/sasArg.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 09/02/2023 (at 09:46) by Erwan Jahier> *) +(* Time-stamp: <modified the 01/03/2023 (at 12:20) by Erwan Jahier> *) type init_search = No_init_search | Local of int | Global of int | Annealing of int @@ -13,6 +13,7 @@ type t = { mutable es_dfs: bool; mutable es_tabu_mode: bool; mutable es_continue_after_best: bool; + mutable es_dont_cut: bool; mutable rif: bool; mutable output_file_name: string option; mutable no_data_file: bool;