From 97eb75b3860319c07453855c7716b502fb8da2f3 Mon Sep 17 00:00:00 2001
From: David Radu <dcradu@uliege.be>
Date: Mon, 19 Apr 2021 16:29:54 +0200
Subject: [PATCH] Minor bug on DGH algorithm fixed

---
 config_model.yml           | 4 ++--
 src/jl/MCP_heuristics.jl   | 2 +-
 src/jl/SitingHeuristics.jl | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/config_model.yml b/config_model.yml
index 0e3c4b4..8877ba9 100644
--- a/config_model.yml
+++ b/config_model.yml
@@ -41,13 +41,13 @@ siting_params:
       algorithm: 'MIR' # 'SGH', 'RS'
     GRED_DET:
       set: False
-      no_runs: 100
+      no_runs: 10
       p: 0
       algorithm: 'TGH'
     GRED_STO:
       set: False
       p: 27 # 5% of 10150 locations, 55, 110
-      no_runs: 500
+      no_runs: 20
       algorithm: 'STGH'
     RAND:
       # Random Search
diff --git a/src/jl/MCP_heuristics.jl b/src/jl/MCP_heuristics.jl
index 85fab6b..be9d71b 100644
--- a/src/jl/MCP_heuristics.jl
+++ b/src/jl/MCP_heuristics.jl
@@ -372,7 +372,7 @@ function threshold_greedy_algorithm(D::Array{Float64,2}, c::Float64, n::Float64)
     obj_incumbent = obj_candidate
     locations_added += 1
   end
-  return ind_incumbent, obj_incumbent
+  x_incumbent = zeros(Float64, L)                                                                                                                                                                        x_incumbent[ind_ones_incumbent] .= 1.                                                                                                                                                                  return x_incumbent, obj_incumbent 
 end
 
 function time_threshold_greedy_algorithm(D::Array{Float64,2}, c::Float64, n::Float64)
diff --git a/src/jl/SitingHeuristics.jl b/src/jl/SitingHeuristics.jl
index d2fc058..125a174 100644
--- a/src/jl/SitingHeuristics.jl
+++ b/src/jl/SitingHeuristics.jl
@@ -48,7 +48,6 @@ function main_MIRSA(index_dict, deployment_dict, D, c, N, I, E, T_init, R, run,
     x_init = solve_MILP(D, c, n, "Gurobi")
 
     for r = 1:R
-      println(r)
       x_sol[r, :], LB_sol[r], obj_sol[r, :] = simulated_annealing_local_search(D, c, n, N, I, E, x_init, T_init, legacy_index)
     end
 
-- 
GitLab