Open
Conversation
Member
|
Thanks for the PR! @quaquel could your review the use of the discrete grid in this example model? |
Member
|
@Mallory3125 This is pretty good, it seems like all the pieces are there an in current mesa. Could you add the example to the repo Readme which serves as a table of contents for the different examples. |
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.
Summary
This PR adds the Painted Desert Challenge example adapted from NetLogo to mesa-examples. It demonstrates emergent sorting behavior and self-organization using Mesa agents and Solara visualization.
Motive
The Painted Desert Challenge model is a valuable addition to Mesa as it:
OrthogonalMooreGridwith property layers for chip colors, and Solara-based visualization for dynamic spatial modeling.Implementation
The model simulates chip collector agents (representing termites) moving on a grid with colored wood chips, sorting them into distinct piles by color.
Model Structure:
ChipCollectorModel(painted_desert/model.py):pcolorproperty layer for chip colors (0 = empty, 1+ = colored chips).ChipCollectorAgent (painted_desert/agents.py):find_chip: Wander until finding a chip of assigned color, pick it up, and move away.find_new_pile: Locate another chip of the same color to identify a pile.find_empty_spot: Deposit the chip near the pile in an empty adjacent cell.wiggle/get_away: Random movement functions for exploration and relocation.Visualization(
app.py):Usage Examples
To run the example: