Dictionary of agents by type #2179
-
Hi, I have multiple agent types in my model. I wanted to know if there is a way to access a dictionary by agent types in which the agent's unique id is the key and the agent instance (memory address) is the value so that I can use the agent's unique id to access the attributes of the agent? This is similar to what a "who" number with "ask" statement would do in Netlogo. The reason I need this is because if I have agents of type A and B, I need to process agent A's data (agents filtered/sorted based on an attribute) in agent B's functions/methods. Thank you :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I found this... |
Beta Was this translation helpful? Give feedback.
-
Sorry for not getting back to you, it seems we all missed it. In Mesa there's a function Lines 107 to 109 in 3cf1b76 Let me know if that helps! |
Beta Was this translation helpful? Give feedback.
I found this...
self.schedule.agents_by_type["Agent class name"]