-
Notifications
You must be signed in to change notification settings - Fork 944
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
warn if placing already placed agent #2083
Conversation
Performance benchmarks:
|
Hi all, here goes my first PR to Mesa :) Few comments on the code on which I'd appreciate your feedback:
Thanks! |
Performance benchmarks:
|
There currently is no logging configuration. It is very much another item on the todo list. |
I tested and it works:
Though the warning message should have been made clearer to say that it is from a |
Thanks for this PR, it would be a nice feature to have. For everyone, one thing I'm not sure about if we should make this warning optional or not. |
Maybe it is preferable if I stick with
I see the point. How far should I go: Only adapt the warning message that the root cause is a |
Yes, I think that would be fine and simplify this PR.
I think this is good enough. |
While it might be desired in a specific model to have the same agent be placed in multiple spots simultaneously, the typical use case is that one agent has one position at every given moment. This commit decorates the place_agent() method in a way that it emits a warning when called with an agent which already has a location. Fixes: #1522
So,
Hope that's ok with you. |
Yes, that's sufficiently informative. Meta: I support your GitHub protest. It's just that there is no bridge to other ethical FOSS tools yet to ensure public record of discussions and to remain inclusive to people who still use GitHub to contribute to Mesa. Maybe there will be such bridge (along the line of the Matrix bridges that have been built with Slack, Discord, etc). |
Despite being off-topic:
Thanks for the support. Much appreciated. Cause sometimes it feels like I'm fighting windmills.
The folks over at Forgejo are trying to build federation for git forges based on the ActivityPub protocol. I doubt GitHub will ever federate though :/ And Drew DeVault's reservations on the ActivityPub integration for git still hold. |
Hmmm we took quite a big hit on initialization time here. Maybe we should reconsider this approach. |
Since there are no expensive operations in the decorator, except for writing warnings to stdout, I think this hints at a "problem" in the benchmark file: boid = Boid(
unique_id=i,
model=self,
pos=pos,
speed=self.speed,
direction=direction,
vision=self.vision,
separation=self.separation,
**self.factors,
)
self.space.place_agent(boid, pos) This looks exactly like the pattern the warning wants to hint at: An agent having a position and being assigned another one before getting that attribute cleared. Not sure whether this is intended in this case. |
I fixed the benchmarks performance problem: #2086 (comment) |
While it might be desired in a specific model to have the same agent be placed in multiple spots simultaneously, the typical use case is that one agent has one position at every given moment. This commit adapts the place_agent() method in a way that it emits a warning when called with an agent which already has a location.
Fixes: #1522