-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta agents #2575
base: main
Are you sure you want to change the base?
Meta agents #2575
Conversation
- Add create meta-agents to experimental - Add tests of meta-agents - Add example with an alliance formation model in basic examples
Performance benchmarks:
|
Did you consider incorporating the |
I did, however just to get meta-agents started and integrated I avoided it since it will add a layer of complications and I was worried about collisions and MRO issues -- Ways forward in no particular order are add AgentSet so each meta-agent has the AgentSet functionality, integrate threading so meta-agents can be on their own thread in 3.13 forward, allow for greater combinatorics (e.g. agents can be in multiple meta-agents) |
Cool, I will try to dive in and do a proper review tomorrow or Monday. |
I am playing catch-up on this. This is interesting. I do not have strong opinions on the setup, and I feel like @EwoutH and @quaquel have it covered. Question for everyone regarding adding an example in the core examples folder: If memory serves me correctly -- we were adamant about only having five examples with ones that build off of those for maintenance purposes. In what cases do we justify an additional example to the core folder as opposed to the examples folder? (I ask because our original examples folder grew to the maintenance issue that it is because we were trying to demonstrate all the functionality we had in at least one location). |
Well clearly I am going to have a bias on this, however, I did consider the challenge of an excess of core examples and the reason I built in basic examples as an exception is because as far I know this would be a unique capability of Mesa compared to NetLogo, MASON etc. Putting it in the basic examples would make it more prominent and easier for users to see, ideally further increasing Mesa's competitiveness as the ABM library of choice. A second option would be putting it in mesa-examples and then adding some documentation in getting started. Or I could just put it in Mesa-examples. I am good with whatever the group decides, just let me know. |
Summary
This PR is useful for creating meta-agents that represent groups of agents with interdependent characteristics.
New meta-agent classes are created dynamically using the provided name, attributes and functions of sub agents, and unique attributes and functions.
supersedes #2561
Motive
This method is for dynamically creating new agents (meta-agents).
Meta-agents are defined as agents composed of existing agents.
Meta-agents are created dynamically with a pointer to the model, name of the meta-agent,
iterable of agents to belong to the new meta-agents, any new functions for the meta-agent,
any new attributes for the meta-agent, whether to retain sub-agent functions,
whether to retain sub-agent attributes.
Examples of meta-agents:
battery, computer etc. and the meta-agent is the car itself.
Currently meta-agents are restricted to one parent agent for each subagent/
one meta-agent per subagent.
Goal is to assess usage and expand functionality.
Implementation
Method has three paths of execution:
Added
meta_agents.py
in experimentalAdded tests in test-agent.py
Added alliance formation model in basic examples
Usage Examples
I added a basic example of alliance formation using the bilateral shapley value
Step 0- 50 Agents:
Step 8 - 17 Agents of increasing hierarchy added dynamically during code execution:
Additional Notes
Currently restricted to one parent agent and one meta-agent per agent. Goal is to assess usage and expand functionality.