skip to main content
RiverWare Policy Language
Editing RPL Expressions
When editing RPL logic using the palette, if you select an Object.Slot lookup, and then select one of the other Object.Slot lookup buttons, it will reuse the expression so you do not need to re-specify the object and slot.
For example, you can change BigRes.Outflow[ ] to BigRes.Outflow[<expr>] without re-specifying BigRes.Outflow.
Initialization Rule Diagnostics
Initialization Rule diagnostic filtering has been improved. See Initialization Rules Filtering for more information.
Global Function Sets Embedded in Model
You can now embed Global Function Sets (GFS) so they are saved with the model file. Previously this was possible with rulesets and goalsets. To save a GFS with the model file, use the Run Control View Simulation Run Parameters and then select the check box to Save All Global Function Sets with Model.
Saving Sets in Model File
When a model is loaded which contains an embedded ruleset or goalset, that set was at one point loaded. If it is now invalid, it cannot be re-loaded. Previously, if you saved the model in that state, it would lose the set. Now RiverWare continues to retain the set with the model file as long as there is no other loaded set and the Save Loaded RPL Set with Model option continues to be selected.
New RPL Predefined Functions
IntegerToString
A new function IntegerToString was added. This function takes a numeric and converts the integer portion of it to a string. For example IntegerToString(18.234 cfs) returns “18”. See IntegerToString in RiverWare Policy Language (RPL) for more information.
NumberToYear
A new function NumberToYear was added. This function takes a numeric and converts the integer portion of it to a DateTime. For example NumberToYear(1932.00) returns @”Year 1932”. See NumberToYear in RiverWare Policy Language (RPL) for more information.
OptValuePiecewise
A new function OptValuePiecewise was added. This function returns the piecewise approximation of an optimization variable. See OptValuePiecewise in RiverWare Policy Language (RPL) for more information.
RPL Palette Access
The RPL Palette can now be accessed from the Workspace Policy menu and from all RPL editors through the Set or Group menu. The shortcut Alt-P is also supported from all of these locations.
RPL Search and Replace
The RPL Search and Replace utility now searches for instances of the text in DateTimes, Numerics, and Booleans.
WARNING Statement
A new top level statement, WARNING was added to RPL sets. This statement, when executed in a run, posts the specified expression to the diagnostic output window in the brown warning text color. Unlike the PRINT statement, the message is shown regardless of diagnostic setting. Also, the WARNING does not stop the run like the STOP RUN statement.
Revised: 07/05/2022