reorder exp table + diff_new_conn

This commit is contained in:
2023-06-11 15:06:50 +08:00
parent 48077189f0
commit daab7af6ee
6 changed files with 31 additions and 20 deletions

View File

@@ -198,14 +198,7 @@ class FirmAgent(ap.Agent):
self.accept_request(select_customer, product)
def accept_request(self, down_firm, product):
lst_firm_size = [
firm.revenue_log for firm in self.model.a_lst_total_firms
if product in firm.a_lst_product
and product not in firm.a_lst_product_removed
]
prod_accept = self.revenue_log / sum(lst_firm_size)
# damp prod
prod_accept = prod_accept ** self.flt_diff_new_conn
prod_accept = self.flt_diff_new_conn
if self.model.nprandom.choice([True, False],
p=[prod_accept, 1 - prod_accept]):
self.firm_network.graph.add_edges_from([