Skip to main content

Crop-Water Quota Irrigation Model - ABM for Yellow River water allocation

Project description

CWatQIM: Crop-Water Quota Irrigation Model

Release DOI License: MIT CoMSES Python 3.11

An agent-based model (ABM) for simulating water quota allocation and irrigation decisions in China's Yellow River Basin.

Overview

CWatQIM (Crop-Water Quota Irrigation Model) is a agent-based model that simulates the coupled human-water system in the Yellow River Basin. The model investigates how water quota institutions shape irrigation water withdrawal decisions and their system-wide consequences, focusing on the mechanisms through which administrative water quotas influence water source composition (surface water versus groundwater), irrigation efficiency, and crop productivity.

Key Features

  • Multi-scale agents: Province-level and prefecture-level (city) agents representing water management agencies
  • Crop modeling integration: Built-in integration with AquaCrop for crop yield simulation
  • Social learning mechanisms: Implements Standing strategy (evolutionary game theory) for behavioral adaptation
  • Policy analysis: Enables counterfactual analysis to assess policy effects under different enforcement regimes

Installation

From GitHub (Recommended)

Clone the repository to get the full model with configurations:

git clone https://github.com/SongshGeoLab/CWatQIM.git
cd CWatQIM
pip install -e .

From PyPI

pip install cwatqim

Publication

This model is published on:

For citation and archival purposes, please use the Zenodo DOI.

Quick Start

After cloning the repository, run the model from the cwatqim directory (the package root):

cd cwatqim

# Run with demo configuration (uses sample data in data/sample/)
python -m cwatqim config_name=demo

# Override configuration parameters
python -m cwatqim config_name=demo exp.repeats=5 exp.num_process=4

# Override time range
python -m cwatqim config_name=demo time.start=1985 time.end=1990

Using Python API

from cwatqim import CWatQIModel
from hydra import compose, initialize

# Initialize configuration (from config/ directory in cwatqim package)
with initialize(config_path="config", version_base=None):
    cfg = compose(config_name="demo")  # Use demo configuration

    # Create and run model
    model = CWatQIModel(parameters=cfg)
    model.setup()

    # Run simulation
    for _ in range(10):
        model.step()

    model.end()

Configuration

The package includes a demo configuration file for quick start:

  • config/demo.yaml: Complete demo configuration with sample data paths

The demo configuration uses sample data located in data/sample/ directory, which includes:

  • City climate data (city_climate/ directory)
  • City boundaries shapefile (YR_cities_sample.*)
  • City code mapping (city_codes.xlsx)
  • Water quotas (quotas.csv)
  • Irrigation data (irr_intensity.csv, irr_area_ha.csv)
  • Crop prices (prices.csv)

All paths in demo.yaml are relative to the cwatqim package root directory. You can override any configuration parameter via command line arguments or create your own configuration files.

For example, to change the simulation time range:

python -m cwatqim config_name=demo time.start=1985 time.end=1990

Model Components

Agents

  • Province: Province-level agents managing water quota allocation
  • City: Prefecture-level agents making irrigation water withdrawal decisions
  • Farmer: Individual farmer agents (optional, for future extensions)

Core Modules

  • CWatQIModel: Main model class orchestrating the simulation
  • Algorithms: Optimization algorithms for water source portfolio decisions
  • Data Loaders: Utilities for loading climate, quota, and agricultural data
  • Payoff: Economic and social payoff calculations

Documentation

Requirements

Citation

If you use this model in your research, please cite:

@software{cwatqim2026,
  title = {CWatQIM: Crop-Water Quota Irrigation Model},
  author = {Song, Shuang},
  year = {2026},
  url = {https://github.com/SongshGeoLab/CWatQIM},
  doi = {10.5281/zenodo.4305038}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Supported by National Natural Science Foundation of China (No. 42041007, No. U2243601)
  • Built on the ABSESpy framework
  • Integrates with AquaCrop for crop modeling

Contact

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

cwatqim-0.1.6.tar.gz (11.4 MB view details)

Uploaded Source

Built Distribution

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

cwatqim-0.1.6-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file cwatqim-0.1.6.tar.gz.

File metadata

  • Download URL: cwatqim-0.1.6.tar.gz
  • Upload date:
  • Size: 11.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for cwatqim-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f29c5e756be6e2214b2b1c95b3af80b2b085cb2b6988d187e162fced2fee5209
MD5 b808d3d7c04c6eac5b1950e9ae2275f2
BLAKE2b-256 bdf573563d470e41dee3f18f97825742a460246898be73ce91d1ab95e9045632

See more details on using hashes here.

File details

Details for the file cwatqim-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: cwatqim-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 53.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for cwatqim-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3e5e21674a6fadd3cfa2858747f383b5346b45f15cc2ea181b68ff92bcc7a8ca
MD5 d9984dbd954d54ab25d9c6719d926f70
BLAKE2b-256 c5e547568226cacc2ac08a458f7749888969cb3e62398ab5c026c3c6e2c8fbf8

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