remove crit_supplier

This commit is contained in:
HaoYizhi 2023-07-28 15:14:59 +08:00
parent 921f03fc44
commit a321df0582
13 changed files with 121 additions and 95 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -117,7 +117,7 @@ class ControllerDB:
dct_lst_init_disrupt_firm_prod, g_bom, dct_lst_init_disrupt_firm_prod, g_bom,
n_max_trial, prf_size, prf_conn, n_max_trial, prf_size, prf_conn,
cap_limit_prob_type, cap_limit_level, cap_limit_prob_type, cap_limit_level,
diff_new_conn, crit_supplier, diff_new_conn,
proactive_ratio, remove_t, netw_prf_n): proactive_ratio, remove_t, netw_prf_n):
e = Experiment( e = Experiment(
idx_scenario=idx_scenario, idx_scenario=idx_scenario,
@ -132,7 +132,6 @@ class ControllerDB:
cap_limit_prob_type=cap_limit_prob_type, cap_limit_prob_type=cap_limit_prob_type,
cap_limit_level=cap_limit_level, cap_limit_level=cap_limit_level,
diff_new_conn=diff_new_conn, diff_new_conn=diff_new_conn,
crit_supplier=crit_supplier,
proactive_ratio=proactive_ratio, proactive_ratio=proactive_ratio,
remove_t=remove_t, remove_t=remove_t,
netw_prf_n=netw_prf_n netw_prf_n=netw_prf_n

90
firm.py
View File

@ -1,5 +1,4 @@
import agentpy as ap import agentpy as ap
import math
class FirmAgent(ap.Agent): class FirmAgent(ap.Agent):
@ -26,7 +25,6 @@ class FirmAgent(ap.Agent):
self.str_cap_limit_prob_type = str(self.p.cap_limit_prob_type) self.str_cap_limit_prob_type = str(self.p.cap_limit_prob_type)
self.flt_cap_limit_level = float(self.p.cap_limit_level) self.flt_cap_limit_level = float(self.p.cap_limit_level)
self.flt_diff_new_conn = float(self.p.diff_new_conn) self.flt_diff_new_conn = float(self.p.diff_new_conn)
self.flt_crit_supplier = float(self.p.crit_supplier)
# init size_stat (self para) # init size_stat (self para)
# (size, time step) # (size, time step)
@ -36,9 +34,14 @@ class FirmAgent(ap.Agent):
for prod in a_lst_product: for prod in a_lst_product:
self.dct_prod_up_prod_stat[prod] = { self.dct_prod_up_prod_stat[prod] = {
# (Normal / Disrupted / Removed, time step) # (Normal / Disrupted / Removed, time step)
'status': [('N', 0)], 'p_stat': [('N', 0)],
# have or have no supply # have or have no supply
'supply': dict.fromkeys(prod.a_predecessors(), True) 'supply': dict.fromkeys(prod.a_predecessors(), True),
# supply for each component and respective disrupted supplier
# lst_disrupt_firm is refreshed to [] at each update
's_stat': dict.fromkeys(prod.a_predecessors(),
{'stat': True,
'lst_disrupt_firm': []})
} }
# init extra capacity (self para) # init extra capacity (self para)
@ -62,45 +65,58 @@ class FirmAgent(ap.Agent):
# print(firm_agent.name, extra_cap) # print(firm_agent.name, extra_cap)
self.dct_prod_capacity[product] = extra_cap self.dct_prod_capacity[product] = extra_cap
def remove_edge_to_cus_disrupt_cus_up_prod(self, disrupted_prod): def remove_edge_to_cus(self, disrupted_prod):
# para disrupted_prod is the product that self got disrupted # para disrupted_prod is the product that self got disrupted
lst_out_edge = list( lst_out_edge = list(
self.firm_network.graph.out_edges( self.firm_network.graph.out_edges(
self.firm_network.positions[self], keys=True, data='Product')) self.firm_network.positions[self], keys=True, data='Product'))
for n1, n2, key, product_code in lst_out_edge: for n1, n2, key, product_code in lst_out_edge:
if product_code == disrupted_prod.code: if product_code == disrupted_prod.code:
# remove edge to customer # update customer up product supplier status
self.firm_network.graph.remove_edge(n1, n2, key)
# customer up product affected conditionally
customer = ap.AgentIter(self.model, n2).to_list()[0] customer = ap.AgentIter(self.model, n2).to_list()[0]
lst_in_edge = list(
self.firm_network.graph.in_edges(n2,
keys=True,
data='Product'))
lst_select_in_edge = [
edge for edge in lst_in_edge
if edge[-1] == disrupted_prod.code
]
prob_lost_supp = math.exp(-1 * self.flt_crit_supplier *
len(lst_select_in_edge))
if self.model.nprandom.choice([True, False],
p=[prob_lost_supp,
1 - prob_lost_supp]):
customer.dct_n_trial_up_prod_disrupted[disrupted_prod] = 0
for prod in customer.dct_prod_up_prod_stat.keys(): for prod in customer.dct_prod_up_prod_stat.keys():
if disrupted_prod in \ if disrupted_prod in \
customer.dct_prod_up_prod_stat[ customer.dct_prod_up_prod_stat[
prod]['supply'].keys(): prod]['s_stat'].keys():
if self not in customer.dct_prod_up_prod_stat[
prod]['s_stat'][disrupted_prod][
'lst_disrupt_firm']:
customer.dct_prod_up_prod_stat[ customer.dct_prod_up_prod_stat[
prod]['supply'][disrupted_prod] = False prod]['s_stat'][disrupted_prod][
status, _ = customer.dct_prod_up_prod_stat[ 'lst_disrupt_firm'].append(self)
prod]['status'][-1] # remove edge to customer
self.firm_network.graph.remove_edge(n1, n2, key)
def disrupt_cus_prod(self, prod, disrupted_up_prod):
# para prod is the product that has disrupted_up_prod
# para disrupted_up_prod is the product that
# self's component exists disrupted supplier
num_lost = \
len(self.dct_prod_up_prod_stat[prod]['s_stat']
[disrupted_up_prod]['lst_disrupt_firm'])
num_remain = \
len([u for u, _, _, d in
self.firm_network.graph.in_edges(self.get_firm_network_node(),
keys=True,
data='Product')
if d == disrupted_up_prod.code])
lost_percent = num_lost / (num_lost + num_remain)
lst_size = \
[firm.size_stat[-1][0] for firm in self.model.a_lst_total_firms]
std_size = (self.size_stat[-1][0] - min(lst_size) + 1) \
/ (max(lst_size) - min(lst_size) + 1)
prob_disrupt = 1 - std_size * (1 - lost_percent)
if self.model.nprandom.choice([True, False],
p=[prob_disrupt,
1 - prob_disrupt]):
self.dct_n_trial_up_prod_disrupted[disrupted_up_prod] = 0
self.dct_prod_up_prod_stat[
prod]['s_stat'][disrupted_up_prod]['stat'] = False
status, _ = self.dct_prod_up_prod_stat[
prod]['p_stat'][-1]
if status != 'D': if status != 'D':
customer.dct_prod_up_prod_stat[ self.dct_prod_up_prod_stat[
prod]['status'].append(('D', self.model.t)) prod]['p_stat'].append(('D', self.model.t))
# print(self.name, disrupted_prod.code, 'disrupt',
# customer.name, prod.code)
def seek_alt_supply(self, product): def seek_alt_supply(self, product):
# para product is the product that self is seeking # para product is the product that self is seeking
@ -270,7 +286,7 @@ class FirmAgent(ap.Agent):
down_firm.dct_prod_up_prod_stat[ down_firm.dct_prod_up_prod_stat[
prod]['supply'][product] = True prod]['supply'][product] = True
down_firm.dct_prod_up_prod_stat[ down_firm.dct_prod_up_prod_stat[
prod]['status'].append(('N', self.model.t)) prod]['p_stat'].append(('N', self.model.t))
del down_firm.dct_n_trial_up_prod_disrupted[product] del down_firm.dct_n_trial_up_prod_disrupted[product]
del down_firm.dct_cand_alt_supp_up_prod_disrupted[product] del down_firm.dct_cand_alt_supp_up_prod_disrupted[product]
@ -296,17 +312,21 @@ class FirmAgent(ap.Agent):
# update the status of firm # update the status of firm
for prod in self.dct_prod_up_prod_stat.keys(): for prod in self.dct_prod_up_prod_stat.keys():
status, ts = self.dct_prod_up_prod_stat[prod]['status'][-1] status, ts = self.dct_prod_up_prod_stat[prod]['p_stat'][-1]
if ts != self.model.t: if ts != self.model.t:
self.dct_prod_up_prod_stat[prod]['status'].append( self.dct_prod_up_prod_stat[prod]['p_stat'].append(
(status, self.model.t)) (status, self.model.t))
# refresh lst_disrupt_firm
for up_prod in self.dct_prod_up_prod_stat[prod]['s_stat'].keys():
self.dct_prod_up_prod_stat[prod][
's_stat'][up_prod]['lst_disrupt_firm'] = []
def get_firm_network_node(self): def get_firm_network_node(self):
return self.firm_network.positions[self] return self.firm_network.positions[self]
def is_prod_in_current_normal(self, prod): def is_prod_in_current_normal(self, prod):
if prod in self.dct_prod_up_prod_stat.keys(): if prod in self.dct_prod_up_prod_stat.keys():
if self.dct_prod_up_prod_stat[prod]['status'][-1][0] == 'N': if self.dct_prod_up_prod_stat[prod]['p_stat'][-1][0] == 'N':
return True return True
else: else:
return False return False

View File

@ -228,7 +228,7 @@ class Model(ap.Model):
assert product in firm.dct_prod_up_prod_stat.keys(), \ assert product in firm.dct_prod_up_prod_stat.keys(), \
f"product {product.code} not in firm {firm.code}" f"product {product.code} not in firm {firm.code}"
firm.dct_prod_up_prod_stat[ firm.dct_prod_up_prod_stat[
product]['status'].append(('D', self.t)) product]['p_stat'].append(('D', self.t))
# print(f"initial disruption {firm.name} {product.code}") # print(f"initial disruption {firm.name} {product.code}")
# proactive strategy # proactive strategy
@ -349,7 +349,7 @@ class Model(ap.Model):
# reduce the size of disrupted firm # reduce the size of disrupted firm
for firm in self.a_lst_total_firms: for firm in self.a_lst_total_firms:
for prod in firm.dct_prod_up_prod_stat.keys(): for prod in firm.dct_prod_up_prod_stat.keys():
status, ts = firm.dct_prod_up_prod_stat[prod]['status'][-1] status, ts = firm.dct_prod_up_prod_stat[prod]['p_stat'][-1]
if status == 'D': if status == 'D':
size = firm.size_stat[-1][0] - \ size = firm.size_stat[-1][0] - \
firm.size_stat[0][0] \ firm.size_stat[0][0] \
@ -360,19 +360,19 @@ class Model(ap.Model):
# f'to {firm.size_stat[-1][0]} due to {prod.code}') # f'to {firm.size_stat[-1][0]} due to {prod.code}')
lst_is_disrupt = \ lst_is_disrupt = \
[stat == 'D' for stat, _ in [stat == 'D' for stat, _ in
firm.dct_prod_up_prod_stat[prod]['status'] firm.dct_prod_up_prod_stat[prod]['p_stat']
[-1 * self.remove_t:]] [-1 * self.remove_t:]]
if all(lst_is_disrupt): if all(lst_is_disrupt):
# turn disrupted firm into removed firm # turn disrupted firm into removed firm
# when last self.remove_t times status is all disrupted # when last self.remove_t times status is all disrupted
firm.dct_prod_up_prod_stat[ firm.dct_prod_up_prod_stat[
prod]['status'].append(('R', self.t)) prod]['p_stat'].append(('R', self.t))
# stop simulation if any firm still in disrupted except inital removal # stop simulation if any firm still in disrupted except inital removal
if self.t > 0: if self.t > 0:
for firm in self.a_lst_total_firms: for firm in self.a_lst_total_firms:
for prod in firm.dct_prod_up_prod_stat.keys(): for prod in firm.dct_prod_up_prod_stat.keys():
status, _ = firm.dct_prod_up_prod_stat[prod]['status'][-1] status, _ = firm.dct_prod_up_prod_stat[prod]['p_stat'][-1]
is_init = \ is_init = \
firm in self.dct_lst_init_disrupt_firm_prod.keys() \ firm in self.dct_lst_init_disrupt_firm_prod.keys() \
and prod in self.dct_lst_init_disrupt_firm_prod[firm] and prod in self.dct_lst_init_disrupt_firm_prod[firm]
@ -397,9 +397,17 @@ class Model(ap.Model):
for prod in firm.dct_prod_up_prod_stat.keys(): for prod in firm.dct_prod_up_prod_stat.keys():
# repetition of disrupted firm that last for multiple ts is ok, # repetition of disrupted firm that last for multiple ts is ok,
# as their edge has already been removed # as their edge has already been removed
status, ts = firm.dct_prod_up_prod_stat[prod]['status'][-1] status, ts = firm.dct_prod_up_prod_stat[prod]['p_stat'][-1]
if status == 'D' and ts == self.t-1: if status == 'D' and ts == self.t-1:
firm.remove_edge_to_cus_disrupt_cus_up_prod(prod) firm.remove_edge_to_cus(prod)
for firm in self.a_lst_total_firms:
for prod in firm.dct_prod_up_prod_stat.keys():
for up_prod in firm.dct_prod_up_prod_stat[prod][
's_stat'].keys():
if firm.dct_prod_up_prod_stat[prod][
's_stat'][up_prod]['lst_disrupt_firm']:
firm.disrupt_cus_prod(prod, up_prod)
for n_trial in range(self.int_n_max_trial): for n_trial in range(self.int_n_max_trial):
# print('=' * 10, 'trial', n_trial, '=' * 10) # print('=' * 10, 'trial', n_trial, '=' * 10)
@ -410,7 +418,7 @@ class Model(ap.Model):
for firm in self.a_lst_total_firms: for firm in self.a_lst_total_firms:
lst_seek_prod = [] lst_seek_prod = []
for prod in firm.dct_prod_up_prod_stat.keys(): for prod in firm.dct_prod_up_prod_stat.keys():
status = firm.dct_prod_up_prod_stat[prod]['status'][-1][0] status = firm.dct_prod_up_prod_stat[prod]['p_stat'][-1][0]
if status == 'D': if status == 'D':
for supply in firm.dct_prod_up_prod_stat[ for supply in firm.dct_prod_up_prod_stat[
prod]['supply'].keys(): prod]['supply'].keys():
@ -448,11 +456,11 @@ class Model(ap.Model):
for prod, dct_status_supply in \ for prod, dct_status_supply in \
firm.dct_prod_up_prod_stat.items(): firm.dct_prod_up_prod_stat.items():
lst_is_normal = [stat == 'N' for stat, _ lst_is_normal = [stat == 'N' for stat, _
in dct_status_supply['status']] in dct_status_supply['p_stat']]
if not all(lst_is_normal): if not all(lst_is_normal):
# print(f"{firm.name} {prod.code}:") # print(f"{firm.name} {prod.code}:")
# print(dct_status_supply['status']) # print(dct_status_supply['p_stat'])
for status, ts in dct_status_supply['status']: for status, ts in dct_status_supply['p_stat']:
db_r = Result(s_id=self.sample.id, db_r = Result(s_id=self.sample.id,
id_firm=firm.code, id_firm=firm.code,
id_product=prod.code, id_product=prod.code,

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 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 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,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1 1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1
2,0,0,0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,2,2,2,2,2 2,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,2,2,2,2,2,2
0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,2,2,2,2 0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,2,2,2,2
1,0,0,0,1,1,1,2,2,2,0,0,1,1,1,1,1,1,2,0,0,0,0 1,0,0,0,1,1,1,2,2,0,0,1,1,1,1,1,1,2,2,0,0,0,0
2,0,0,0,2,2,2,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1 2,0,0,0,2,2,2,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1
0,0,0,1,0,1,2,0,1,2,1,1,0,0,0,1,1,1,2,0,1,1,2 0,0,0,1,0,1,2,0,1,1,1,0,0,0,1,1,1,2,2,0,1,1,2
1,0,0,1,1,2,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 0
26 0 1 0 0 2 1 0 1 2 2 1 1 1 1 0 0 1 1 1 0 0 0 2 0 2 0 1 1
27 1 1 0 0 0 2 1 2 0 0 1 1 1 1 0 0 1 1 1 0 0 0 1 0 1 2 2
28 2 1 0 0 1 0 2 0 1 1 1 1 1 0 0 1 1 1 0 0 0 1 2 1 2 0 0
29 0 1 1 1 2 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 0 2 1 2 0 2
30 1 1 1 1 0 2 2 2 1 1 0 0 0 0 0 1 1 1 0 0 1 1 0 2 0 1 0
31 2 1 1 1 1 0 0 0 2 2 0 0 0 0 0 1 1 1 0 0 1 1 2 1 0 1 2 1
32 0 1 1 0 2 2 2 1 2 1 1 0 0 1 1 0 0 0 0 1 1 1 1 0 1 0 0
33 1 1 1 0 0 0 0 2 0 2 1 1 0 0 1 1 0 0 0 0 1 1 1 2 2 1 2 1 1
34 2 1 1 0 1 1 1 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 1 0 0 2 0 2 2
35 0 1 1 0 2 0 1 2 1 2 0 0 1 1 0 0 1 1 0 0 1 1 1 0 0 2 0 1 1 2 0
36 1 1 1 0 0 1 2 0 2 0 0 1 1 0 0 1 1 0 0 1 1 1 0 0 1 2 2 0 1
37 2 1 1 0 1 2 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 1 0 0 1 2 0 0 1 2

Binary file not shown.

View File

@ -1,2 +1,2 @@
X1,X2,X3,X4,X5,X6,X7,X8,X9,X10 X1,X2,X3,X4,X5,X6,X7,X8,X9
0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0

1 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10
2 0 0 0 0 0 0 0 0 0 0

1
orm.py
View File

@ -60,7 +60,6 @@ class Experiment(Base):
cap_limit_prob_type = Column(String(16), nullable=False) cap_limit_prob_type = Column(String(16), nullable=False)
cap_limit_level = Column(DECIMAL(8, 4), nullable=False) cap_limit_level = Column(DECIMAL(8, 4), nullable=False)
diff_new_conn = Column(DECIMAL(8, 4), nullable=False) diff_new_conn = Column(DECIMAL(8, 4), nullable=False)
crit_supplier = Column(DECIMAL(8, 4), nullable=False)
proactive_ratio = Column(DECIMAL(8, 4), nullable=False) proactive_ratio = Column(DECIMAL(8, 4), nullable=False)
remove_t = Column(Integer, nullable=False) remove_t = Column(Integer, nullable=False)
netw_prf_n = Column(Integer, nullable=False) netw_prf_n = Column(Integer, nullable=False)

View File

@ -1,4 +1,4 @@
n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,crit_supplier,proactive_ratio,remove_t,netw_prf_n n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,proactive_ratio,remove_t,netw_prf_n
7,TRUE,TRUE,uniform,5,0.3,2,0.3,3,3 7,TRUE,TRUE,uniform,5,0.3,0.3,3,3
5,FALSE,FALSE,normal,10,0.5,1,0.5,5,2 5,FALSE,FALSE,normal,10,0.5,0.5,5,2
3,,,,15,0.7,0.5,0.7,7,1 3,,,,15,0.7,0.7,7,1

1 n_max_trial prf_size prf_conn cap_limit_prob_type cap_limit_level diff_new_conn crit_supplier proactive_ratio remove_t netw_prf_n
2 7 TRUE TRUE uniform 5 0.3 2 0.3 3 3
3 5 FALSE FALSE normal 10 0.5 1 0.5 5 2
4 3 15 0.7 0.5 0.7 7 1

View File

@ -1,2 +1,2 @@
n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,crit_supplier,proactive_ratio,remove_t,netw_prf_n n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,proactive_ratio,remove_t,netw_prf_n
5,TRUE,TRUE,uniform,10,0.5,1,0,5,2 5,TRUE,TRUE,uniform,10,0.5,0,5,2

1 n_max_trial prf_size prf_conn cap_limit_prob_type cap_limit_level diff_new_conn crit_supplier proactive_ratio remove_t netw_prf_n
2 5 TRUE TRUE uniform 10 0.5 1 0 5 2