Skip to content

asood12/waterlp-general

 
 

Repository files navigation

Overview

This is a demand-driven, priority-based model developed for OpenAgua, similar in concept to WEAP. Key differences include:

  • demand and priority can both be specified as arrays ("blocks"), to allow for piecewise linear changes in water value
  • within each block, demand/priority arrays can be automatically divided into equal parts ("subblocks") with quadratic value functions to allocated shortages in a second level of piecewise linearization

Some additional key points:

  • Currently uses Pyomo for model formulation
  • Uses GLPK for the LP solver

Installation

Docker installation

Docker is a system for packaging and deploying software in a way that ensures cross-platform consistency. Docker installation is included first, as it is a simple process to install.

  1. Install Docker
  2. Install the openagua/waterlp-general-pyomo, OR install directly using the Dockerfile

NOTE: Docker is not currently set up for writing output to a local folder. So if the intent is to use this totally offline, the Dockerfile needs to be modified to map an output folder from the local computer to the Docker container. The model script would also need to be modified to allow this.

Direct installation

Direct installation is for those who want to run a Python script directly, including for development. The general process, which is more or less the same as in the Dockerfile is as follows. Some hints are offered for different systems, but generally the specific installation details are left to the user. For example, a lot of this (all?) might be done through Anaconda. Google is your friend here!

  1. Install Python 3.6
  2. Install software needed to compile C++ packages (e.g., build-essential on Linux).
  3. Optionally (but recommended), create a virtual environment with Python 3.6. Follow these instructions. If following that guide, replace virtualEnvExample with something like waterlp, and make sure to use Python 3.6. So for Step 2: virtualenv -p /usr/bin/python3.6 waterlp (if on Linux; change the path to the correct one if on Windows). NOTE: Virtual environments are an annoying part of Python, especially if you are coming from, say, R or Matlab. They aren't strictly required, but are generally recommended to ensure correct versions of libraries are installed for each project. Most of the top Python IDEs (e.g., PyCharm, Wing IDE, Spyder, etc.) have tools built in to help create and manage virtual environments. PyCharm is particularly good.
  4. Clone this repository into a folder of your choice.
  5. From within the root folder of your local copy of this repository (and from within your virtual environment, if used) install the required Python libraries with pip: pip install -r requirements.txt.
  6. Finally, install GLPK, the LP solver (Linux: glpk-utils; Mac: see here; Windows: see here)

Instructions for use

(documentation forthcoming)

Troubleshooting

(documentation forthcoming)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.6%
  • Other 0.4%