-
Notifications
You must be signed in to change notification settings - Fork 6
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
Changes to AgentSetDF and AgentsDF before time.py -> CopyMixin #16
Conversation
adamamer20
commented
Jul 1, 2024
•
edited
Loading
edited
- Created a CopyMixin for copy and deepcopy methods to let both AgentSet and Scheduler inherit fast copy.
- Added possibility of using 'do' method with a mask in AgentSetDF, such that the Scheduler can use it to run the method only on a subset of agents (active agents in the scheduler).
- Added tests for AgentsDF
- Other minor bug fixes, including type hints and docstrings.
mesa_frames/time.py. Created a CopyMixin for copy and deepcopy methods to let both AgentSet and Scheduler inherit. Added possibility of using 'do' method with a mask in AgentSetDF, such that the Scheduler can use it to run the method only on a subset of agents. Minor fixes to type hints and docstrings.
… masked_do_agentset
It looks like pre-commit.ci hasn't been enabled: https://pre-commit.ci/. |
You're right, now it should be enabled. |
For now, yes, manually. Because it will only trigger starting in the next PR. You could also add a local Git commit hook so that it is automatic. |
… masked_do_agentset
for more information, see https://pre-commit.ci
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
I tried adding Adding typing-extensions sounds good to me. Seems like a lightweight module. |
for more information, see https://pre-commit.ci
…sa-frames into masked_do_agentset
…in the future for mesa-frames.geo)
@rht ready to merge |
Sorry for the late comment on this, but the scheduler (random activation, staged activation, etc, except for the discrete event scheduler) will be rendered obsolete, replaced with AgentSet's select-then-do. But given that this PR has lots of other improvements, e.g. fixing the CI, I'm going to merge it, so that we can move faster. I need a working tests/CI in order to benchmark the runtime type checking libraries. |
Ah, no problem! I thought that the scheduler would be kept and the AgentSet's select-then-do was only incentivized. Anyway, all the changes in the PR are still useful because masked do is something that is needed anyway. I have implemented the interface for schedulers (apart from the discrete event scheduler, which I was leaving to its own PR) in the |
I think I'm more looking forward to the |