projectmesa / mesa-examples

Seminal agent-based models developed using Mesa
Other
105 stars 123 forks source link

Sugarscape Chapter 3- Draft Pull Request #106

Open apranav22 opened 4 months ago

apranav22 commented 4 months ago

TODO:

Current Issues:

rht commented 4 months ago

@apranav22 how much smaller would the code be if it were to inherit from the existing sugarscape_cg classes? Let me know, and if it is sufficiently small, we may publish sugarscape_cg to be importable from mesa_models. Only 4 models are published for now: https://github.com/projectmesa/mesa-examples/blob/main/setup.cfg.

apranav22 commented 4 months ago

@rht I think it would reduce redundant code by an order of magnitude actually. Shall I rewrite the code to inherit from the existing files?

I also wanted to refactor a little bit keeping AgentSets in mind. Is writing examples with experimental features encourages?

rht commented 4 months ago

I published the sugarscape_cg in #108. Once merged, you can do from mesa_models.sugarscape_cg.model import SugarscapeCg and from mesa_models.sugarscape_cg.agents import SsAgent.

Shall I rewrite the code to inherit from the existing files?

Yes, sounds good to me.

I also wanted to refactor a little bit keeping AgentSets in mind. Is writing examples with experimental features encourages?

I suppose it is fine for new examples. I have only used AgentSet for the experimental examples. What do you think, @projectmesa/maintainers @quaquel ?

rht commented 4 months ago

@apranav22 #108 has been merged.

EwoutH commented 3 months ago

@apranav22 hey! Would you like to finish this PR? Is there anything we can do to help?

apranav22 commented 3 months ago

@apranav22 hey! Would you like to finish this PR? Is there anything we can do to help?

Hi! I've been meaning to get to it but I've been swamped of late. I will work on it right now. Sorry for the slack :(

apranav22 commented 3 months ago

There's a problem. Some of the relative file paths get mangled when I try to inherit from sugarscape_cg. For example, the function that generates the map using the relative file path no longer works.