Replies: 22 comments
-
Someone started a port a few months or maybe even years ago. I think it was named black mesa, but I can't find it anymore right now. That said I don't think there will be any resistance if you want to port it! |
Beta Was this translation helpful? Give feedback.
-
Their benchmark claims that Agents.jl is significantly faster than Mesa, with fewer LOC. Sounds very promising. People could be migrating to Julia for ABM instead of Python. I'm still investigating why they have fewer LOC, while at the same time porting a subset of Mesa just enough to be able to run the forest fire example. |
Beta Was this translation helpful? Give feedback.
-
Ugh! The benchmark is not fair. The Mesa code for forest fire includes data collection (see https://github.com/JuliaDynamics/Agents.jl/blob/4bf56d853cdaa47db8416ab92271d2dedfc499ff/benchmark/compare/Mesa/ForestFire/model.py#L63).
When I commented out all the data collection lines, I got
The Agents.jl implementation of forest fire contains no data collection at all: https://github.com/JuliaDynamics/Agents.jl/blob/4bf56d853cdaa47db8416ab92271d2dedfc499ff/src/models/forestfire.jl.
Which is definitely hard to beat. Regarding with LOC, another reason why the Mesa version is longer is because of the boilerplate line like |
Beta Was this translation helpful? Give feedback.
-
Also, since the Mesa benchmark code is copied/derived from Mesa's exmples/ code, there should be an attribution somewhere in Agents.jl repo. |
Beta Was this translation helpful? Give feedback.
-
Great, it is already merged! The comparison is definitely motivating for optimizing mesa. Not necessarily the performance, which will be impossible, but also the LOCs (although, as you have shown, not the best metric). |
Beta Was this translation helpful? Give feedback.
-
Further unnecessary code in ForestFire: # unused agent method
def get_pos(self):
return self.pos # unnecessary attribute settings
self.height = height
self.width = width
self.density = density Just on a first look! |
Beta Was this translation helpful? Give feedback.
-
Python may not be able to outrun Julia, but Mesa is even slower and more verbose than NetLogo in the outdated benchmark. |
Beta Was this translation helpful? Give feedback.
-
This line is necessary. |
Beta Was this translation helpful? Give feedback.
-
Why/how? Maybe I just don't see it, but it would be very helpful if you could explain your comments a bit more |
Beta Was this translation helpful? Give feedback.
-
Ah, never mind. Yeah, density is only used for the |
Beta Was this translation helpful? Give feedback.
-
I removed them in #981 |
Beta Was this translation helpful? Give feedback.
-
From https://juliadynamics.github.io/Agents.jl/stable/#Comparison-with-existing-software
|
Beta Was this translation helpful? Give feedback.
-
Maybe @Libbum can explain a few of the design choices? There is stuff like the dict of agents lives in Maybe the API simplifications can be incorporated into Mesa? |
Beta Was this translation helpful? Give feedback.
-
Hi all! The benchmark files you're actively working on now and comparisons you see in our table in the documentation were completed by the original author who has now left the project. That being said, I'm very happy to work with you on improving what we can together, for both packages and ABM frameworks in general. One thing I know is a problem in terms of speed for Mesa is your continuous space. The way we (and MASON) manage this is we actually operate on a grid for neighbour searches etc, so we don't have to do a bunch of vector calculations to everyone in the space, just those in grid cells covered by some radius. |
Beta Was this translation helpful? Give feedback.
-
I am catching up, but I wanted to say that I love everything about this thread and everything that came from it including the dialog that has started with @Libbum. |
Beta Was this translation helpful? Give feedback.
-
Closing discussion linked to optimize continuous space module #993 |
Beta Was this translation helpful? Give feedback.
-
Why is the issue closed? Continuous space is not the only point in this design discussion. |
Beta Was this translation helpful? Give feedback.
-
@rht Sorry, I closed after the dev meeting discussion. The larger goal was to transition from a comparison to julia to actionable issues to take as Mesa transitions to GitHub discussions. Please, feel free to add more action items to the issues list from this discussion. (Can we just transition this to discussions??) |
Beta Was this translation helpful? Give feedback.
-
Did you mean GitHub Discussions? It isn't enabled yet. #987 |
Beta Was this translation helpful? Give feedback.
-
@tpike3 can you leave this issue open until the Dicussions is enabled? |
Beta Was this translation helpful? Give feedback.
-
Do you think it is worth it to make a Mesa-like library in Julia, maintaining the familiar APIs?
Example of a library doing it: https://github.com/QuantEcon/QuantEcon.py (reference implementation), with https://github.com/QuantEcon/QuantEcon.jl.
Beta Was this translation helpful? Give feedback.
All reactions