add comments

This commit is contained in:
2023-08-22 23:22:30 -04:00
parent 1d66d8bb4e
commit b84ab810d0
3 changed files with 31 additions and 28 deletions

View File

@@ -9,6 +9,7 @@ class ProductAgent(ap.Agent):
self.name = name
def a_successors(self):
# find successors of a product, return in AgentList (ProductAgent)
nodes = self.product_network.graph.successors(
self.product_network.positions[self])
return ap.AgentList(
@@ -16,6 +17,7 @@ class ProductAgent(ap.Agent):
[ap.AgentIter(self.model, node).to_list()[0] for node in nodes])
def a_predecessors(self):
# find predecessors of a product, return in AgentList (ProductAgent)
nodes = self.product_network.graph.predecessors(
self.product_network.positions[self])
return ap.AgentList(