Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract DiscreteSpaceDF #40

Closed
Tracked by #6
adamamer20 opened this issue Jul 24, 2024 · 0 comments · Fixed by #30
Closed
Tracked by #6

Abstract DiscreteSpaceDF #40

adamamer20 opened this issue Jul 24, 2024 · 0 comments · Fixed by #30
Assignees
Labels
enhancement Improvements to existing features or performance.

Comments

@adamamer20
Copy link
Collaborator

adamamer20 commented Jul 24, 2024

The DiscreteSpaceDF class has been implemented as an abstract base class that extends SpaceDF, specifically designed for discrete space representations such as grids and networks in mesa_frames. Key features and methods include:

  1. Initialization with a model object and optional capacity parameter
  2. Cell management methods:
    • is_available: Check if positions have available capacity
    • is_empty: Check if positions are completely empty
    • is_full: Check if positions are at full capacity
    • move_to_empty: Move agents to completely empty cells
    • move_to_available: Move agents to cells with available capacity
    • sample_cells: Sample cells based on specified criteria (any, empty, available, full)
  3. Enhanced spatial operations:
    • get_neighborhood: Get neighborhood cells for given positions or agents
    • get_cells: Retrieve cell properties and agents for specified cells
    • set_cells: Set properties for specified cells
  4. Property access:
    • cells: Get/set all cell properties
    • empty_cells: Get all empty cells
    • available_cells: Get all cells with available capacity
    • full_cells: Get all cells at full capacity

The class introduces the concept of cell capacity, allowing for multiple agents per cell/position. It also provides methods for checking cell states (empty, available, full) and moving agents based on these states.

This implementation offers a more specialized framework for discrete spatial environments, building upon the general SpaceDF class. It provides additional functionality for managing cell occupancy and capacity, which is particularly useful for grid-based and network-based simulations in agent-based models.

The DiscreteSpaceDF class serves as a bridge between the general SpaceDF and more specific implementations like GridDF, providing a common interface for discrete spatial representations in the mesa_frames library.

@adamamer20 adamamer20 mentioned this issue Jul 24, 2024
9 tasks
@adamamer20 adamamer20 self-assigned this Jul 24, 2024
@adamamer20 adamamer20 added the enhancement Improvements to existing features or performance. label Jul 24, 2024
@adamamer20 adamamer20 moved this to Ready in mesa-frames Jul 24, 2024
@adamamer20 adamamer20 added this to the 1.0.0 Alpha Release milestone Jul 24, 2024
@adamamer20 adamamer20 linked a pull request Jul 24, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from Ready to Done in mesa-frames Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features or performance.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant