Open
Description
Roadmap
- Abstract SpaceDF #39
- Abstract DiscreteSpaceDF #40
- Abstract GridDF #41
- Concrete GridPandas #34
- Concrete GridPolars #35
- Concrete ContinousSpaceDF #36
- Concrete MultiSpaceDF #37
- Concrete GeoGridDF #38
- feat: Adding Concrete NetworkDF #47
Class Structure and Design
SpaceDF
- Base class for all spaces
- Defines a common interface for all spaces
- Stores agent positions in the
_agents
attribute in a DataFrame/GeoDataFrame. This approach avoids many missing values in the AgentSetDF and reduces confusion when multiple spaces of the same type are present (e.g., an agent in both a grid and in a social network) - TODO: Implement a
pos
property for AgentContainer that performs an instant join with the space_agents
DataFrame
MultiSpaceDF
- Stores the collection of spaces in a model, similar to AgentsDF
DiscreteSpaceDF
- Defines an interface for GridDF and NetworkDF
- Supports setting cell properties at both class level (setting an attribute of the class) and cell level (using the
set_cells
method) - In addition to
_agents
stores cell properties in the_cells
attribute in a DataFrame. The_cells
DataFrame explicitly stores only cells that have agents or have specific properties different from the class level
ContinousSpaceDF
- Stores agents in a GeoDataFrame (only geopandas in the future)
- Bridges mesa and mesa-geo
- All agents are geoagents and shapely objects
- Can be used as a continuous space in mesa without setting CRS, or as a geospace in mesa-geo by setting CRS
GridDF
- Implemented in both GridPolars and GridPandas versions
- Supports multiple dimensions
- The '_empty_grid' attribute stores the remaining capacity of the grid.
GeoGridDF
- Position in the class hierarchy still to be determined
- Is it possible to create a unique class or attempt to merge with GridDF? Probably not possible to merge as GridDF supports multiple dimensions, while shapely objects are limited to 2 dimensions.