From b4e951243991666572b0c55c74d12cb8230dda3d Mon Sep 17 00:00:00 2001 From: HaoYizhi Date: Sun, 21 May 2023 12:35:27 +0800 Subject: [PATCH] without_exp --- .vscode/launch.json | 4 ++-- SQL_running_check.sql | 3 +++ __pycache__/controller_db.cpython-38.pyc | Bin 7076 -> 7048 bytes __pycache__/model.cpython-38.pyc | Bin 8199 -> 8199 bytes __pycache__/orm.cpython-38.pyc | Bin 3715 -> 3715 bytes conf_db_prefix.yaml | 2 +- controller_db.py | 2 +- firm.py | 20 ++++++++++---------- xv.csv | 6 +++--- 9 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 SQL_running_check.sql 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 77f8a4b0b8451ab570c5ce7f55071d46ed1f5e50..65bf1ad6e5c41afe8a67571916fa4ae2ace71599 100644 GIT binary patch delta 812 zcmZ{hO-vJE5Qg_#x+}D7OS@ppj}oGY)kM^TL@ppIMyQFAKpK>k(r*bZYk}ECgn-77 z5d7gs=cX~n#G809^wKW_%#H~dSbkm?66@zv1L`m(U75uuMJsGicZ&>m0s<_6d zqWeXLhoggHj-N+Y#5lLcjtk<;v7vUK(nfn;KuGuvIx==N*@t;kE)TKo77FSO*?> zDAzh}*3IXxTkh11tZcJ|B(9h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31ii@qBUjQ0+Ej5r8@M^ z(V0F2YgP?f^?cu|B-oBZ6yM3jv*a}XkeS|%CPqqUGv7qkwWagY- z#2Un14;)e9W70pr&01)jVG)xq<6;NNB1?!ekllp$<}imCQI5JX7Z{I(<{{?UBN@2y z#3oc$vc}uT=k>awQw82VD!Vc$hDa6?qC(Qp6IZ4-a5o+owbNHYadM;z zs=T}u&RI7tScrKpT!T0;HAFm+0+xT}WfNb%OIiTl{V*Q(}lFdD`e`N4&^!TWYG zrx4FSA|?}l{65kFNlubWD9d4+CA2y%qiI@jB`*pIY)Zlli)D=K@GUQ}ZxsXS*)A)T z?0W4;KQy$8Zv36yhIZgy+{5M~Qb8I>4lpK00JrYja-#{03qoECjbBd delta 19 YcmZpcZIlpK0D@|!ja-#{03;Rzg8%>k 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