-
Hey Joël, is there any example modeling multiple Agents of different types within a model? Would I create different classes of the Agent type and create agent1, agent2,..., agent n in the Model to let them interact? Maybe you can give me a quick overview on how to do this. BR |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Erlix322, you are right that there is no example for this in the docs yet. You would have to define two agent classes (e.g. class MyModel(ap.Model):
def setup(self):
self.type1_agents = ap.AgentList(self, 10, AgentType1)
self.type2_agents = ap.AgentList(self, 10, AgentType2)
self.all_agents = self.type1_agents + self.type2_agents You can then use these three lists to access either agents of just one type, or all agents together. |
Beta Was this translation helpful? Give feedback.
Hi @Erlix322, you are right that there is no example for this in the docs yet. You would have to define two agent classes (e.g.
AgentType1
andAgentType2
) and initiate a model for example as follows:You can then use these three lists to access either agents of just one type, or all agents together.