Skip to content

Official Examples

Official Examples

Built-in examples showcasing ABSESpy features for agent-based modeling.

About These Examples

These examples demonstrate core ABSESpy features through classic ABM models. Each includes complete source code, documentation, and tests.

Available Examples

  • 馃敟 Fire Spread


    Demonstrates spatial modeling, raster attributes, and visualization.

    Features: @raster_attribute, dynamic plotting, enum-based states, indexed grid access

    Quick Start Full Tutorial Source

  • 馃惡 Wolf-Sheep Predation


    Agent lifecycle, movement, and ecological interactions.

    Features: move.random(), at.agents, die(), reproduction

    Tutorial Source

  • 馃彊 Schelling Segregation


    Mesa framework integration and social dynamics modeling.

    Features: shuffle_do(), self.p, Mesa compatibility

    Source README

  • 馃搱 Hotelling's Law


    Decision-making framework and spatial competition.

    Features: Links between Actors and PatchCells

    Tutorial Source

Framework Advantages

These examples highlight how ABSESpy reduces development effort:

  • Spatial modeling made easy: Built-in grid, raster attributes, neighbor queries
  • Agent lifecycle management: Automatic handling of birth/death, movement
  • Mesa compatibility: Use existing Mesa models with minimal changes
  • Type safety: Full type hints for better IDE support
  • Testing support: Comprehensive test utilities