Skip to main content

No project description provided

Project description

AquaCrop-ABSESpy

Python Version License

基于 AquaCropABSESpy 的农业灌溉和作物生长多主体模拟系统。

简介

AquaCrop-ABSESpy 是一个集成了联合国粮农组织(FAO)AquaCrop 模型和 ABSESpy 多主体建模框架的系统,用于模拟农业灌溉决策和作物生长过程。本系统支持:

  • 🌾 17种作物模拟:涵盖粮食、经济、蔬菜和糖料作物
  • 💧 多种灌溉策略:从无灌溉到优化灌溉的6种方法
  • 🗺️ 空间异质性:支持栅格数据和空间分布建模
  • 👨‍🌾 主体决策:模拟农民的灌溉决策行为
  • 📊 气候响应:整合气象数据评估作物-水分关系

支持的作物

系统现支持 17种作物,完整配置了生长周期、Kc系数和物候期参数:

粮食作物 (10种)

  • 水稻 (Rice) - 150天生长期
  • 冬小麦 (Winter_Wheat) - 255天生长期
  • 春小麦 (Spring_Wheat) - 130天生长期
  • 春玉米 (Spring_Maize) - 145天生长期
  • 夏玉米 (Summer_Maize) - 100天生长期
  • 春大麦 (Spring_Barley) - 120天生长期
  • 冬大麦 (Winter_Barley) - 210天生长期
  • 小米 (Millet) - 140天生长期

经济作物 (5种)

  • 大豆 (Soybean) - 140天生长期
  • 棉花 (Cotton) - 180天生长期
  • 油菜籽 (Rapeseed) - 110天生长期
  • 花生 (Groundnut) - 130天生长期
  • 向日葵 (Sunflower) - 130天生长期

蔬菜和块茎作物 (2种)

  • 马铃薯 (Potato) - 145天生长期
  • 西红柿 (Tomato) - 135天生长期

糖料作物 (2种)

  • 甘蔗 (Sugarcane) - 105天生长期
  • 甜菜 (Sugarbeet) - 160天生长期

注意: 系统保留 WheatMaize 作为 Spring_WheatSpring_Maize 的别名,确保向后兼容。

快速开始

安装

pip install aquacrop-abses

或从源码安装:

git clone https://github.com/SongshGeo/aquacrop_abses.git
cd aquacrop_abses
poetry install

基本使用

from abses import MainModel
from aquacrop_abses import CropLand, CropCell, Farmer
from aquacrop_abses.load_datasets import crop_name_to_crop

# 创建模型和农田模块
model = MainModel()
cropland = model.nature.create_module(
    name="cropland",
    module_cls=CropLand,
    shape=(3, 4),  # 创建 3x4 的网格
    cell_cls=CropCell,
)

# 获取一个单元格
cell = cropland.random.choice()

# 添加作物
cell.add_crop("Rice")
cell.soil = 1  # 设置土壤类型

# 创建作物对象并查看信息
rice = crop_name_to_crop("Rice")
print(f"水稻种植日期: {rice.planting_date}")  # 05/15
print(f"水稻收获日期: {rice.harvest_date}")    # 10/12

多作物轮作示例

from abses import MainModel
from aquacrop_abses import CropLand, CropCell

# 创建模型和农田模块
model = MainModel()
cropland = model.nature.create_module(
    name="cropland",
    module_cls=CropLand,
    shape=(3, 4),
    cell_cls=CropCell,
)

# 获取单元格并添加冬小麦和夏玉米(轮作)
cell = cropland.random.choice()
cell.add_crop("Winter_Wheat")  # 10/01-06/13
cell.add_crop("Summer_Maize")   # 06/15-09/23 (无重叠)

# 查看种植的作物
print(f"种植了 {cell.has_crops} 种作物")
for name, crop in cell.crops.items():
    print(f"  - {name}: {crop.planting_date}{crop.harvest_date}")

灌溉策略

系统支持6种灌溉方法(irr_method 0-5):

  • 0: 无灌溉(雨养农业)
  • 1-3: 基于土壤水分阈值的灌溉(保守、中等、激进)
  • 4: 净灌溉(精确补水)
  • 5: 优化灌溉(最大产量)
from aquacrop_abses import Farmer

# 创建使用净灌溉策略的农民
farmer = Farmer(irr_method=4)

主要功能

作物生长模拟

  • 完整的作物物候期建模(初始、发育、中期、成熟)
  • 基于Kc系数的蒸腾蒸发计算
  • 水分胁迫对产量的影响

空间建模

  • 栅格化农田空间表示
  • 空间异质的土壤和气象条件
  • 作物空间分布配置

主体决策

  • 农民灌溉决策模拟
  • 不同灌溉策略的优化
  • 资源约束下的行为

数据集成

  • 气象数据(温度、降水、蒸发)
  • 土壤数据(质地、水分特性)
  • 作物参数(生长周期、系数)

文档

完整文档请访问: Documentation

测试

# 运行所有测试
poetry run pytest tests/ -v

# 运行特定测试
poetry run pytest tests/test_datasets.py -v

引用

如果您在研究中使用了本系统,请引用:

@software{aquacrop_abses,
  author = {Song, Shuang},
  title = {AquaCrop-ABSESpy: Agent-Based Modeling for Agricultural Irrigation},
  year = {2024},
  url = {https://github.com/SongshGeo/aquacrop_abses}
}

贡献

欢迎贡献!请查看 贡献指南 了解详情。

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件。

致谢

  • AquaCrop - FAO作物-水分生产力模型
  • ABSESpy - 多主体建模框架
  • aquacrop - Python实现的AquaCrop模型

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aquacrop_abses-0.5.0.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aquacrop_abses-0.5.0-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file aquacrop_abses-0.5.0.tar.gz.

File metadata

  • Download URL: aquacrop_abses-0.5.0.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for aquacrop_abses-0.5.0.tar.gz
Algorithm Hash digest
SHA256 6337f0e9f4cb27450d5dd6cab3988b959edda41f34ed86d55beb829bc5062631
MD5 b7b24afd5ad3587b9f56bd36d19f3eed
BLAKE2b-256 e443bf10b09f6775831ef1b8703b5891ed95cec39829e22d075598c77e7d1751

See more details on using hashes here.

File details

Details for the file aquacrop_abses-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: aquacrop_abses-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for aquacrop_abses-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc591f2a2c48e7beead1b53946c7b7d3a524ea8710f429b31f8aa8b0aad4d283
MD5 fe709adbfb9dae92cd17e83022297ee4
BLAKE2b-256 796a2faf4f8a42cc650ac1415f5f56c0fda155032462f3e81f879a1505332647

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page