model product firm

This commit is contained in:
2023-03-06 22:38:57 +08:00
parent 64ed87da0b
commit b291578889
7 changed files with 297 additions and 34 deletions

View File

@@ -14,3 +14,10 @@ class ProductAgent(ap.Agent):
return ap.AgentList(
self.model,
[ap.AgentIter(self.model, node).to_list()[0] for node in nodes])
def a_predecessors(self):
nodes = self.product_network.graph.predecessors(
self.product_network.positions[self])
return ap.AgentList(
self.model,
[ap.AgentIter(self.model, node).to_list()[0] for node in nodes])