Model Skip Rules Editor
The Model Skip Rules Editor is available as part of the flood risk analysis (FRA) compute of HEC-WAT. The purpose of the Model Skip Rules Editor is to allow the user to define logical expressions (i.e., if-then statements) of conditions when model computations will be skipped, or not performed, within an FRA compute. This allows the user to eliminate unnecessary computations and reduce run-times for an FRA compute. Note the user needs to understand what it might mean to skip a model alternative within an FRA compute. Some model alternatives should never be skipped within the compute sequence. A performance metrics alternative should never be skipped, because some of the computed results may not be correct if the performance metrics alternative is skipped.
To access the Model Skip Rules Editor, from the HEC-WAT main window, from the toolbar click , or from the Edit menu, point to FRA, and click Model Skip Rules Editor. Alternatively, from the Study Tree, right-click the Flood Risk Analysis simulation (e.g., Base_FRA), point to Tools and click Model Skip Rules Editor.
Either way the Model Skip Rules Editor opens.
Building Logical Expressions Overview
To create a skip rule for a simulation and a model alternative that is part of that simulation's program order, perform the following steps:
- From the Model Skip Rules Editor, from the Simulation list, select a simulation (e.g., Base_FRA). From the Description box, the user can enter an optional description.
From the Model Alternative list, select a model alternative that is part of the selected simulation (e.g., the HEC-RAS model alternative, FRA).
Important
The skip rule that is being created will be applied prior to the selected model alternative (e.g., FRA). It is important to note that the skip rule is not automatically applied to the selected model alternative; the skip rule must be placed within the compute sequence of the selected model alternative.
- Only models at and below the selected model alternative are available to be skipped, and standard practice is to select the model alternative that corresponds to the model that will be skipped first.
- The Build Logical Expression table contains three columns: Row, Condition, and Rule. The Build Logical Expression table is where a logical expression is defined that provides information to the simulation about when and which model computations will be skipped during an FRA compute. A logical expression is tied to the selected model alternative, which means that only one logical expression can be defined per model alternative. The default values presented in the table are the IF and END conditions, and the user defines desired conditions and rules.
To build the first part of each skip rule (IF [Expression A] compared to [Expression B]), the user starts by selecting the IF row in the Build Logical Expression table (Row 1). This enables the Edit Logical Expression panel of the Model Skip Rules Editor.
The basic format of a logical expression follows:
IF [Expression A] compared to [Expression B] is true, SKIP [Selected Models]. The user can add more complex logic using ELSEIF, ELSE, AND and OR logic actions, and can add parentheses around a selection or a COMMENT to the logical expression to support understanding of the decision logic. Each expression must be defined to return a scalar value, and two expressions are evaluated to determine whether the specified comparison of scalar values results in a true or false condition. If the comparison results in a false condition, no action is taken. If the comparison results in a true condition, the model alternatives selected by the user are skipped in the compute sequence.
- From the Edit Logical Expression panel, the user can select which type of logical expression needs to be built from the Logical Expression list. The Logical Expression list has two options - Comparison and Model was Skipped.
- The Comparison option allows the user to compare one expression to another to determine whether a computation should be skipped. When the first model alternative in the list is selected, only the Comparison option is available. Refer to the Comparison Logical Expression section for more information.
- The Model was Skipped option allows the user to include the following condition within the logical expression: a model alternative located earlier in the compute sequence has been skipped. Further information about editing a logical expression is detailed in Model was Skipped Logical Expression.
- The Available Actions panel contains options to add other conditions to the skip rule beyond the simple IF statement. Refer to the Available Actions section for more information.
- After the desired logical expression has been built for the first part of the skip rule (IF [Expression A] compared to [Expression B]), click Save to add the expression to the IF row in the Build Logical Expression table (e.g., MAX(ResSim:Baseline_F[Guerneville Gage - Flow])<30000.0 in Row 1).
- Select the next row in the Build Logical Expression table (Row 2), from the Available Actions panel, and click Select List of Models to Skip. The Edit Logical Expression panel is replaced by the Select Models to Skip panel. Check the checkbox to select the models to skip. Click Save to add the expression to the SKIP row in the Build Logical Expression table (e.g., RAS:FRA;FIA:SDDepthGridOnly in Row 2).
- Click Apply to save the logical expression and keep the Model Linking Editor open. Alternatively, click OK to save the logical expression and close the editor.
Model Skip Rules Editor - Default IF Condition
This section describes in detail the two logical expression functions, Model was Skipped function and Comparison function, for the IF condition. The user has the option to add other conditions to the logical expression beyond the simple IF statement.
The Available Actions commands provide the user with options to complete a logical expression beyond the default IF condition. Refer to the Available Actions section for more information.
Model was Skipped Logical Expression
The Model was Skipped function is used to evaluate whether a previous model alternative was skipped due to a skip rule. This option is most beneficial when the user wants to base skipping of a model alternative on another model alternative that does not immediately precede the model alternative of interest (i.e., is several levels higher in the Program Order).
If the logical expression choice is Model was Skipped, the user only has to select the model alternative that will be skipped from the Model list (e.g., (MCA)Russian River FRA). Only model alternatives in the compute sequence before the selected model alternative are available in the list. Click Save, and the selected model alternative will display in the Build Logical Expression table, row one, Rule column.
Next, the user must finish the logical expression. For example, the users can select the next row in the Build Logical Expression table (Row 2), and from the Available Actions panel, click Select List of Models to Skip. Then, from the Select Models to Skip panel, the user can select the models to skip and click Save to add the expression to the SKIP row in the Build Logical Expression table (e.g., Row 2).
Comparison Logical Expression
The Comparison function is used to compare the scalar values created by the two expressions to determine whether the comparison results in a true or false condition.
If the logical expression choice is Comparison, in the Expression A box, start creating the Expression A part of the logical expression. To the right of the Expression A box, click Edit, and the Edit Logical Expression dialog box opens.
From the Edit Logical Expression dialog box, build the Expression A part of the logical expression. Further information about editing a logical expression is detailed in the Edit Logical Expression section. When finished click Save. Click OK and the Edit Logical Expression dialog box closes. In the Expression A box of the Model Skip Rules Editor, the created expression displays. To add the saved Expression A to the Build Logical Expression table, select Apply in the Model Skip Rules Editor.
When the logical expression choice is Comparison, the comparison operator must be selected from the Comparison Operator list.
The Comparison Operator defines how Expression A will be compared to Expression B. From the Model Skip Rules Editor, from the Edit Logical Expression panel, the Comparison Operator list contains the following operators:
== (equal to)
!= (not equal to)
<= (less than or equal to)
>= (greater than or equal to)
< (less than)
> (greater than)
Next, in the Expression B box, build the Expression B part of the logical expression. To the right of the Expression B box, click Edit, and the Edit Logical Expression dialog box opens. From this editor build the Expression B part of the logical expression. Further information about editing a logical expression is detailed in the Edit Logical Expression section. When finished building Expression B, click Save. Click OK and the Edit Logical Expression dialog box closes. In the Expression B box of the Model Skip Rules Editor, the created expression displays. To add the saved Expression B to the Build Logical Expression table, select Apply in the Model Skip Rules Editor.
Available Actions
The user has the option to add other conditions to the skip rule beyond the simple IF statement. If the user selects a row in the middle of the skip rule (i.e., not the first or the last row), all four commands in the Available Actions panel are enabled - Else If, Else, And, and Or. When the user selects one of these options, a new row with the selected command is added to the Build Logical Expression table above the highlighted row. If the user selects the END row, only the Else If and Else commands are enabled. In this case, a new row with the selected command is added to the Build Logical Expression table above the END row. The commands function is detailed in the following sections.
Default - If
The default IF condition specifies the first rule that is tested for true or false. This is included in the Build Logical Expression table by default. If this rule is true, the evaluation moves to the Skip rule. If the If rule is false, the evaluation moves to the first Else If rule. If all rules are false, the evaluation moves to the Else rule if the user has chosen to specify a default action. Otherwise the evaluation stops and no models are skipped.
Else If
This condition allows the user to evaluate additional rules for true or false beyond the initial If rule. If the evaluation is false for the initial If rule, the evaluation moves to the first Else If rule to test for true or false. If an Else If rule is true, the evaluation moves to the Skip rule. If an Else If rule is false, the evaluation moves to the next Else If rule. If all rules are false, the evaluation moves to the Else rule if the user has chosen to specify a default action. Otherwise the evaluation stops and no models are skipped. The user can include as many Else Ifs, or alternate rules, as desired.
Else
This condition specifies the default action when none of the If or Else If rules are evaluated as true. The Else rule is optional, and only one Else rule is allowed in a logical expression.
And
The And condition can be used to ensure that multiple rules are evaluated as true before models are skipped. If any part of an And rule set is evaluated as false, the logical expression evaluation stops and no models are skipped.
Or
The Or condition allows evaluation of additional expressions if previous expressions are evaluated as false. If any part of an Or rule is evaluated as true, the logical expression evaluation moves to directly to the Skip rule.
Selection
This option lets the user specify the order of operation using parentheses, where operations inside parentheses are completed first.
Select List of Models to Skip
The user should specify which models to skip in the FRA compute if the skip rule is met. This is done by selecting the row in the Build Logical Expression table that contains END. In the Available Actions panel, several options become available.
To skip models in the selected FRA simulation, click Select List of Models to Skip, the Select Models to Skip panel contains a list of model alternatives that could be skipped. The list is based on the selected model alternative and the listed models follow the selected model alternative in the program order. The user should select the model of interest to skip, as well as all other models that follow in the compute sequence because they will not have input data to run.
Comment
This command allows the user to enter documentation within a logical expression. Comments do not affect the evaluation of the logical expression.
Delete
Multiple conditions can be added to the Model Skip Rules Editor, and one or more rows can be deleted by highlighting them and selecting the Delete button.
Default - End Condition
The END condition signifies the end of the defined logical expression or skip rule.