without_exp
This commit is contained in:
parent
94583af801
commit
b4e9512439
|
@ -12,8 +12,8 @@
|
|||
"console": "integratedTerminal",
|
||||
"justMyCode": true,
|
||||
"args": [
|
||||
"--exp", "test",
|
||||
"--reset_db", "True"
|
||||
"--exp", "without_exp",
|
||||
"--job", "24",
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -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;
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
db_name_prefix: test
|
||||
db_name_prefix: without_exp
|
||||
|
|
|
@ -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']}]
|
||||
|
|
20
firm.py
20
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)
|
||||
|
||||
|
|
6
xv.csv
6
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
|
||||
|
|
|
Loading…
Reference in New Issue