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. See [2584](https://github.com/projectmesa/mesa/pull/2584) for more details. We would love to get feedback on the new Continuous Space in [#2611](https://github.com/projectmesa/mesa/discussions/2611).
Other improvements in this release include consistent visualization behavior across space types with the reimplementation of `draw_voronoi` [2608](https://github.com/projectmesa/mesa/pull/2608), and a new render interval slider for controlling visualization update frequency in SolaraViz, which helps improve performance when working with complex visualizations [#2596](https://github.com/projectmesa/mesa/pull/2596). We've also fixed a bug affecting random number generation determinism when using `Model(seed=something)`, ensuring both `model.random` and `model.rng` now behave consistently when seeded with the same initial value [#2598](https://github.com/projectmesa/mesa/pull/2598).
What's Changed
๐งช Experimental features
* Reimplementation of Continuous Space by quaquel in https://github.com/projectmesa/mesa/pull/2584
๐ Enhancements made
* reimplementation of draw_voroinoi by quaquel in https://github.com/projectmesa/mesa/pull/2608
* Add render interval slider to control visualization update frequency by HMNS19 in https://github.com/projectmesa/mesa/pull/2596
๐ Bugs fixed
* Bugfix for non deterministic rng behavior by quaquel in https://github.com/projectmesa/mesa/pull/2598
๐ Examples updated
* Clarify ContinuousSpace.get_neighbors behavior with multiple agents at same position by quaquel in https://github.com/projectmesa/mesa/pull/2599
New Contributors
* HMNS19 made their first contribution in https://github.com/projectmesa/mesa/pull/2596
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.1.2...v3.1.3