RiverWare Policy Language (RPL)
RPL Language Structure
About RPL
RPL Requirements
Imperative Versus Functional Programming
Imperative Programming Paradigm
Referential Transparency
Functional Programming Paradigm
Examples
RPL: A Hybrid Approach
RPL User Interface
About RPL Sets
Set Name
RPL Parameters
Numeric Comparison Tolerance
Collect and Display Notes
WHILE Expression Maximum Iterations
Allow Literal RPL values to have variable time units
Save Location
Maximum Rule Executions Per Timestep
Managing RPL Sets
Actions Specific to Rulesets, Optimization Goal Sets, and Global Function Sets
Actions Specific to Accounting Method Set, Expression Slot Set, Initialization Rules, and Iterative MRM Sets
Tour of a RPL Set
RPL Set Elements
RPL Set Editor View
Expand or Collapse All Groups
Show RPL Set Description
Show Selected Description
Show Set Notes
Show Advanced Properties
Show Predefined Groups
Show Statements
Show Export Columns
Disable Mouse Edits
External Documentation
Editing RPL Sets
Blocks and Groups
Naming Groups
Name Color
Adding Groups
Add Blocks and Functions
Add Report Items
Change Priorities
Delete Groups, Blocks and Functions
Open and Close Policy, Utility, and Report Groups
Open and Close Rules, Functions, Methods, Goals, and Report Items
Copy and Paste Groups, Blocks, and Functions
Exporting and Importing Groups and Blocks
Validity
Comparing RPL Sets
Accessing the Comparison Tool
Selecting RPL Sets to Compare
Tour of the RPL Set Comparison Tool
Sets Panel
Search and Filter Tools
Filter Settings
Custom Filter Sets
Clearing Filters
Export/Import Filter Sets
Quick Filters
Comparison Results Panel
Selected Property
Copy Property
Example of Using the RPL Set Comparison Tool
Exporting and Importing RPL Sets
Export
Import
Using the RPL Viewer and RPL Editor
Accessing the RPL Viewer
Arranging Tabs
Undocking RPL Editors
Redocking RPL Editors
Closing a RPL Editor Tab
Working With RPL Dialogs
Execution Constraint / Execute Block Only When
Descriptions
Notes
Comments
Executing DMIs From Blocks
Stop On NaN
RPL Statements
Assignment
For
With
If
If Else
Else If Branch
Else Branch
Print
Notice
Warning
Alert
Stop Run
Execute Script
Set Column
Set Row
Editing a RPL Expression
Using the Palette
Entering Values
Auto-Correct
Common Values
Precision of Numeric Values
Undo and Redo
Using the History
Data Types for Looping Variables
Renaming Looping Variables and Function Arguments
RPL Shortcuts
Disabling an Item in a List or a Statement
Opening Slots and Objects From RPL Dialogs
RPL Search and Replace Dialog
Accessing the Dialog
Searching for Occurrences of a String
Replacing Matching Strings With Another String
About RPL Functions
Predefined Functions
Writing a User-defined Function
Constraints on Functions
Time-invariant Functions and Function Value Caching
Selecting RPL Items
Developing Efficient RPL Expressions
Example: Creating a New RBS Ruleset
Adding Groups, Rules, and Functions
Initialization Rules Set
When to Use Initialization Rules
How to Use Initialization Rules
How do I access the Initialization Rule Set?
Where are they saved?
When are they executed?
In what order are they executed?
What do Initialization Rules set?
Do Initialization rules re-execute when dependent slots change?
Do Initialization Rules have Individual Priorities.
What Flag/Priority are the values given?
Can I disable the Initialization Rules?
How do I know which Initialization rule set a slot value?
How do I debug Initialization Rules?
Global RPL Functions
Creating a New Global RPL Function Set
Opening an Existing Global Function Set
Using Global RPL Functions
RPL Printing and Formatting
Printing
Formatting: Display Settings
Font
Colors
Line Breaks
Element Numbers
Highlight Elements Equivalent to the Selection
RPL Data Types and Palette
Expression Data Types
NUMERIC
BOOLEAN
DATETIME
Fully or Partially Specified Datetime Expressions
Fully Specified
Partially Specified
Formats
Examples
Datetime Math
Math Within a Datetime Specification
Mathematical Expressions Involving a Datetime Operand
Using the OffsetDate function
STRING
OBJECT
SLOT
LIST
RPL Palette
Buttons Tab
User-Defined Functions Tab
Predefined Functions Tab
Clipboard Tab
RPL Palette Buttons
Mathematical Operation Buttons
Logical Operation Buttons
Setting Tolerance for Use in the Logical Comparison Operators
Object and Slot Lookup and Assignment Buttons
Unary Operation Buttons
Values
Buttons for Common Values
Buttons for Setting Flags on Slots
Conditional and Iterative Operations Buttons
List Operation Buttons
Miscellaneous Buttons
Units in RPL
Unit Operators
Conversion Factors for RPL Units
Use of Variable Length Time Units
Transition
Allow Literal RPL Values to Have Variable Length Time Units Setting
RPL External Documentation
About RPL External Documentation
External Documentation Features
Document Structure
One Document that Describes the Entire Set
One Document for Each RPL Object in the Set
Multiple Documents With One for Each Policy and Utility Group
Separate View and Edit Documents
Configuration and User Interface
Viewing and Editing Documents
HTML
Viewing HTML Files
Editing HTML Files
Anchors in HTML Files
Generating a HTML Template File
Microsoft Word
Viewing Microsoft Word Files
Editing Microsoft Word Files
PDF
Viewing PDF Files
Editing PDF Files
Text Files
Use Example
RPL Predefined Functions
About RPL Predefined Functions
RPL Predefined Functions Reference
Abs
AccountAttributes
AccountNameFromPriorityDate
AccountNamesByAccountType
AccountNamesByWaterOwner
AccountNamesByWaterType
AccountNamesFromObjReleaseDestination, AccountNamesFromObjReleaseDestinationIntra
AccountNamesFromPriorityDate
AccountPriorityDate
AggregateSeriesSlot
AnnualEventCount
AnnualEventLastOccurrence
AnnualEventStats
AvgObjectsAggregatedOverTime
AvgObjectsAtEachTimestep
AvgTimestepsAggregatedOverObjects
AvgTimestepsForEachObject
Ceiling
ColumnLabel
ColumnLabels
CompletePartialDate
ComputeReservoirDiversions
DateMax
DateMin
DatesInPeriod
DateToNumber
Destinations
DestinationsFromObjectReleaseType
DispatchCount
DispatchEndDate
DispatchTime
Div
ElevationToArea
ElevationToAreaAtDate
ElevationToMaxRegulatedSpill
ElevationToStorage
ElevationToStorageAtDate
ElevationToUnregulatedSpill
Exp
FilterByObjType
FlattenList
FloodControl
Floor
FlowToVolume
Fraction
Get3DTableVals
Get3DTableValsSkipNaN
GetAccountFromSlot
GetAllNamedBasins
GetColMapVal
GetColumnIndex
GetDate
GetDates
GetDatesCentered
GetDayOfMonth
GetDayOfYear
GetDaysInMonth
GetDisplayVal
GetDisplayValByCol
GetElementName
GetEnsembleTraceValue
GetEnsembleValue
GetEnsembleSeriesValue
GetJulianDate
GetLinkedObjs
GetLowerBound
GetLowerBoundByCol
GetMaxOutflowGivenHW
GetMaxOutflowGivenInflow
GetMaxOutflowGivenStorage
GetMaxReleaseGivenInflow
GetMinSpillGivenInflowRelease
GetMonth
GetMonthAsString
GetNumbers
GetObject
GetObjectDebt
GetObjectFromSlot
GetPaybackDebt
GetRowIndex
GetRowIndexByDate
GetRunCycleIndex
GetRunIndex
GetSelectedUserMethod
GetSeriesSlots
GetSlot
GetSlotName
GetSlotNameAndCol
GetSlotVals, GetSlotValsNaNToZero
GetSlotValsByCol, GetSlotValsByColNaNToZero
GetTableColumnVals, GetTableColumnValsSkipNaN
GetTableRowVals, GetTableRowValsSkipNaN
GetTextSlotValueAsString
GetTimestep
GetTraceNumber
GetUpperBound
GetUpperBoundByCol
GetYear
GetYearAsString
HasFlag
HasRuleFiredSuccessfully
HydropowerRelease
HypLimitSim
HypLimitSimWithStatus
HypSim
HypTargetSim
HypTargetSimWithStatus
IntegerToString
IntegerWithUnitsToString
IsControllerOpt
IsControllerRBS
IsControllerSim
IsEven
IsInput
IsOdd
LeapYear
ListDownstreamObjects
ListSlotSet
ListSubbasin
Ln
Log
Max
MaxByIndex
MaxItem
MaxObjectsAggregatedOverTime
MaxObjectsAtEachTimestep
MaxTimestepsAggregatedOverObjects
MaxTimestepsForEachObject
MeetLowFlowRequirement
MemoryUsage
Min
MinByIndex
MinItem
MinObjectsAggregatedOverTime
MinObjectsAtEachTimestep
MinTimestepsAggregatedOverObjects
MinTimestepsForEachObject
Mod
NetNonShortDiversionRequirement
NetSubbasinDiversionRequirement
NextDate
NumberToDate
NumberToYear
NumColumns, NumRows
ObjAcctSupplyByWaterTypeRelTypeDestType
ObjectAttributeValue
ObjectHasAttributeValue
ObjectiveValue
ObjectsFromAccountName
ObjectsFromAttributeValue
ObjectsFromWaterType
OffsetDate
OperatingHeadToMaxRelease
OptDualPrice
OptReducedCost
OptReducedCostByCol
OptValue
OptValueByCol
OptValuePiecewise
Percentile
PercentRank
PreviousDate
RanDev
Random, RandomNormal
ReleaseTypes
ReleaseTypesFromObject
ResetRanDev
Reverse
RoundToFactor
RowLabel
RowLabels
RunStartDate, RunEndDate
RunTime
SlotCacheValue
SlotCacheValueByCol
SlotWeightedAverageOverTime
SolveInflow
SolveMonthlyOutflowAnnualTimestep
SolveMonthlyStorageAnnualTimestep
SolveOutflow
SolveOutflowGivenEnergyInflow
SolveShortage
SolveSlopeStorageGivenInflowHW
SolveSlopeStorageGivenInflowOutflow
SolveStorage
SolveSubbasinDiversions
SolveTurbineRelGivenEnergyInflow
SolveWaterRights, SolveWaterRightsWithLags
Sort
SortPairsAscending, SortPairsDescending
SourceAccountAndObject
Split
StorageToArea
StorageToAreaAtDate
StorageToElevation
StorageToElevationAtDate
StringToTextSlotNumeric
Sum
SumAccountSlotsByWaterType
SumByIndex
SumFlowsToVolume, SumFlowsToVolumeSkipNaN
SumFlowsToVolumeByCol, SumFlowsToVolumeByColSkipNaN
SumObjectsAggregatedOverTime
SumObjectsAtEachTimestep
SumSlot, SumSlotSkipNaN
SumSlotByCol, SumSlotByColSkipNaN
SumTableColumn
SumTableRow
SumTimestepsAggregatedOverObjects
SumTimestepsForEachObject
SupplyAttributes
SupplyNamesFrom, SupplyNamesFrom1to1
SupplyNamesFromIntra, SupplyNamesFromIntra1to1
SupplyNamesTo, SupplyNamesTo1to1
SupplyNamesToIntra, SupplyNamesToIntra1to1
SupplySlotsFrom, SupplySlotsFrom1to1
SupplySlotsFromIntra, SupplySlotsFromIntra1to1
SupplySlotsTo, SupplySlotsTo1to1
SupplySlotsToIntra, SupplySlotsToIntra1to1
TableInterpolation
TableInterpolation3D
TableLookup
TableLookupDefaultTol
TargetHWGivenInflow
TargetSlopeHWGivenInflow
TextSlotNumericToString
ToCelsius, ToFahrenheit, ToKelvin
VolumeToFlow
WaterOwners
WaterTypes
WeightedSum
Hypothetical Simulations
Hypothetical Simulation Overview
Hypothetical Simulation Functions
Hypothetical Simulation Process
Technical Documentation Version 9.3
Hypothetical Simulations
HID_Abs
HID_AccountAttributes
HID_AccountNameFromPriorityDate
HID_AccountNamesByAccountType
HID_AccountNamesByWaterOwner
HID_AccountNamesByWaterType
HID_AccountNamesFromObjReleaseDestination
HID_AccountNamesFromObjReleaseDestinationIntra
HID_AccountNamesFromPriorityDate
HID_AccountPriorityDate
HID_AggregateSeriesSlot
HID_AnnualEventCount
HID_AnnualEventLastOccurrence
HID_AnnualEventStats
HID_AvgObjectsAggregatedOverTime
HID_AvgObjectsAtEachTimestep
HID_AvgTimestepsAggregatedOverObjects
HID_AvgTimestepsForEachObject
HID_Ceiling
HID_ColumnLabel
HID_ColumnLabels
HID_CompletePartialDate
HID_ComputeReservoirDiversions
HID_DateMax
HID_DateMin
HID_DatesInPeriod
HID_DateToNumber
HID_Destinations
HID_DestinationsFromObjectReleaseType
HID_DispatchCount
HID_DispatchEndDate
HID_DispatchTime
HID_Div
HID_ElevationToArea
HID_ElevationToAreaAtDate
HID_ElevationToMaxRegulatedSpill
HID_ElevationToStorage
HID_ElevationToStorageAtDate
HID_ElevationToUnregulatedSpill
HID_Exp
HID_FilterByObjType
HID_FlattenList
HID_FloodControl
HID_Floor
HID_FlowToVolume
HID_Fraction
HID_Get3DTableVals
HID_Get3DTableValsSkipNaN
HID_GetAccountFromSlot
HID_GetAllNamedBasins
HID_GetColMapVal
HID_GetColumnIndex
HID_GetDate
HID_GetDates
HID_GetDatesCentered
HID_GetDayOfMonth
HID_GetDayOfYear
HID_GetDaysInMonth
HID_GetDisplayVal
HID_GetDisplayValByCol
HID_GetElementName
HID_GetEnsembleTraceValue
HID_GetEnsembleValue
HID_GetEnsembleSeriesValue
HID_GetJulianDate
HID_GetLinkedObjs
HID_GetLowerBound
HID_GetLowerBoundByCol
HID_GetMaxOutflowGivenHW
HID_GetMaxOutflowGivenInflow
HID_GetMaxOutflowGivenStorage
HID_GetMaxReleaseGivenInflow
HID_GetMinSpillGivenInflowRelease
HID_GetMonth
HID_GetMonthAsString
HID_GetNumbers
HID_GetObject
HID_GetObjectDebt
HID_GetObjectFromSlot
HID_GetPaybackDebt
HID_GetRowIndex
HID_GetRowIndexByDate
HID_GetRunCycleIndex
HID_GetRunIndex
HID_GetSelectedUserMethod
HID_GetSeriesSlots
HID_GetSlot
HID_GetSlotName
HID_GetSlotNameAndCol
HID_GetSlotVals
HID_GetSlotValsNaNToZero
HID_GetSlotValsByCol
HID_GetSlotValsByColNaNToZero
HID_GetTableColumnVals
HID_GetTableColumnValsSkipNaN
HID_GetTableRowVals
HID_GetTableRowValsSkipNaN
HID_GetTextSlotValueAsString
HID_GetTimestep
HID_GetTraceNumber
HID_GetUpperBound
HID_GetUpperBoundByCol
HID_GetYear
HID_GetYearAsString
HID_HasFlag
HID_HasRuleFiredSuccessfully
HID_HydropowerRelease
HID_HypLimitSim
HID_HypLimitSimWithStatus
HID_HypSim
HID_HypTargetSim
HID_HypTargetSimWithStatus
HID_IntegerToString
HID_IntegerWithUnitsToString
HID_IsControllerOpt
HID_IsControllerRBS
HID_IsControllerSim
HID_IsEven
HID_IsInput
HID_IsOdd
HID_LeapYear
HID_ListDownstreamObjects
HID_ListSlotSet
HID_ListSubbasin
HID_Ln
HID_Log
HID_Max
HID_MaxByIndex
HID_MaxItem
HID_MaxObjectsAggregatedOverTime
HID_MaxObjectsAtEachTimestep
HID_MaxTimestepsAggregatedOverObjects
HID_MaxTimestepsForEachObject
HID_MeetLowFlowRequirement
HID_MemoryUsage
HID_Min
HID_MinByIndex
HID_MinItem
HID_MinObjectsAggregatedOverTime
HID_MinObjectsAtEachTimestep
HID_MinTimestepsAggregatedOverObjects
HID_MinTimestepsForEachObject
HID_Mod
HID_NetNonShortDiversionRequirement
HID_NetSubbasinDiversionRequirement
HID_NextDate
HID_NumberToDate
HID_NumberToYear
HID_NumColumns
HID_NumRows
HID_ObjAcctSupplyByWaterTypeRelTypeDestType
HID_ObjectAttributeValue
HID_ObjectHasAttributeValue
HID_ObjectiveValue
HID_ObjectsFromAccountName
HID_ObjectsFromAttributeValue
HID_ObjectsFromWaterType
HID_OffsetDate
HID_OperatingHeadToMaxRelease
HID_OptDualPrice
HID_OptReducedCost
HID_OptReducedCostByCol
HID_OptValue
HID_OptValueByCol
HID_OptValuePiecewise
HID_Percentile
HID_PercentRank
HID_PreviousDate
HID_RanDev
HID_Random
HID_RandomNormal
HID_ReleaseTypes
HID_ReleaseTypesFromObject
HID_ResetRanDev
HID_Reverse
HID_RoundToFactor
HID_RowLabel
HID_RowLabels
HID_RunStartDate
HID_RunEndDate
HID_RunTime
HID_SlotCacheValue
HID_SlotCacheValueByCol
HID_SlotWeightedAverageOverTime
HID_SolveInflow
HID_SolveMonthlyOutflowAnnualTimestep
HID_SolveMonthlyStorageAnnualTimestep
HID_SolveOutflow
HID_SolveOutflowGivenEnergyInflow
HID_SolveShortage
HID_SolveSlopeStorageGivenInflowHW
HID_SolveSlopeStorageGivenInflowOutflow
HID_SolveStorage
HID_SolveSubbasinDiversions
HID_SolveTurbineRelGivenEnergyInflow
HID_SolveWaterRights
HID_SolveWaterRightsWithLags
HID_Sort
HID_SortPairsAscending
HID_SortPairsDescending
HID_SourceAccountAndObject
HID_Split
HID_StorageToArea
HID_StorageToAreaAtDate
HID_StorageToElevation
HID_StorageToElevationAtDate
HID_StringToTextSlotNumeric
HID_Sum
HID_SumAccountSlotsByWaterType
HID_SumByIndex
HID_SumFlowsToVolume
HID_SumFlowsToVolumeSkipNaN
HID_SumFlowsToVolumeByCol
HID_SumFlowsToVolumeByColSkipNaN
HID_SumObjectsAggregatedOverTime
HID_SumObjectsAtEachTimestep
HID_SumSlot
HID_SumSlotSkipNaN
HID_SumSlotByCol
HID_SumSlotByColSkipNaN
HID_SumTableColumn
HID_SumTableRow
HID_SumTimestepsAggregatedOverObjects
HID_SumTimestepsForEachObject
HID_SupplyAttributes
HID_SupplyNamesFrom
HID_SupplyNamesFrom1to1
HID_SupplyNamesFromIntra
HID_SupplyNamesFromIntra1to1
HID_SupplyNamesTo
HID_SupplyNamesTo1to1
HID_SupplyNamesToIntra
HID_SupplyNamesToIntra1to1
HID_SupplySlotsFrom
HID_SupplySlotsFrom1to1
HID_SupplySlotsFromIntra
HID_SupplySlotsFromIntra1to1
HID_SupplySlotsTo
HID_SupplySlotsTo1to1
HID_SupplySlotsToIntra
HID_SupplySlotsToIntra1to1
HID_TableInterpolation
HID_TableInterpolation3D
HID_TableLookup
HID_TableLookupDefaultTol
HID_TargetHWGivenInflow
HID_TargetSlopeHWGivenInflow
HID_TextSlotNumericToString
HID_ToCelsius
HID_ToFahrenheit
HID_ToKelvin
HID_VolumeToFlow
HID_WaterOwners
HID_WaterTypes
HID_WeightedSum