Skip to content

Conversation

EwoutH
Copy link
Member

@EwoutH EwoutH commented Jan 11, 2025

Update version and release notes for the next feature release, Mesa 3.1.3.

Draft release available here.

@projectmesa/maintainers please especially check the release notes for about continuous space, and the feedback topic.

3.1.3 (2025-01-11)

Highlights

Mesa 3.1.3 introduces a major reimplementation of Mesa's continuous space, providing an intuitive agent-centric API and significant performance improvements. The new implementation supports n-dimensional spaces and offers streamlined methods for agent movement and neighbor calculations.

New Continuous Space Features

  • Agent-centric movement API similar to cell spaces
  • Efficient neighbor calculations and position updates
  • Support for n-dimensional spaces
  • Improved memory management with dynamic array resizing

Here's a quick look at the new API:

# Create a 2D continuous space
space = ContinuousSpace(
    dimensions=[[0, 1], [0, 1]],
    torus=True,
    random=model.random
)

# Create and position an agent
agent = ContinuousSpaceAgent(space, model)
agent.position = [0.5, 0.5]

# Move agent using vector arithmetic
agent.position += [0.1, 0.1]

# Get neighbors within radius
neighbors, distances = agent.get_neighbors_in_radius(radius=0.2)

# Find k nearest neighbors
nearest, distances = agent.get_nearest_neighbors(k=5)

The new implementation particularly benefits models requiring frequent position updates and neighbor queries, such as flocking simulations or particle systems. Note that this is an API-breaking change, and existing models using continuous space will need to be updated to use the new agent-centric approach. See #2584 for more details. We would love to get feedback on the new Continuous Space in #2611.

Other improvements in this release include consistent visualization behavior across space types with the reimplementation of draw_voronoi #2608, and a new render interval slider for controlling visualization update frequency in SolaraViz, which helps improve performance when working with complex visualizations #2596.

Update version and release notes for the next feature release, Mesa 3.1.3.
@EwoutH EwoutH added the ignore-for-release PRs that aren't included in the release notes label Jan 11, 2025
@EwoutH EwoutH requested a review from quaquel January 11, 2025 13:31
Copy link
Member

@quaquel quaquel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 minor things but basically looks good to go.

Thanks!

Copy link
Member

@tpike3 tpike3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @EwoutH -- I approved but also figure @quaquel should take along to see if there is anything else to highlight in the example code.

@quaquel
Copy link
Member

quaquel commented Jan 11, 2025

One other thing: there are currently no docs for continuous space. I'll open a pr in a second to add these in.

EwoutH and others added 2 commits January 11, 2025 16:46
@EwoutH
Copy link
Member Author

EwoutH commented Jan 11, 2025

Thanks for the swift feedback, and the updated docs!

Merging and releasing.

@EwoutH EwoutH merged commit cfb1925 into projectmesa:main Jan 11, 2025
11 checks passed
tpike3 pushed a commit to tpike3/mesa that referenced this pull request Mar 25, 2025
Update version and release notes for the next feature release, Mesa 3.1.3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release PRs that aren't included in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants