skip to main content
Rulebased Simulation
New Palette Functions
Following is a brief description of the new rules palette functions (Predefined Functions) available for use in the RiverWare Policy Language for writing rules. Details on the use of these function and the syntax involved are available in the Rulebased Simulation documentation online.
SolveSlopeStorageGivenInflowHW
The SolveSlopeStorageGivenInflowHW function solves a Slope Power Reservoir when inflow and pool elevation are known. The function returns a LIST with two values: the resulting outflow and the resulting storage. This function works the same as the analagous dispatch method on the Slope Power Reservoir. Therefore, this function will return the same results for outflow and storage as if the object simulated/dispatched with the same inflow and pool elevation values.
SolveSlopeStorageGivenInflowOutflow
The SolveSlopeStorageGivenInflowOutflow function solves a Slope Power Reservoir when inflow and outflow are known. The function returns a LIST with two values: the resulting pool elevation and the resulting storage. This function works the same as the analagous dispatch method on the Slope Power Reservoir. Therefore, this function will return the same results for pool elevation and storage as if the object simulated/dispatched with the same inflow and outflow values.
GetColMapVal
This function is given a Periodic Slot, a date, and a value with the units of the Periodic Slot’s data. It performs an inverse lookup to return the column map (secondary value) which corresponds to the given table value.
GetLinkedObj
When given a SLOT, this function returns a LIST of the objects which contain the slots to which the given slot is linked. An empty LIST is returned if the slot is not linked to any other slots.
AccountNamesByAccountType
When given an OBJECT and a STRING representing an account type (one of “Storage”, “PassThrough”, “Diversion” or “ALL”), this function returns a LIST of the accounts of the indicated type on the given object.
Setting Flags with Rules
The RiverWare Policy Language has been enhanced to allow rules to set special flags on series slots. The only flags which may be set are those which have the semantics “considered known (when the object is selecting a dispatch method) but are actually computed by the object at dispatch time”. These include the Surcharge Release, Max Capacity (for both Outflow and Energy), Best Efficiency and Drift. Each flag now has its own palette button for rule building. Below is a screen shot of the flag value buttons at the lower left corner of the palette. Also an example of a rule that sets a flags is given.
Performance Improvement to Hypothetical Simulation Functions
We Improved the performance of RPL hypothetical simulation functions by limiting the amount of information which is copied from objects on the workspace to the clones of them which are used for hypothetical simulation. In the past, the hypothetical simulation functions made no assumptions about which data would be needed from the objects in the subbasin under consideration, so it was all copied over when these objects were cloned. This approach does not scale well as the number of timesteps in the run is increased. We now make an educated guess about which data will be used by the hypothetical simulation and only clone the relevant portion.
This enhancement should be a big improvement to models that use the hypothetical simulation functions and have a large number of timesteps. Since we are making an educated guess about how much information to copy to the clones, existing models could be affected if our guess is incorrect. Let CADSWES know as soon as possible if it seems like the hypothetical simulation functions were working correctly for previous releases but not for this release.
Revised: 12/06/2024