There is a newer version of the record available.

Published September 9, 2024 | Version v3.0.0a4

projectmesa/mesa: v3.0.0a4

  • 1. Unity Technologies
  • 2. Delft University of Technology
  • 3. Google (all opinions are my own)
  • 4. Open Systems Technologies Corporation
  • 5. @populus-ai
  • 6. @Princeton-CDH
  • 7. University at Buffalo
  • 8. @rstudio @UBC-DSCI @UBC-MDS
  • 9. CARIAD

Description

Highlights

Mesa 3.0.0a4 contains two major breaking changes:

  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:

    class Wolf(Agent):
    -    def __init__(self, unique_id, model, energy=None):
    +    def __init__(self, model, energy=None):
            # When initializing the super class (Agent), passing unique_id isn't needed anymore
    -        super().__init__(unique_id, model)
    +        super().__init__(model)
    
    - wolf = Wolf(unique_id, model)
    + wolf = Wolf(model)
    

    Example models were updated in mesa-examples#194, which shows more examples on how to update existing models.

  2. Our visualisation API is being overhauled, to be more flexible and powerful. For more details, see #2278.

    • An initial update to the tutorial was made in #2289 and is available here.
    • An initial example model was updated in mesa-examples#195, and more examples will be updated in mesa-examples#195.
    • The old SolaraViz API is still available at mesa.experimental, but might be removed in future releases.

Furthermore, the AgentSet has a new agg method to quickly get an aggerate value (for example min_energy = model.agents.agg("energy", min)) (#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, mesa-examples#190) and the AgentSet get() methods can now handle missing values by replacing it with a default value (#2279).

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).

What's Changed

⚠️ Breaking changes

  • move solara_viz back to experimental by @Corvince in https://github.com/projectmesa/mesa/pull/2278
  • track unique_id automatically by @quaquel in https://github.com/projectmesa/mesa/pull/2260

🎉 New features added

  • AgentSet: Add agg method by @EwoutH in https://github.com/projectmesa/mesa/pull/2266
  • Implement new SolaraViz API by @Corvince in https://github.com/projectmesa/mesa/pull/2263

🛠 Enhancements made

  • Model: Replace get_agents_of_type method with agents_by_type property by @EwoutH in https://github.com/projectmesa/mesa/pull/2267
  • add default SolaraViz by @Corvince in https://github.com/projectmesa/mesa/pull/2280
  • Simplify ModelController by @Corvince in https://github.com/projectmesa/mesa/pull/2282
  • Add default values and missing value handling to agentset.get by @quaquel in https://github.com/projectmesa/mesa/pull/2279

🐛 Bugs fixed

  • Fix deterministic behavior in move_agent_to_one_of with selection="closest" by @OrenBochman in https://github.com/projectmesa/mesa/pull/2118

📜 Documentation improvements

  • docs: Fix Visualization Tutorial (main branch) by @EwoutH in https://github.com/projectmesa/mesa/pull/2271
  • Docs: Fix broken relative links by removing .html suffix by @EwoutH in https://github.com/projectmesa/mesa/pull/2274
  • Readthedocs: Don't let notebook failures pass silently by @EwoutH in https://github.com/projectmesa/mesa/pull/2276
  • Update viz tutorial to the new API by @Corvince in https://github.com/projectmesa/mesa/pull/2289

🔧 Maintenance

  • Resolve multiprocessing warning, state Python 3.13 support by @rht in https://github.com/projectmesa/mesa/pull/2246

New Contributors

  • @OrenBochman made their first contribution in https://github.com/projectmesa/mesa/pull/2118

Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a3...v3.0.0a4

Files

projectmesa/mesa-v3.0.0a4.zip

Files (1.9 MB)

Name Size Download all
md5:80a5c326f17e6f2b93614c63aac18896
1.9 MB Preview Download

Additional details

Related works