Firm accept request conditionally
This commit is contained in:
7
firm.py
7
firm.py
@@ -123,11 +123,12 @@ class FirmAgent(ap.Agent):
|
||||
# print(product.code, [firm.name for firm in list_firm])
|
||||
|
||||
def accept_request(self, down_firm, product):
|
||||
# if self.model.nprandom.choice([True, False], p=[0.1, 0.9]):
|
||||
self.firm_network.graph.add_edges_from([
|
||||
(self.firm_network.positions[self],
|
||||
self.firm_network.positions[down_firm], {
|
||||
'Product': product.code
|
||||
})
|
||||
self.firm_network.positions[down_firm], {
|
||||
'Product': product.code
|
||||
})
|
||||
])
|
||||
self.dct_prod_capacity[product] -= 1
|
||||
self.dct_request_prod_from_firm[product].remove(down_firm)
|
||||
|
||||
Reference in New Issue
Block a user