|
1 | 1 | ---
|
2 | 2 | title: Release History
|
3 | 3 | ---
|
| 4 | +# 3.0.0a4 (2024-09-09) |
| 5 | +## Highlights |
| 6 | +Mesa 3.0.0a4 contains two major breaking changes: |
| 7 | +1. The Agent's `unique_id` is now automatically assigned, so doesn't need to be passed to the Agent class anymore. In a subclassed custom Agent, like normally used, this now looks like this: |
| 8 | + ```diff |
| 9 | + class Wolf(Agent): |
| 10 | + - def __init__(self, unique_id, model, energy=None): |
| 11 | + + def __init__(self, model, energy=None): |
| 12 | + # When initializing the super class (Agent), passing unique_id isn't needed anymore |
| 13 | + - super().__init__(unique_id, model) |
| 14 | + + super().__init__(model) |
| 15 | + |
| 16 | + - wolf = Wolf(unique_id, model) |
| 17 | + + wolf = Wolf(model) |
| 18 | + ``` |
| 19 | + Example models were updated in [mesa-examples#194](https://github.com/projectmesa/mesa-examples/pull/194), which shows more examples on how to update existing models. |
| 20 | + |
| 21 | +2. Our visualisation API is being overhauled, to be more flexible and powerful. For more details, see [#2278](https://github.com/projectmesa/mesa/pull/2278). |
| 22 | + - An initial update to the tutorial was made in [#2289](https://github.com/projectmesa/mesa/pull/2289) and is [available here](https://mesa.readthedocs.io/en/latest/tutorials/visualization_tutorial.html). |
| 23 | + - An initial example model was updated in [mesa-examples#195](https://github.com/projectmesa/mesa-examples/pull/195), and more examples will be updated in [mesa-examples#195](https://github.com/projectmesa/mesa-examples/pull/193). |
| 24 | + - The old SolaraViz API is still available at `mesa.experimental`, but might be removed in future releases. |
| 25 | + |
| 26 | +Furthermore, the AgentSet has a new `agg` method to quickly get an aggerate value (for example `min_energy = model.agents.agg("energy", min)`) ([#2266](https://github.com/projectmesa/mesa/pull/2266)), The Model `get_agents_of_type` function is replaced by directly exposing the `agents_by_type` property (which can be accessed as a dict) ([#2267](https://github.com/projectmesa/mesa/pull/2267), [mesa-examples#190](https://github.com/projectmesa/mesa-examples/pull/190)) and the AgentSet get() methods can now handle missing values by replacing it with a default value ([#2279](https://github.com/projectmesa/mesa/pull/2279)). |
| 27 | + |
| 28 | +Finally, it fixes a bug in which the Grid's `move_agent_to_one_of` method with `selection="closest"` selected a location deterministically, instead of randomly ([#2118](https://github.com/projectmesa/mesa/pull/2118)). |
| 29 | + |
| 30 | +## What's Changed |
| 31 | +### ⚠️ Breaking changes |
| 32 | +* move solara_viz back to experimental by @Corvince in https://github.com/projectmesa/mesa/pull/2278 |
| 33 | +* track unique_id automatically by @quaquel in https://github.com/projectmesa/mesa/pull/2260 |
| 34 | +### 🎉 New features added |
| 35 | +* AgentSet: Add `agg` method by @EwoutH in https://github.com/projectmesa/mesa/pull/2266 |
| 36 | +* Implement new SolaraViz API by @Corvince in https://github.com/projectmesa/mesa/pull/2263 |
| 37 | +### 🛠 Enhancements made |
| 38 | +* Model: Replace `get_agents_of_type` method with `agents_by_type` property by @EwoutH in https://github.com/projectmesa/mesa/pull/2267 |
| 39 | +* add default SolaraViz by @Corvince in https://github.com/projectmesa/mesa/pull/2280 |
| 40 | +* Simplify ModelController by @Corvince in https://github.com/projectmesa/mesa/pull/2282 |
| 41 | +* Add default values and missing value handling to `agentset.get` by @quaquel in https://github.com/projectmesa/mesa/pull/2279 |
| 42 | +### 🐛 Bugs fixed |
| 43 | +* Fix deterministic behavior in `move_agent_to_one_of` with `selection="closest"` by @OrenBochman in https://github.com/projectmesa/mesa/pull/2118 |
| 44 | +### 📜 Documentation improvements |
| 45 | +* docs: Fix Visualization Tutorial (main branch) by @EwoutH in https://github.com/projectmesa/mesa/pull/2271 |
| 46 | +* Docs: Fix broken relative links by removing `.html` suffix by @EwoutH in https://github.com/projectmesa/mesa/pull/2274 |
| 47 | +* Readthedocs: Don't let notebook failures pass silently by @EwoutH in https://github.com/projectmesa/mesa/pull/2276 |
| 48 | +* Update viz tutorial to the new API by @Corvince in https://github.com/projectmesa/mesa/pull/2289 |
| 49 | +### 🔧 Maintenance |
| 50 | +* Resolve multiprocessing warning, state Python 3.13 support by @rht in https://github.com/projectmesa/mesa/pull/2246 |
| 51 | + |
| 52 | +## New Contributors |
| 53 | +* @OrenBochman made their first contribution in https://github.com/projectmesa/mesa/pull/2118 |
| 54 | + |
| 55 | +**Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.0.0a3...v3.0.0a4 |
| 56 | + |
4 | 57 | # 3.0.0a3 (2024-08-30)
|
5 | 58 | ## Highlights
|
6 | 59 | Developments toward Mesa 3.0 are steaming ahead, and our fourth alpha release is packed with features and updates - only 8 days after our third.
|
|
0 commit comments