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 SpaceDF #39

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

Abstract SpaceDF #39

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

Comments

@adamamer20
Copy link
Collaborator

adamamer20 commented Jul 24, 2024

The SpaceDF class has been implemented as an abstract base class that defines the interface for all space classes in mesa_frames. This class provides a foundation for representing spatial environments in agent-based models. Key features and methods include:

  1. Initialization with a model object
  2. Methods for agent management:
    • random_agents: Sample random agents from the space
    • move_agents: Place agents at specific positions
    • move_to_empty: Move agents to empty positions
    • remove_agents: Remove agents from the space
    • swap_agents: Swap positions of agents
  3. Spatial operations:
    • get_directions: Calculate directions between positions or agents
    • get_distances: Calculate distances between positions or agents
    • get_neighbors: Find neighboring agents within a given radius
  4. Position sampling:
    • random_pos: Generate random positions in the space

The class also includes abstract methods that need to be implemented by subclasses, such as specific grid or network spaces. These methods include get_directions, get_distances, get_neighbors, move_agents, move_to_empty, random_pos, and remove_agents.

This implementation provides a flexible and extensible framework for handling various types of spatial environments in agent-based models, allowing for easy integration with other components of 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 added this to the 1.0.0 Alpha Release milestone Jul 24, 2024
@adamamer20 adamamer20 moved this to Ready in mesa-frames 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