connected firm no accept probability

This commit is contained in:
HaoYizhi 2023-07-27 12:50:52 +08:00
parent 924847db5d
commit 74d8798b1d
13 changed files with 58 additions and 9 deletions

4
.vscode/launch.json vendored
View File

@ -12,9 +12,9 @@
"console": "integratedTerminal", "console": "integratedTerminal",
"justMyCode": true, "justMyCode": true,
"args": [ "args": [
"--exp", "with_exp", "--exp", "test",
"--reset_db", "True", "--reset_db", "True",
"--job", "24" "--job", "1"
] ]
} }
] ]

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
db_name_prefix: with_exp db_name_prefix: test

View File

@ -72,7 +72,7 @@ class ControllerDB:
# list_dct = [{'133': ['1.4.4.1']}] # list_dct = [{'133': ['1.4.4.1']}]
# list_dct = [{'2': ['1.1.3']}] # list_dct = [{'2': ['1.1.3']}]
# list_dct = [{'135': ['1.3.2.1']}] # list_dct = [{'135': ['1.3.2.1']}]
# list_dct = [{'79': ['2.1.3.4']}] list_dct = [{'79': ['2.1.3.4']}]
# list_dct = [{'99': ['1.3.3']}] # list_dct = [{'99': ['1.3.3']}]
# list_dct = [{'41': ['1.4.5']}] # list_dct = [{'41': ['1.4.5']}]

BIN
doc/会议20230712.docx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -261,7 +261,14 @@ class FirmAgent(ap.Agent):
def accept_request(self, down_firm, product): def accept_request(self, down_firm, product):
# para product is the product that self is selling # para product is the product that self is selling
prod_accept = self.flt_diff_new_conn # connected firm has no probability
node_self = self.get_firm_network_node()
node_d_firm = down_firm.get_firm_network_node()
if self.model.firm_network.graph.has_edge(node_self, node_d_firm) or \
self.model.firm_network.graph.has_edge(node_d_firm, node_self):
prod_accept = 1.0
else:
prod_accept = self.flt_diff_new_conn
if self.model.nprandom.choice([True, False], if self.model.nprandom.choice([True, False],
p=[prod_accept, 1 - prod_accept]): p=[prod_accept, 1 - prod_accept]):
self.firm_network.graph.add_edges_from([ self.firm_network.graph.add_edges_from([

File diff suppressed because one or more lines are too long

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,crit_supplier,proactive_ratio,remove_t,netw_prf_n
15,TRUE,TRUE,uniform,5,0.3,2,0.3,3,3 7,TRUE,TRUE,uniform,5,0.3,2,0.3,3,3
10,FALSE,FALSE,normal,10,0.5,1,0.5,5,2 5,FALSE,FALSE,normal,10,0.5,1,0.5,5,2
5,,,,15,0.7,0.5,0.7,7,1 3,,,,15,0.7,0.5,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 15 7 TRUE TRUE uniform 5 0.3 2 0.3 3 3
3 10 5 FALSE FALSE normal 10 0.5 1 0.5 5 2
4 5 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,crit_supplier,proactive_ratio,remove_t,netw_prf_n
10,TRUE,TRUE,uniform,10,0.5,1,0,5,2 5,TRUE,TRUE,uniform,10,0.5,1,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 10 5 TRUE TRUE uniform 10 0.5 1 0 5 2