no need for resetting random generator with seed

This commit is contained in:
HaoYizhi 2023-06-16 17:15:17 +08:00
parent 36abde1022
commit 09ea2e9527
10 changed files with 38 additions and 39 deletions

View File

@ -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;

View File

@ -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,

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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():

View File

@ -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

View File

@ -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,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