Conversation
Updated image references in README with new URLs.
examples/activewalker/model.py
Outdated
| self.G_layer.update() | ||
|
|
||
|
|
||
| class StepDeposit(PropertyLayer): |
There was a problem hiding this comment.
Why are you using a property layer for this? Can't you simplify this to just use a numpy array directly?
There was a problem hiding this comment.
Thanks for the review, @quaquel !
I’ve updated the implementation to use a NumPy array as suggested.
I Initially chose property layers with potential continuous space support in mind, If there’s interest, extending property layers to continuous space could be explored separately in the future.
examples/activewalker/model.py
Outdated
| from agent import StopsAgent, WalkerAgent | ||
| from mesa.agent import AgentSet | ||
| from mesa.experimental.continuous_space import ContinuousSpace | ||
| from mesa.space import PropertyLayer |
There was a problem hiding this comment.
This is being deprecated, so either redesign it to not use it or import property layer from mesa.discrete_space.
Hi @quaquel, just following up on this PR. I've implemented the suggested changes, let me know if there's anything else you need from my end to finalize this! |
Summary
This example implements an Active Walker model that simulates how informal pedestrian trails emerge in grassy open spaces. Agents move between predefined stops while gradually wearing down the grass. Worn areas become easier and more attractive to traverse, reinforcing frequently used routes.
Over time, stable paths form organically without explicit pathfinding. This model utilizes a continuous space and a custom property layer to track wear.
Motive
This example demonstrates agent–environment feedback dynamics in Mesa. It showcases how simple local movement rules combined with environmental modification can produce large-scale pattern formation.
In parks, campuses, and urban green spaces, informal footpaths often appear before any pavement is installed. These “desire paths” emerge because people tend to prefer routes that are already partially worn.
This example models that feedback loop:
Implementation
ActiveModel
WalkerAgent
StepDeposit (PropertyLayer)
Each simulation step:
Usage Examples
print_strength,vision, ortrail_dies_into observe different trail formation dynamics.app.pyto explore different origin–destination layouts.References
-This model is inspired by the Active Walker model described by Helbing et al. (1997): https://arxiv.org/abs/cond-mat/9806097.