Replies: 5 comments 10 replies
-
2 issues on the visualization tutorial: 1- Histogram for the final visual (3rd solara dashboard) does not update with the model, stays a static graph of agent wealth at step 0 (I will say the visualizations and dashboard are awesome! I am a big fan) Thoughts @Corvince? |
Beta Was this translation helpful? Give feedback.
-
I plan on taking care of this (cause really I can just ride @EwoutH coattails), but wanted to document it. The migration guide has an excellent overview of using different scheduling options and how to create them with I am going put them in the How To Guide (without references to the Mesa < 3.0 so that why it can be referenced for new users. |
Beta Was this translation helpful? Give feedback.
-
This is a small issue I've noticed, as the fix is easy, but one of the side-effects of wrapping an event callable in a weak ref is that, if the event's scope outlives that callable, then the event silently fails to execute. The most obvious example are lambdas that are defined from within the callable. A contrived example: import mesa
from mesa.experimental.devs.simulator import ABMSimulator
class ExampleAgent(mesa.Agent):
def step(self):
# this runs! you'll see "message: this works!"
self.model.sim.schedule_event_now(self.event_callable, function_args=("this works!",))
# this one doesn't; lambda no longer exists after the scope of the `step()` method ends, which is outlived by the event scheduler
self.model.sim.schedule_event_now(lambda: self.event_callable("this does not work :("))
def event_callable(self, msg: str):
print("message:", msg)
class ExampleModel(mesa.Model):
def __init__(self, sim: ABMSimulator):
super().__init__()
self.sim = sim
self.agent = ExampleAgent(model=self)
def step(self):
self.agents.do("step")
sim = ABMSimulator()
model = ExampleModel(sim=sim)
sim.setup(model)
sim.run_for(1)
>>> message: this works! Again, this is an easy fix; in my example, just assigning the |
Beta Was this translation helpful? Give feedback.
-
There has been some talk at various locations about API stability of 3.0 with regards to examples and visualization. Here are my 2 cents: Examples. Even though some are now bundled with mesa, I think it should be obvious that they are not part of the public API and subject to semantic versioning. We should be able to freely change those without causing a breaking change for mesa itself. Visualization. I think we can consider the SolaraViz itself stable. Not so much the components/the component creation. There is currently a lot of talk about those with some very good ideas, but just ideas. I see two possibilities
I am currently leaning towards 2, since it doesn't cause a rush and allows us to release 3.0 soon |
Beta Was this translation helpful? Give feedback.
-
Hi everyone (and especially @hiltonlamf @pollockDeVis @PeakEwan @peihsunhsieh @AlABarazi @creativechirag26 @rmhopkins4 @DrEntropy @maplesync @PestyVesty @Yureeets @jtcooper10)! We just released the Mesa 3.0 Release Candidate, our last pre-release before we will tag Mesa 3.0 as stable. We're really curious what you think of this latest version, if anything is inconsistent or missing, if you have any other feedback. I hope you're willing to test it out and let us know what you think! |
Beta Was this translation helpful? Give feedback.
-
Mesa 3.0 is in beta! Ask you questions and share your feedback here.
Install with
pip install --upgrade --pre mesa
Resources: Migration guide | Release notes | Mesa overview
Our planned timeline:
Update: We’re delaying with one or two weeks. 3.0 stable targeted in the first half of November.
Beta Was this translation helpful? Give feedback.
All reactions