diff --git a/.vscode/launch.json b/.vscode/launch.json index 2c06221..f51306f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,8 +12,8 @@ "console": "integratedTerminal", "justMyCode": true, "args": [ - "--exp", "test", - "--reset_db", "True" + "--exp", "without_exp", + "--job", "24", ] } ] diff --git a/SQL_running_check.sql b/SQL_running_check.sql new file mode 100644 index 0000000..dae4b33 --- /dev/null +++ b/SQL_running_check.sql @@ -0,0 +1,3 @@ +select id, e_id, idx_sample, seed, ts_done from iiabmdb.without_exp_sample where is_done_flag != -1; +select count(id) from iiabmdb.without_exp_sample where is_done_flag != -1; +select count(id) from iiabmdb.without_exp_sample; \ No newline at end of file diff --git a/__pycache__/controller_db.cpython-38.pyc b/__pycache__/controller_db.cpython-38.pyc index 77f8a4b..65bf1ad 100644 Binary files a/__pycache__/controller_db.cpython-38.pyc and b/__pycache__/controller_db.cpython-38.pyc differ diff --git a/__pycache__/model.cpython-38.pyc b/__pycache__/model.cpython-38.pyc index 0bb9127..e6bd87a 100644 Binary files a/__pycache__/model.cpython-38.pyc and b/__pycache__/model.cpython-38.pyc differ diff --git a/__pycache__/orm.cpython-38.pyc b/__pycache__/orm.cpython-38.pyc index a1ab659..a8311bc 100644 Binary files a/__pycache__/orm.cpython-38.pyc and b/__pycache__/orm.cpython-38.pyc differ diff --git a/conf_db_prefix.yaml b/conf_db_prefix.yaml index 42cedea..0e48fd8 100644 --- a/conf_db_prefix.yaml +++ b/conf_db_prefix.yaml @@ -1 +1 @@ -db_name_prefix: test +db_name_prefix: without_exp diff --git a/controller_db.py b/controller_db.py index 0b22ab3..a5e0e36 100644 --- a/controller_db.py +++ b/controller_db.py @@ -53,7 +53,7 @@ class ControllerDB: dct = {code: [product_code]} list_dct.append(dct) # list_dct = [{'140': ['1.4.5.1']}] - list_dct = [{'133': ['1.4.4.1']}] + # list_dct = [{'133': ['1.4.4.1']}] # list_dct = [{'2': ['1.1.3']}] # list_dct = [{'135': ['1.3.2.1']}] # list_dct = [{'79': ['2.1.3.4']}] diff --git a/firm.py b/firm.py index b577e50..c515f5e 100644 --- a/firm.py +++ b/firm.py @@ -63,7 +63,7 @@ class FirmAgent(ap.Agent): def seek_alt_supply(self): for product in self.a_lst_up_product_removed: - print(f"{self.name} seek alt supply for {product.code}") + # print(f"{self.name} seek alt supply for {product.code}") if self.dct_n_trial_up_prod_removed[ product] <= self.model.int_n_max_trial: if self.dct_n_trial_up_prod_removed[product] == 0: @@ -87,10 +87,10 @@ class FirmAgent(ap.Agent): select_alt_supply = self.model.nprandom.choice( self.dct_cand_alt_supply_up_prod_removed[product], p=lst_prob) - print( - f"{self.name} selct alt supply for {product.code} " - f"from {select_alt_supply.name}" - ) + # print( + # f"{self.name} selct alt supply for {product.code} " + # f"from {select_alt_supply.name}" + # ) assert product in select_alt_supply.a_lst_product, \ f"{select_alt_supply} \ does not produce requested product {product}" @@ -113,7 +113,7 @@ class FirmAgent(ap.Agent): self.dct_n_trial_up_prod_removed[product] += 1 def handle_request(self): - print(self.name, 'handle_request') + # print(self.name, 'handle_request') for product, lst_firm in self.dct_request_prod_from_firm.items(): if self.dct_prod_capacity[product] > 0: if len(lst_firm) == 0: @@ -183,10 +183,10 @@ class FirmAgent(ap.Agent): self.dct_prod_capacity[product] -= 1 self.dct_request_prod_from_firm[product].remove(down_firm) down_firm.a_lst_up_product_removed.remove(product) - print( - f"{self.name} accept {product.code} request " - f"from {down_firm.name}" - ) + # print( + # f"{self.name} accept {product.code} request " + # f"from {down_firm.name}" + # ) else: down_firm.dct_cand_alt_supply_up_prod_removed[product].remove(self) diff --git a/xv.csv b/xv.csv index 564a51d..08b3cb4 100644 --- a/xv.csv +++ b/xv.csv @@ -1,4 +1,4 @@ n_max_trial,crit_supplier,firm_pref_request,firm_pref_accept,netw_pref_cust_n,netw_pref_cust_size,cap_limit,diff_new_conn,diff_remove -12,2,2,2,0.5,2,4,0.5,0.5 -8,1,1,1,1,1,2,1,1 -4,0.5,0.5,0.5,2,0.5,0,2,2 +15,2,2,2,0.5,2,4,0.5,0.5 +10,1,1,1,1,1,2,1,1 +5,0.5,0.5,0.5,2,0.5,0,2,2