rename variable

This commit is contained in:
2023-06-10 19:51:50 +08:00
parent a8259fdc7d
commit 313870bcc3
10 changed files with 23 additions and 53 deletions

12
firm.py
View File

@@ -24,8 +24,8 @@ class FirmAgent(ap.Agent):
# para
self.flt_crit_supplier = float(self.p.crit_supplier)
self.flt_firm_pref_request = float(self.p.firm_pref_request)
self.flt_firm_pref_accept = float(self.p.firm_pref_accept)
self.flt_firm_req_prf_size = float(self.p.firm_req_prf_size)
self.flt_firm_acc_prf_size = float(self.p.firm_acc_prf_size)
self.flt_diff_new_conn = float(self.p.diff_new_conn)
def remove_edge_to_cus_remove_cus_up_prod(self, remove_product):
@@ -95,7 +95,7 @@ class FirmAgent(ap.Agent):
if len(lst_firm_connect) == 0:
# select based on size
lst_size_damp = \
[size ** self.flt_firm_pref_request for size in
[size ** self.flt_firm_req_prf_size for size in
self.dct_cand_alt_supply_up_prod_removed[
product].revenue_log]
lst_prob = [size_damp / sum(lst_size_damp)
@@ -106,7 +106,7 @@ class FirmAgent(ap.Agent):
elif len(lst_firm_connect) > 0:
# select based on size of firm that has connection
lst_firm_size_damp = \
[size ** self.flt_firm_pref_accept
[size ** self.flt_firm_acc_prf_size
for size in lst_firm_connect.revenue_log]
lst_prob = \
[size_damp / sum(lst_firm_size_damp)
@@ -167,7 +167,7 @@ class FirmAgent(ap.Agent):
if len(lst_firm_connect) == 0:
# handling based on size
lst_firm_size_damp = \
[size ** self.flt_firm_pref_accept
[size ** self.flt_firm_acc_prf_size
for size in lst_firm.revenue_log]
lst_prob = \
[size_damp / sum(lst_firm_size_damp)
@@ -178,7 +178,7 @@ class FirmAgent(ap.Agent):
elif len(lst_firm_connect) > 0:
# handling based on size of firm that has connection
lst_firm_size_damp = \
[size ** self.flt_firm_pref_accept
[size ** self.flt_firm_acc_prf_size
for size in lst_firm_connect.revenue_log]
lst_prob = \
[size_damp / sum(lst_firm_size_damp)