diff --git a/__pycache__/controller_db.cpython-38.pyc b/__pycache__/controller_db.cpython-38.pyc index d282dbe..803f4c0 100644 Binary files a/__pycache__/controller_db.cpython-38.pyc and b/__pycache__/controller_db.cpython-38.pyc differ diff --git a/__pycache__/firm.cpython-38.pyc b/__pycache__/firm.cpython-38.pyc index 7e83b77..7880f57 100644 Binary files a/__pycache__/firm.cpython-38.pyc and b/__pycache__/firm.cpython-38.pyc differ diff --git a/__pycache__/model.cpython-38.pyc b/__pycache__/model.cpython-38.pyc index 91c1e07..9165efb 100644 Binary files a/__pycache__/model.cpython-38.pyc and b/__pycache__/model.cpython-38.pyc differ diff --git a/model.py b/model.py index 132ca26..f7032c6 100644 --- a/model.py +++ b/model.py @@ -255,7 +255,8 @@ class Model(ap.Model): [lst_affected[i] for i in self.nprandom.choice(range(len(lst_affected)), round(len(lst_affected) * - self.proactive_ratio))] + self.proactive_ratio), + replace=False)] for firm_code, prod_code in lst_firm_proactive: pro_firm_prod_code = \ @@ -321,10 +322,10 @@ class Model(ap.Model): 'Product': di_supp_prod.code }) ]) - # print(f"proactive add {select_cand.code} to " - # f"{pro_firm.code} " - # f"for {di_supp_node['Firm_Code']} " - # f"{di_supp_node['Product_Code']}") + print(f"proactive add {select_cand.name} to " + f"{pro_firm.name} " + f"for {di_supp_node['Firm_Code']} " + f"{di_supp_node['Product_Code']}") # change capacity select_cand.dct_prod_capacity[di_supp_prod] -= 1 break diff --git a/xv_without_exp.csv b/xv_without_exp.csv index 22d96de..f73357a 100644 --- a/xv_without_exp.csv +++ b/xv_without_exp.csv @@ -1,2 +1,2 @@ n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,crit_supplier,diff_disrupt,proactive_ratio,remove_t,netw_prf_n -10,TRUE,TRUE,uniform,10,0.1,1,0.01,0,5,2 +10,TRUE,TRUE,uniform,10,0.1,1,0.01,1,5,2