connected firm no accept probability
This commit is contained in:
parent
924847db5d
commit
74d8798b1d
|
@ -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.
Binary file not shown.
|
@ -1 +1 @@
|
||||||
db_name_prefix: with_exp
|
db_name_prefix: test
|
||||||
|
|
|
@ -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']}]
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
7
firm.py
7
firm.py
|
@ -261,6 +261,13 @@ 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
|
||||||
|
# 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
|
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]):
|
||||||
|
|
42
test.ipynb
42
test.ipynb
File diff suppressed because one or more lines are too long
|
@ -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,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
|
||||||
|
|
|
Loading…
Reference in New Issue