Refactoring mesa.space

未关闭
#6 13 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@adamamer20 已经在做这个了。

开始于 2024年1月10日。

  • #28 来自 @adamamer20 —— 已关闭,未合并
  • #29 来自 @adamamer20 —— 已合并
  • #30 来自 @adamamer20 —— 已合并
  • #32 来自 @adamamer20 —— 已合并
  • #44 来自 @adamamer20 —— 已合并

评估

这个 Issue 还没有评估数据。

描述

enhancement

Roadmap

  • #39
  • #40
  • #41
  • #34
  • #35
  • #36
  • #37
  • #38
  • #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.
主要语言
Python
星标
44
派生
20
平均合并
1 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mesa/mesa-frames 的其他 Issue

查看 mesa/mesa-frames 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。