Skip to content
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

Update create agents in tutorials #2537

Closed
tpike3 opened this issue Dec 7, 2024 · 10 comments · Fixed by #2541
Closed

Update create agents in tutorials #2537

tpike3 opened this issue Dec 7, 2024 · 10 comments · Fixed by #2541
Assignees
Labels
docs Release notes label good first issue

Comments

@tpike3
Copy link
Member

tpike3 commented Dec 7, 2024

What's the problem this feature will solve?
Make Mesa tutorial consistent with 3.1 release

Describe the solution you'd like
Update create agents

image

to


class MoneyModel(mesa.Model):
    """A model with some number of agents."""

    def __init__(self, n=10, seed=None):
        """Initialize a MoneyModel instance.

        Args:
            N: The number of agents.
            width: width of the grid.
            height: Height of the grid.
        """
        super().__init__(seed=seed)
        self.num_agents = n
        

        # Create agents --- Change this line
        MoneyAgent.create_agents(self,n)

Additional context
Needs to be changed at all agent instantiations such as when space is a added to the model

@tpike3 tpike3 added docs Release notes label good first issue labels Dec 7, 2024
@ashish-nagmoti
Copy link

I would love to do that , would you mind assigning this issue to me

@EwoutH
Copy link
Member

EwoutH commented Dec 7, 2024

Great, go ahead!

@tpike3
Copy link
Member Author

tpike3 commented Dec 8, 2024

Thanks @ashish-nagmoti

@EwoutH
Copy link
Member

EwoutH commented Dec 10, 2024

This can also be updated in the advanced examples, for which see also:

@ashish-nagmoti if you want you can pick that up.

@peach280
Copy link

I am eager to contribute to this...but I had a query, do we just have to replace MoneyAgent with MoneyAgent.create_agents? I have generated a pull request for that but I don't know if its right or not..It would be great if you could guide me. I would love to gain more knowledge about this.

@EwoutH
Copy link
Member

EwoutH commented Dec 10, 2024

@peach280 the function creates an AgentSet of multiple agents. Checkout the PR where it was added:

A bit of familiarity with Mesa itself is also highly recommended. Start here: https://github.com/projectmesa/mesa/blob/main/CONTRIBUTING.md#i-have-no-idea-where-to-start

@peach280
Copy link

Thank you so much I will learn more about it then.

@ashish-nagmoti
Copy link

ashish-nagmoti commented Dec 10, 2024

@EwoutH thanks for heads up, i would love to solve #2530 , see you on comments of #2530 :)

@ashish-nagmoti
Copy link

@EwoutH as we have merged, the pr , why not close this issue

@EwoutH EwoutH linked a pull request Dec 18, 2024 that will close this issue
@EwoutH
Copy link
Member

EwoutH commented Dec 18, 2024

Certainly!

@EwoutH EwoutH closed this as completed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Release notes label good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants