Repository navigation
Refactor _add_agent in ContinuousSpace - #3556
Merged
Merged
Conversation
quaquel
approved these changes
Mar 16, 2026
|
Performance benchmarks:
|
PietroMondini
pushed a commit
to PietroMondini/mesa
that referenced
this pull request
Mar 19, 2026
codebreaker32
added a commit
to codebreaker32/mesa
that referenced
this pull request
Apr 1, 2026
EwoutH
pushed a commit
that referenced
this pull request
Oct 28, 2026
(cherry picked from commit 1dbdb37)
53 of 65 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
For enhancements and new features, include the issue/discussion where a maintainer approved this work before opening a PR. Unapproved feature/enhancement PRs may be closed.
Pre-PR Checklist
Approval Link
#3548
Summary
This PR optimizes the memory reallocation strategy inside
ContinuousSpace._add_agentby replacing the existingnp.vstackcall with a faster array pre-allocation and slice assignment approach.Motive
See #3548
Implementation
Replaced
np.vstackwith a pre-allocation strategy and slice assignmentUsage Examples
It remains same as this is an internal refactor
Additional Notes
Closes #3548
GSoC contributor checklist
Context & motivation
This is my prerequisite effort to make continuous space and continuous space agent faster or optimise wherever there is scope before we start working on stacked spaces.
What I learned
See #2585 and #3458 for background
Learning repo
🔗 My learning repo: https://github.com/codebreaker32/GSoC-learning-space
🔗 Relevant model(s): NA
Readiness checks
pytest --cov=mesa tests/)ruff check . --fix)