skip to main content
RiverWare Policy Language
Expression Font Colors
For better readability, the font color of the selected expression’s foreground text is now either white or black (dynamically computed) to contrast with the configured background color. Previously, it always used the configured foreground color which could be hard to read.
Initialization Rules
In RiverWare 6.0, Initialization Rules could either set values with the “Z” or “i” flags. It was decided to replace the “i” flag option with the “R” flag option. Thus, initialization rules can set either the “R” or “Z” flag. In rulebased simulation, values set with the “Z” flag are given the highest priority, that is, zero (0) priority. Values set by initialization rules with the “R” flag are given a low priority equal to the number of rulebased simulation rules plus one (number of RBS rules + 1).
Existing Initialization Rules sets which contain rules which previously set the “i” flag will be adjusted to set the “R” flag instead; a one-time warning will be issued.
Because the “i” flag is now specific to iterative MRM, the name of the “i” flag was changed to “Iterative MRM” (originally it was “Computed Input”, then it was “Initialization”, now it is “Iterative MRM”).
New Predefined Functions
The following predefined functions were added to RPL:
CompletePartialDate
The datetime function CompletePartialDate(DATETIME partialDate, DATETIME sourceDate) fills in the missing components of the partialDate value to make it fully specified. The missing component are taken from the second argument, sourceDate, a datetime. If not fully specified, sourceData should have at least the components which are missing from the date which is being completed.
DispatchEndDate
The datetime function DispatchEndDate returns the last dispatch date. For more information, see Post run dispatching for a description of post-run dispatching or DispatchCount in RiverWare Policy Language (RPL) for the function documentation.
GetRunCycleIndex
The numeric function GetRunCycleIndex() returns the run cycle. For more information, see the section on Run Cycles Run Cycles or the function documentation GetRunCycleIndex in RiverWare Policy Language (RPL).
GetYearAsString
The string function GetYearAsString(DATETIME date) returns the year of the given datetime as a string. E.g., Given the datetime January 1, 2000, this function will return the string “2000”. For more information, see GetYearAsString in RiverWare Policy Language (RPL).
HasFlag
The boolean function HasFlag(SLOT slot, DATETIME date, STRING flag) checks if the specified slot at the specified datetime has the specified flag. For a description and list of possible flags, see HasFlag in RiverWare Policy Language (RPL)
Palette Functions Tab
On the RPL Palette functions tab, a toggle was added that allows you to show or hide only functions which have the return type of the selected RPL expression.
On the Predefined Functions tab, when the checkbox is off, all predefined functions are shown even if no expression is selected.
RPL Debugging Indicator
A button was added to the Run Control dialog to indicate the state of the RPL Debugger. Select the button to toggle the state. Shift-Click the button to open the RPL Debugger.
This button is shown when RPL Debugging is first enabled, but remains in place for that RiverWare session. To hide the button, use the View Show RPL Debugging Button. For more information on RPL Debugging, see RPL Debugger in Debugging and Analysis
RPL Set Navigation
To better aid in navigating RPL sets, color coded icons are now displayed on the bottom of the workspace for any
• Ruleset, goal set, or global function set opened from a file
• Embedded sets (OLAM, expression slots, Init rules, Iterative MRM) that contain at least one group
Mouse over any icon for a tool tip indicating the location or click to open that set. Also, the sets are still available through the Policy menu.
Revised: 07/05/2022