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 repository root:

# Run with default configuration
python -m cwatqim

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

# Use a different dataset configuration
python -m cwatqim ds=mac

Using Python API

from cwatqim import CWatQIModel
from hydra import compose, initialize

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

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

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

    model.end()

Configuration

The repository includes Hydra configurations in the config/ directory:

  • config/config.yaml: Main configuration with model parameters
  • config/ds/default.yaml: Default dataset paths (uses relative paths)
  • config/ds/mac.yaml: macOS-specific paths (for local development)
  • config/exp/test.yaml: Test experiment configuration
  • config/exp/exp.yaml: Full experiment configuration

You can override any configuration parameter via command line arguments or create your own configuration files.

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.5.tar.gz (50.3 kB 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.5-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cwatqim-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d5177738f09fa47ffca3f2684759eb7cfe3c0712d7724a62451e840e94d68c9e
MD5 c8c647759eebc30c8a2b6c8508a91ad7
BLAKE2b-256 c2442a09fe4053583ddbfa88ee50102a5525ab2489b97f802c837a1dbde90b4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cwatqim-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 53.6 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 276c36a23b31b52c6b9b183761c23de95e19ae5a2ea57a80eb2d4b22b8f75891
MD5 1896f7a9a9116d69d8d3ab0bc166e909
BLAKE2b-256 26dd8440b71aac40be3c8d4b639d9a37439b2ac7ff26e29a71975b99091c4ad6

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