From 3e87cffa63d1b1fba8b7d8e90466beac448e918c Mon Sep 17 00:00:00 2001 From: HaoYizhi Date: Sun, 18 Jun 2023 21:39:58 +0800 Subject: [PATCH] 4 status (Normal / Affected / Disrupted / Removed) --- model.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model.py b/model.py index b1374a6..a1dd4ac 100644 --- a/model.py +++ b/model.py @@ -289,8 +289,8 @@ class Model(ap.Model): [firm.code == di_supp_node['Firm_Code'] for firm in self.a_lst_total_firms])[0] lst_cand = self.model.a_lst_total_firms.select([ - di_supp_prod in firm.a_lst_product - and di_supp_prod not in firm.a_lst_product_disrupted + di_supp_prod in firm.a_lst_product and + di_supp_prod not in firm.a_lst_product_disrupted for firm in self.model.a_lst_total_firms ]) n2n_betweenness = \ @@ -311,8 +311,8 @@ class Model(ap.Model): for product in self.a_lst_total_products])[0] # find a dfferent firm can produce the same product lst_cand = self.model.a_lst_total_firms.select([ - di_supp_prod in firm.a_lst_product - and di_supp_prod not in firm.a_lst_product_disrupted + di_supp_prod in firm.a_lst_product and + di_supp_prod not in firm.a_lst_product_disrupted and firm.code != di_supp_node['Firm_Code'] for firm in self.model.a_lst_total_firms ])