Sie sind auf Seite 1von 12

IF-Then-Else Blocks

Adding Conditional Logic to the HECResSim Operation Scheme

Hydrologic Engineering Center

Need for if-then-else logic


Typically, water

control system
regulations follow
conditional paths
for decision-making
Conditions are used

to determine the
applicability of
operational goals
and constraints

IF-THEN-ELSE in HEC-ResSim
Operational constraints with

conditional statements
Compound conditions
Nested if-then-else
current inflow < 85% of Average
Or current inflow < 50 cms
current inflow > 85% of Average
And current inflow < 120% of Average
current inflow > 120% of Average
And current Date > 20 Mar 2005
And current Date < 15 Apr 2005

How toCreate an IF block


From the Operations

tab of the Reservoir


Editor, select a zone
in your current
operation set
Select New from the
If_Block menu
or
Right-click on the
zone in the tree.
Select Add IF Block
from the context
menu
Give your IF Block a
name
Press OK

Adding Conditions

Specifying Test Values


Constant -> numeric

value
Date/Time ->

ddmmmyyyy, hh:mm
Current Time Step
Time Series ->

External Variable,
Model Variable, or
State Variable
Seasonal -> ddmmm
( ) -> group

conditional tests

Test Values Time Series

Test Values Time Series

Test Operators

Compound Conditional Test

Add rules to the IF block


Add ELSE IF and/or ELSE blocks

Complex
Example

Das könnte Ihnen auch gefallen