L-12-State Variables and Scripting
L-12-State Variables and Scripting
Topics
Terminology
Model Variables
State Variables
Creating and Using Scripted State Variables
Creating and Using Scripted Rules
Utility (static) Scripts
Jython
variables
User-defined state variables are called state variables
basin wetness
drought level
system storage utilization
depth-area-duration considerations
available to Jython
Enter the desired name in the Name field of the New State
Variable dialog.
Enter a description if you can
Press the OK button.
Script Tabs
Script Pane
(editor window)
API Pane
(Objects and
Methods window)
The same can be accomplished by selecting a node in the API and then
selecting the Insert in Script button under the API Pane.
Scripting in HEC-ResSim
There are two types of Scripts in HEC-ResSim
1. Scripts executed during simulations
These scripts can:
Variable Scripts
Scripting in HEC-ResSim
2. Scripts executed outside simulations
These scripts can:
They can be executed from the Script Selector, Script Pane, or Script
Editor.
They are edited and tested in the Script Editor.
Their location in the Tree Pane of the Script Editor corresponds to a file
on disk.
Visibility Switches
File Name
Description Pane
Icon Selector
Pre-Defined Variables
Editor Pane
Edit/Save/Test Buttons
Dismissal Buttons
Location / Mode Indicators
Watershed Setup
Reservoir Network
Simulation
following:
What is Jython?
http://jython.org
Jython is a Java-based implementation of the
quickly.
Others can quickly become effective by mimicking
examples.
What is Python?
http://python.org
Review
Scripts Executed During Simulations
State Variable Scripts
Scripted Rule Scripts
Scripts Executed Outside Simulations
Static Scripts
Jython