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.4.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.4-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cwatqim-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 218d37d2a74103b94ac697554fcd24473e67dd359ed0bce820ef6ada97eff168
MD5 7f2e3b2065f47cd5258d65586034c25e
BLAKE2b-256 ec2eb6f6c1f6506d4310ca10767c111fb19a4c1b7a4f8b6b4949b989286ada13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cwatqim-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f0cd2427b6079cf1db99f158998f140aa36fbf6fc3710105f5a1869dd8d085ed
MD5 5ae06dea4c6b9a07e2ccdd452c11b811
BLAKE2b-256 4772fadf4acd6a1fe3978bac7280d3e2eb564c824080a49da4f2249e9e53c030

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