mesa-frames: faster mesa with data-frame based operations #1939
Replies: 9 comments 34 replies
-
Wow that sounds super interesting and the performance chart looks very promising. I am curious what kind of problems can be modeled this way and how we can facilitate the interoperability with mesa. Congratulations on the launch |
Beta Was this translation helpful? Give feedback.
-
Looks awesome, really excited to see where it’s going! If you need any (specific) input, feel free to tag me. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Sure, I will try to test both.
if the operation relies on the states of x previous agents one could use pandas rolling method. In this case, the implementation should still be left to the user. Otherwise, if the operation relies on external states or, as you mentioned, agents are removed, I do not see any other way of doing this then iterating sequentially through the rows. I will try to implement AgentSet using dataframes soon and let you know. |
Beta Was this translation helpful? Give feedback.
-
This is exciting stuff! |
Beta Was this translation helpful? Give feedback.
-
@rht @Corvince @EwoutH @jackiekazil let me know what you think of the implementation so far in adamamer20/mesa_frames#8. If you like the API, I will implement the backend with polars. |
Beta Was this translation helpful? Give feedback.
-
@adamamer20 Are you still working on this? I might want to run some simulations with around ~100.000 agents so I might become very interested - and invested - in this. |
Beta Was this translation helpful? Give feedback.
-
@jackiekazil @tpike3 @rht @wang-boyu @quaquel @Corvince @EwoutH |
Beta Was this translation helpful? Give feedback.
-
Regarding with the naming, I'm wondering if it is easier to remember to name it mesa-frame instead of mesa-frames? I don't see a rationale for making it plural. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am excited to introduce a new extension for the Mesa simulation library, named mesa-frames. This extension is designed to enhance the performance of models with thousands of agents by leveraging pandas dataframes for storing agent attributes and utilizing vectorized operations. In cases where vectorized operations are not feasible, operations can be performed by row by using .apply. This approach has demonstrated greater efficiency than parallel processing the steps of the agents in my project.
The goal of mesa-frames is to facilitate an easy transition from the base Mesa library, ensuring compatibility with existing Mesa operations while introducing the capability to 'vectorize' a model using a decorator. Currently, the extension is in its initial proof-of-concept stage.
I warmly welcome feedback, suggestions, and contributions to this project.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions