diff --git a/SQL_export_high_risk_setting.sql b/SQL_export_high_risk_setting.sql index 7daf767..abf784a 100644 --- a/SQL_export_high_risk_setting.sql +++ b/SQL_export_high_risk_setting.sql @@ -15,5 +15,5 @@ inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where on a.id = b.s_id group by e_id) as b on a.id = b.e_id -where count >= 12 +where count > 10 order by count desc; diff --git a/SQL_running_check.sql b/SQL_running_check.sql index 672e031..59a776a 100644 --- a/SQL_running_check.sql +++ b/SQL_running_check.sql @@ -2,6 +2,7 @@ select id, e_id, idx_sample, seed, ts_done from iiabmdb.without_exp_sample where select count(id) from iiabmdb.without_exp_sample where is_done_flag != -1; select count(id) from iiabmdb.without_exp_sample‘; select count(id) from iiabmdb.with_exp_sample where is_done_flag != -1; +select * from iiabmdb.with_exp_sample where is_done_flag != 1; select * from (select distinct idx_scenario, n_max_trial, crit_supplier, firm_pref_request, diff --git a/__pycache__/controller_db.cpython-38.pyc b/__pycache__/controller_db.cpython-38.pyc index 6b6b583..9e76297 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 bcbf5a1..c57af7f 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 1bd50d8..e4dd652 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 eb1ad50..81fd881 100644 Binary files a/__pycache__/orm.cpython-38.pyc and b/__pycache__/orm.cpython-38.pyc differ diff --git a/controller_db.py b/controller_db.py index b153cc4..67b152c 100644 --- a/controller_db.py +++ b/controller_db.py @@ -70,7 +70,7 @@ class ControllerDB: result['dct_lst_init_remove_firm_prod'] = \ result['dct_lst_init_remove_firm_prod'].apply( lambda x: pickle.loads(x)) - list_dct = result.loc[result['count'] >= 12, + list_dct = result.loc[result['count'] > 10, 'dct_lst_init_remove_firm_prod'].to_list() else: for _, row in Firm.iterrows(): diff --git a/model.py b/model.py index e1fd664..551bd3f 100644 --- a/model.py +++ b/model.py @@ -1,6 +1,5 @@ import agentpy as ap import pandas as pd -import numpy as np import networkx as nx from firm import FirmAgent from product import ProductAgent @@ -13,7 +12,6 @@ class Model(ap.Model): def setup(self): self.sample = self.p.sample self.int_stop_times, self.int_stop_t = 0, None - self.nprandom = np.random.default_rng(self.p.seed) self.int_n_iter = int(self.p.n_iter) self.dct_lst_remove_firm_prod = self.p.dct_lst_init_remove_firm_prod diff --git a/oa_with_exp.csv b/oa_with_exp.csv index 69f55af..5ee736e 100644 --- a/oa_with_exp.csv +++ b/oa_with_exp.csv @@ -1,37 +1,37 @@ X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,X20,X21,X22,X23 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -1,0,0,0,1,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,1,1 -2,0,0,0,2,0,0,2,2,2,2,2,0,2,0,0,0,0,0,2,2,2,2 -0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2 -1,0,0,0,1,0,0,1,1,2,2,2,1,2,1,1,1,1,1,0,0,0,0 -2,0,0,0,2,0,0,2,2,0,0,0,1,0,1,1,1,1,1,1,1,1,1 -0,0,0,1,0,1,1,1,2,0,1,2,0,2,0,0,1,1,1,0,1,1,2 -1,0,0,1,1,1,1,2,0,1,2,0,0,0,0,0,1,1,1,1,2,2,0 -2,0,0,1,2,1,1,0,1,2,0,1,0,1,0,0,1,1,1,2,0,0,1 -0,0,1,0,0,1,1,2,1,0,2,1,0,2,1,1,0,0,1,1,0,2,1 -1,0,1,0,1,1,1,0,2,1,0,2,0,0,1,1,0,0,1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