Skip to content

MDhamani/SWAT-RL

Repository files navigation

SWATgym

SWATgym is a reinforcement learning environment based on the Soil and Water Assessment Tool (SWAT). SWAT is a physics based, continuous time, semi-distributed river basin model that has been widely used to evaluate the effects of crop management decisions on water resources (Arnold et al., 2012). SWATgym demonstrates the application of reinforcement learning to crop management and enables one to evaluate various decision-making strategies on a full growing season.

Similar to the original SWAT model (Arnold et al., 1998), SWATgym operates on a daily time step and considers various processes including:

  • crop growth,
  • hydrology,
  • nutrient cycles,
  • weather,
  • management inputs (fertilizer, irrigation).

Getting Started

All dependencies are included in the environment.yml file.

  1. Install SWATgym from source by running
git clone https://github.com/MDhamani/SWAT-RL
  1. After cloning, create a virtual environment e.g., using Conda:
conda env create --name swat_env --file=environment.yml
  1. Activate the environment: conda activate swat_env

  2. Run the followung command to start training of ALL RL agents:

python3 main.py

This will run DQN, DQN_PER, SAC, TD3, DDPG, PPO, and other non-RL agents.

  1. Running the command in 4 with algorithm flag can run the training of any particular RL agent. To run the training of DQN:
python3 main.py --algorithm DQN

References

Arnold et al., 1998. Large area hydrologic modeling and assessment part I: model development. Journal of the American Water Resources Association, 34 (1), 73–89.

Arnold et al., 2012. SWAT: model use, calibration, and validation. Transactions of the ASABE, 55 (4), 1491–1508.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •