skip to main content
RiverWare Policy Language
Editing RPL Expressions
Following are changes made to the interface when editing RPL Expressions:
• RPL inline expression editing can now be canceled with the Escape key (Esc).
• You can now use the Slot Selector button on the RPL palette to specify a slot name as a STRING. For the expression <object expr>.<string expr>, select <string expr> then select the Slot Selector button on the palette and choose the slot by selecting a representative slot.
Expression Slots
For expression slots, the variable ThisObject was implemented. This variable can be used to access the containing Data Object. This variable was previously available for Object Level Accounting Methods.
Function Argument Editor
The RPL Function Argument Editor was re-implemented and enhanced to always show the pulldown menu controls. See the following image.
Hypothetical Simulation
The run time performance of models that contain many calls to the Hypothetical Simulation RPL functions was significantly improved. In a 10 year daily timestep test model with many calls to HypTargetSim, the run time was reduced by 53%. Note, the run time reduction is a function of the number of timesteps in the run, the number of calls to these functions, the number of objects in the subbasins, and the number of values being set on those objects within the hypothetical simulation.
Maximum Rule Executions per Timestep
Previously, the maximum rule executions per timestep was hard coded to 50. Now, you can control this value by setting the Maximum Rule Executions Per Timestep parameter in the Rulebased Simulation Run Parameters dialog accessed from the Run Control's View menu. The value limits the number of times any rule can execute during a timestep. If this limit is exceeded, the run is aborted with an error message. The default remains 50.
New RPL Predefined Functions
DispatchTime and DispatchCount
New RPL predefined functions, DispatchTime and DispatchCount were added. They return the time and count, respectively, of dispatch method executions that have occurred since the beginning of the current run. See also this similar functionality described RPL Analysis Tool for the RPL Set Analysis tool.
GetSlotValsNanToZero and GetSlotValsByColNanToZero
Two new RPL Predefined Functions were added: GetSlotValsNanToZero and GetSlotValsByColNanToZero. These behave like GetSlotVals and GetSlotValsByCol, respectively, except that any NaN is replaced with zero and returned. Also these functions do not support Periodic Slots.
ListDownstreamObjects
A new RPL predefined function ListDownstreamObjects was added. It takes two objects and returns an inclusive list of all linked main channel objects in upstream to downstream order. See ListDownstreamObjects in RiverWare Policy Language (RPL) for more information.
SlotWeightedAverageOverTime
A new RPL predefined function SlotWeightedAverageOverTime was added. It computes a series slot's weighted average over a given time period, using another series slot’s values in that same time range as the weights.
SolveTurbineRelGivenEnergyInflow
A new RPL predefined function SolveTurbineRelGivenEnergyInflow was added. This function computes, on a Level Power Reservoir, the Turbine Release necessary to produce the specified Energy. If the Energy cannot be met, the maximum Turbine Release is returned.
Report Groups
The RPL set editor has a new way to organize the contents of a RPL set. The Report Groups tab allows you to add and organize references to the following items:
• RPL functions
• RPL blocks (Rules, Goals, OLAM methods, etc...)
• Objects
• Slots
• Subbasins
Note:  When added to a Report Group, the items are references to the existing item. One sample use of this tool is to organize items in a model that are related to a specific policy. The screenshot shows a Report Group that contains rules, functions, objects, subbasins, and slots related to Flood control.
Report Groups can be output to a Model Report at described Model Report.
For more information on Report Groups, see Blocks and Groups in RiverWare Policy Language (RPL).
RPL Analysis Tool
The RPL Analysis tool now shows two additional variables:
• Dispatch Count: For a Rulebased Simulation rule, this is the number of dispatch methods that have executed due to values being set by the rule.
• Dispatch Time: For a Rulebased Simulation rule, this is the time spent executing dispatch methods as a result of values being set by the rule
Use the Window p Column menu to add these items. See also this similar functionality described DispatchTime and DispatchCount
Revised: 01/05/2024