Add step-based Minesweeper example with data collection #305
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.
Description
I added a step-based Minesweeper model as a new example in
mesa-examples. This model reframes Minesweeper as an autonomous spatial diffusion process rather than an interactive game, making it suitable as an educational and analytical Mesa example.The model demonstrates how local neighborhood rules and a frontier-based propagation mechanism can produce emergent spatial patterns on a discrete grid.
Motive
Demonstrate frontier-based spatial propagation
The model uses an explicit frontier to control which cells are processed at each step, illustrating wave-like expansion and natural termination.
Show neighborhood-driven dynamics
Cell behavior depends entirely on local neighborhood state (number of adjacent mines), highlighting classic cellular automaton principles.
Combine spatial and temporal analysis
In addition to grid visualization, the example includes a
DataCollectorto track and plot how the system evolves over time.Provide a clear, non-interactive reference model
The example avoids user interaction and instead focuses on step-wise dynamics, aligning with current
SolaraVizcapabilities.Implementation
The model is split across three files:
model.py
PropertyLayerDataCollectortracking:agents.py
MineCellagent storing:app.py
Notes
Running the example