![Code captured within an IDE or code editor on a computer.](https://acims.asu.edu/wp-content/uploads/sites/18/2024/03/pankaj-patel-_SgRNwAVNKw-unsplash-scaled.jpg)
Water-Food-Energy modeling & simulation frameworks
The Componentized WEAP and Componentized LEAP are RESTful frameworks written in NodeJS for the Water Evaluation and Planning (WEAP) and the Low Emissions Analysis Platform (LEAP) Systems.
The nexus between the water (Componentized WEAP) and energy (Componentized LEAP) models can be modeled and simulated with the WEAP-KIB-LEAP framework. More information is available here.
Componentized WEAP
and Componentized LEAP
Installation Steps
Computing platforms: Windows 10 OS (see WEAP) and LEAP).
- Download & Install NodeJS (use MSI with default choices)
- Download & Install Python 2.7 (use MSI with default settings), and add python path to the “Environment Variables” of the Windows OS (add to system variables)
- Open command line (cmd) in windows and run:
npm install npm –global
npm install typescript –global
npm install node-gyp –global - Open Windows PowerShell (run as administrator) and run the following command.
This step may take time and further require multiple runs.
npm install –global –production windows-build-tools - Download & Install Visual C++ from here if there is any error in executing step 4.
IDE Installation
Any IDE can be used for programming, but we recommend VS-Code. In the following, the required extensions and configurations are mentioned to run the Componentized WEAP and Componentized LEAP frameworks.
- Download & Install VS-Code (choose user installer)
- Download & Install Git
- Install TSLint extension in VS-Code (open VS-Code, go to the extension page, type TSLint, and click on install button)
Execution Policy
Note: The execution policy in the Windows Client must be change to RemoteSigned to be able to run scripts. For more information see About Execution Policy and Set Execution Policy. So, open Windows PowerShell (run as administrator), and run:
- Set-ExecutionPolicy RemoteSigned
Running Componentized WEAP and Componentized LEAP in VS Code
To run the Componentized WEAP framework in the VS Code, follow these steps:
- Open VS-Code
- Press CTRL+SHIFT+P (View/Command Palette…) and type “git:clone“
- Enter the Componentized WEAP git URL (https://github.com/comses/ComponentizedWEAP.git) or Componentized LEAP git URL (https://github.com/comses/ComponentizedLEAP)
- Select the folder for the project to be uploaded
- Open VS-Code terminal (right click on the project and select Open in Terminal) and run the following command to update the required packages.
npm install - Press CTRL+SHIFT+P and type
tasks:run build task
- Run the project (using launch.json)
Licensing and copyright
These are proprietary software. For more information on licensing visit https://www.weap21.org/index.asp?action=217 and https://leap.sei.org/default.asp?action=license.
Copyright: The Componentized WEAP and Componentized LEAP software are developed at ACIMS/ASU with GNU General Public License version 3.0 (GPLv3).
Componentized WEAP Simulator
Version: 1.2, released June, 2024
Version: 1.1, released September, 2023
Componentized LEAP Simulator
Version: 1.1, released September, 2023
WEAP-KIB-LEAP
The nexus between the water (Componentized WEAP) and energy (Componentized LEAP) models can be modeled and simulated with the WEAP-KIB-LEAP framework.
Last updated date: 05-July-2022
Installation Steps for RESTful Interaction Model
MongoDB Installation steps
- Download MongoDB from https://www.mongodb.com/try/download/enterprise. Download the latest version (5.0.9) for Windows msi package. (check “Install MongoDB Compass” during installation)
- Run MongoDB service
- Go to “C:\Program Files\MongoDB\Server.4\bin” (the version of MongoDB may change in your installation)
- Double click on “Mongod.exe”
IDE Installation
- VS-Code
- Download & Install VS-Code from https://nas/content/live/fsewppitchfork.visualstudio.com/Download (choose user installer)
- Download & Install Git from https://git-scm.com/downloads
- Eclipse
- Download and Install Eclipse from “https://www.eclipse.org/downloads/”
Postman Installation
- Download & Install Postman from https://www.postman.com/downloads/
JRE (Java Runtime Environment)
- JRE 11 is required
Running DEVS-IM in VS-Code
- Open VS-Code Editor
- Press CTRL+SHIFT+P (View/Command Palette…) and type “git:clone”
- Enter the git URL (https://github.com/comses/ComponentizedKIB.git)
- Select the folder for the project to be uploaded
- Go to “Run and Debug” tab, select “KIB (ComponentizedKIB)” and click on run button.
- The “Interaction Model is running…” message must be seen in the Terminal tab.
Note: The name of the database and the port for the web server can be change in the “src/main/resource/application.properties” file.
Running DEVS-IM via Jar file
- Download DEVS-IM.rar file from “???”
- Extract the rar file (it includes DEVS-IM.jar file and templates folder)
- Open command prompt and run
java -jar “path to the DEVS-IM.jar file”
The following message must be seen in the window (click ctrl+c to close the framework):
Note: The name of the database and the port for the web server are fixed in the jar file to “im” and “8085”, respectively.
Define Interaction Model Structure
- Define entities of the interaction model using the DEVS-IM APIs (see Appendix 1)
- After completing the model, use API “/IM/Projects/{projectId}/IMs/{id}/ GenerateCode” (Appendix 1 – Interaction Model – API #6) to generate the source code. A folder with the same name as the IM model will be generated beside the jar file (if running the jar file) or in the target package (if running via IDE).
Import DEVS-Suite Simulator into the Eclipse
- Download DEVS-Suite Simulator source code from the ACIMS webpage (https://acims.asu.edu/devs-suite/)
- Extract the source code and import it to the Eclipse IDE
Import DEVS-IM Model into the DEVS-Suite
- Copy and paste the generated source code by the DEVS-IM (see previous sections) under “Models.InteractionModel” package
- Modeler must define the behavior of the Task and Function entities. Now, the model is ready to be simulated by DEVS-Suite Simulator
Required tools/frameworks to execute a Water-Energy model via DEVS-IM
- WEAP and LEAP Tools
- These propriety software systems need to be installed on a Windows 10 OS.
- WEAP is available at https://www.weap21.org/
- LEAP is available at https://energycommunity.org/
- Componentized WEAP and Componentized LEAP Frameworks
- Follow the installation guide for both frameworks at https://acims.asu.edu/software/weap-leap/
Order of running tools/frameworks
- Run WEAP & LEAP (in any order)
- Run Componentized WEAP and Componentized LEAP (in any order)
- Run DEVS-Suite Simulator and execute the model
References
- M.D. Fard and H.S. Sarjoughian, 2021, “A RESTful Framework Design for Componentizing the Water Evaluation and Planning WEAP System”, Simulation Modelling Practice and Theory, 106, 1-19, https://doi.org/10.1016/j.simpat.2020.102199.
- M.D. Fard, H.S. Sarjoughian, I. Mahmood, A. Mounir, X. Guan, and G. Mascaro, 2020, “Modeling the Water-Energy Nexus for the Phoenix Active Management Area”, Winter Simulation Conference, Virtual Conference, December 14-18, USA.
- M.D. Fard and H.S. Sarjoughian, 2020, “Coupling WEAP And LEAP Models Using Interaction Modeling”, 52nd Annual Simulation Symposium, SpringSim conference, May, Fairfax, VA, USA.
- M.D. Fard and H.S. Sarjoughian, 2019, “A Web-service Framework for the Water Evaluation and Planning System”, 15th Symposium on Theory and Foundations for Modeling & Simulation, April, SpringSim conference, Tucson, AZ, USA.
Contact
Point of contact: Hessam S. Sarjoughian ([email protected])