Package hec.rss.model
Class DownstreamOpRule
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.rss.model.RssTSLocationObject
hec.rss.model.OpRule
hec.rss.model.ReleaseFuncOpRule
hec.rss.model.DownstreamOpRule
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,TSLocation,DemandRuleInf,AltInputReportInfc,RssModelVariableConstants,RssReturnStatusConstants,RssTSLocation,Serializable,Cloneable,Comparable,Observer,rma.lang.Modifiable
- Direct Known Subclasses:
DownstreamCntrlOpRule
Reservoir release as a function of a downstream control limit
notes as of 2007-09
This class is part of the set of classes managing reservoir release constraints
for downstream operation. The set of classes include
DownstreamOp - associated with a downstream location, knows about all the rules that
are used at that downstream location
DownstreamOpRule - a particular operation rule at a downstream location, may be a
min or max limit, may be utilized by more than one reservoir
DownstreamCntrlOpRule - the rule object added to a particular reservoir's operation set,
references a single DownstreamOpRule
Primary Methods
initialize - called by DownstreamOp during compute initialization managed by RssRun
evaluateLimits - called by RssSystem.evaluateSysRuleLimits, primary entry point
for computing release limits
evaluateBaseFlow - called by evaluateLimits to determine base flow at downstream location
determineActiveReservoirs - called by evaluateLimits to identify which reservoirs are
actively operating for this rule during the current time step
evaluateReleases - called by evaluateLimits, this is the where the bulk of the work is
done to determine reservoir releases to meet the downstream operation goal, logic is
dependent on instantaneous verse period average computation
assignReleases - called by evaluateLimits, makes final assignment of rule limits to
individual DownsteamCntrlOpRule objects
clipReleaseToLimits - called by evaluateReleases, constrains the release limit pattern
for a given reservoir by higher priority limits - DEPRECATED
computeFlowLimit - called by assignReleases, figures out final OpValue with flow constraint
for a particular DownstreamCntrlOpRule, does most of the work for assignReleases
getLimitValue - called by evaluateLimits and other classes to get the specific rule limit
value for the referenced time step
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intstatic intstatic final Stringstatic intstatic final StringFields inherited from class hec.rss.model.ReleaseFuncOpRule
_limitType, _patternContainer, DAILY, DEMAND, MAX, MIN, NONE, SPECIFIED, WEEKLYFields inherited from class hec.rss.model.OpRule
_avgPeriod, _enableRiseFallCond, _multiplier, _parameterType, _riseFallCondition, _riseFallTolerance, _system, _timeOfDayMultiplier, _useDayOfWeekMultiplier, _usePeriodAverageLimit, _useTimeOfDayMultiplier, FALLING, FALLING_OR_CONST, INFLOW, POOL_ELEVATION, RISING, RISING_OR_CONST, RULETYPE_DEMAND, RULETYPE_FREE, RULETYPE_MAX, RULETYPE_MIN, RULETYPE_SPECFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENTFields inherited from interface hec.rss.model.RssModelVariableConstants
CUMLOC_OUTPUT_DATA, GRPID_DIVERSION, GRPID_JUNCTION, GRPID_REACH, GRPID_RESERVOIR, HINDCAST_IDS, HOLDOUT_OUTPUT_DATA, INPUT_DATA, OUTPUT_DATA, PULSE_OUTPUT_DATA, UNREG_OUTPUT_DATA, VID_ADJPARAM_FLOW, VID_CAPACITY_FACTOR, VID_CTRLOUT_HINDFLW, VID_CTRLOUT_RELEASE, VID_DAM_LEAK, VID_DAM_RELEASE, VID_DIV_FLOW, VID_DIV_FLOW_ROUTED, VID_DIV_HINDFLW, VID_DIV_RELEASE, VID_DIVOUT_FLOW, VID_DIVOUT_FLOW_ROUTED, VID_ENERGYREQUIRED_TSINPUT, VID_FIRST, VID_FOREBAY_ELEV, VID_FOREBAY_HEADLOSS, VID_GATE_OPENING, VID_GATE_PERCENTOPEN, VID_JUNC_ELEV, VID_JUNC_FLOW_CUMLOC, VID_JUNC_FLOW_DIV, VID_JUNC_FLOW_HOLD, VID_JUNC_FLOW_IN, VID_JUNC_FLOW_LIMIT, VID_JUNC_FLOW_LOCAL, VID_JUNC_FLOW_PULSE, VID_JUNC_FLOW_REG, VID_JUNC_FLOW_UNREG, VID_JUNC_FLOW_VIOL, VID_JUNC_HINDFLOW, VID_JUNC_INFLOW, VID_JUNC_INFLOW_LOCAL_TOTAL, VID_JUNC_STAGE, VID_JUNC_STAGE_LIMIT, VID_JUNC_STAGE_REG, VID_JUNC_STAGE_UNREG, VID_JUNC_STAGE_VIOL, VID_LAST, VID_NODE_FLOW, VID_NODE_HINDFLW, VID_NODE_HINDSTG, VID_NODE_KNOWNFLOW, VID_NODE_STAGE, VID_OPCTRL_CONSTRAINTID, VID_OPCTRL_DECISION, VID_OPCTRL_MAXLIMIT, VID_OPCTRL_MINLIMIT, VID_OPCTRL_RULEID, VID_OPCTRL_ZONEID, VID_OPRULE_FLOW_SPACE, VID_OPRULE_MAX, VID_OPRULE_MAX_STAGE, VID_OPRULE_MIN, VID_OPRULE_MIN_STAGE, VID_OPRULE_PRIORITY, VID_OPRULE_ROUTE_LAG, VID_OPRULE_ROUTE_MAXOFFSET, VID_OPRULE_ROUTE_MINOFFSET, VID_OPRULE_SPEC, VID_OPRULE_STOR_BAL, VID_OPRULE_STOR_BAL_INDEX, VID_OPRULE_VIOL_ELEV, VID_OPRULE_VIOL_FLOW, VID_OPRULE_VIOL_STAGE, VID_OPRULE_VIOL_STOR, VID_OPRULE_WQCD_ELEV, VID_OPRULEFL_CUMLOC, VID_OPRULETS_TSINPUT, VID_OPSET_ACTIVEZONE, VID_OPSET_GC_ELEV, VID_OPSET_GC_STOR, VID_OPSET_KNOWNZONEELEV, VID_OPSET_PROJECTEDELEV, VID_OPSET_ZONEELEV, VID_OPSET_ZONESTOR, VID_OUTGRP_RELEASE, VID_POOL_AREA, VID_POOL_ELEV, VID_POOL_ELEV_EST, VID_POOL_ELEVROC, VID_POOL_EVAP, VID_POOL_FLOWINTOSTOR, VID_POOL_HINDELEV, VID_POOL_HINDSTOR, VID_POOL_HOLDOUT, VID_POOL_INFLOW, VID_POOL_INPUTEVAP, VID_POOL_NETINFLOW, VID_POOL_OUTFLOW, VID_POOL_OUTFLOW_EST, VID_POOL_SEEP, VID_POOL_STOR, VID_PULSE_BACKQ, VID_PULSE_PULSEQ, VID_PUMP_FLOWAVG, VID_PUMP_VOL, VID_PUMPRULE_FLOWAVG, VID_PUMPRULE_FLOWAVG_CAP, VID_PUMPRULE_FLOWINST, VID_PUMPRULE_FLOWINST_CAP, VID_PUMPRULE_HOURS, VID_PUMPRULE_HOURS_CAP, VID_PUMPRULE_NUMPUMP, VID_PUMPRULE_NUMPUMP_CAP, VID_PUMPRULE_UNITHOURS, VID_PUMPRULE_UNITHOURS_CAP, VID_PUMPRULE_VOL, VID_PUMPRULE_VOL_CAP, VID_PWR_CAPABILITY, VID_PWR_EFF, VID_PWR_ENGYGEN, VID_PWR_ENGYPATTERN, VID_PWR_ENGYPERGEN, VID_PWR_ENGYPERREQD, VID_PWR_ENGYREQD, VID_PWR_ENGYVIOL, VID_PWR_FLWPWR, VID_PWR_HDPWR, VID_PWR_HYDLSS, VID_PWR_MAXCAPACITY, VID_PWR_PER_BALGEN, VID_PWR_PER_GCGEN, VID_PWR_PER_MINPUMPGEN, VID_PWR_PER_MINRELGEN, VID_PWR_PER_POWGEN, VID_PWR_PER_PUMPGEN, VID_PWR_PLNTFAC, VID_PWR_PWRCAP, VID_PWR_REQUIRED, VID_PWR_SPILL, VID_PWR_VIOL, VID_RCH_SEEP, VID_REACH_FLOW_CUMLOC, VID_REACH_FLOW_IN, VID_REACH_FLOW_REG, VID_REACH_FLOW_UNREG, VID_RES_GCRELEASE, VID_RES_HOLDOUT, VID_RES_RELEASE, VID_SPILL_FLOW, VID_SPILL_HINDFLOW, VID_STATE_VAR, VID_STATE_VAR_HIND, VID_TAIL_ELEV, VID_UNCTOUT_FLOW, VID_UNCTOUT_HINDFLW, VID_WA_ACCOUNT_DEMAND, VID_WA_ACCOUNT_INFLOW, VID_WA_CHARGES, VID_WA_CREDIT, VID_WA_CURRENT_MAX_VOLUME, VID_WA_CURRENT_VOLUME, VID_WA_HINDSTOR, VID_WA_LOSSES, VID_WA_PUMPBACK, VID_WA_RULE_DEMAND, VID_WA_SURPLUS, VID_WA_TRANSFERS, WQID_OFFSETFields inherited from interface hec.rss.model.RssReturnStatusConstants
RTN_CANCELED, RTN_NOPROBLEM, RTN_OPCHANGE, RTN_PROBLEM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadds a child rule to list if not already in list.intclearForCompute(RssSystem sys, RssNode node, DownstreamOp dop) set system, node, and downstreamOp references and clear child list.clone()clone this objectvoidcomputeFlowLimit(DownstreamCntrlOpRule dcrule, RunTimeStep rts) called by assignReleases to get the limit value for a particular reservoircomputeFlowLimit_old(DownstreamCntrlOpRule dcrule, RunTimeStep rts) Deprecated.voidvoidcopyInto(DownstreamOpRule drule) voidevaluateLimits(RunTimeStep rts, int iteration) calculates the limiting value for this rule for the given time step.voidevaluateLimits32(RunTimeStep rts, int iteration) voidevaluateSysBalance(RunTimeStep rts, int iteration) voidevaluateSysLimits(RunTimeStep rts, int iteration) calculates the limiting system value for this rule for the given time step.voidpost processing immediately following compute to evaluate performancegetActiveTSRecordProxies(Vector vec, int iotype) add the time series record proxies associated current computedoublereturns the constant contingency valuereturns the varaible contingency value arrayintreturns the type of downstream contingencyintreturns the integer _downstreamLocationID, -1 indicates local limit.intdowntream parameter ( flow or stage ) to control reservoir release forgetFieldObject(Field fld) Called just before ascii serialization.doublereturns the largest downstream flow limit for the any time stepdoublegetLimitValue(RunTimeStep rts) returns the downstream flow limit for the given time stepReturn a list of reservoirs whose storage is managed to meet this downstream control rule.intreturns the number of time steps into the future that must be considered when evaluating the release for the current time stepboolean[]getReservoirs(List<ReservoirElement> resList) add the list of reservoirs that operate for this rule to the given list.intgetResIntLag(int ires) returns the TSRecordProxy for the time series that is the target for this rule operation.getTSRecordProxyResVar(int ires, int varid) Get the TSRecordProxy for the Reservoir Variable time series managed by indicated child rulevoidgetTSRecordProxyVecResVar(Vector proxyList, int varid) Get TSRecordProxies for the Reservoir Variable time series managed by each associated child ruleintinitForPostProcessing(RssSystem sys, RssNode node, DownstreamOp dop, RunTimeWindow rtw) Prepares this run for post processing in the ResSim Simulation Module.intinitialize(RssSystem sys, RssNode node, DownstreamOp dop, RunTimeWindow rtw) initialize the rule for computation, called by the DownstreamOp that holds this rulevoidvoidsetContingencyConstant(double d) sets the constant contingency valuevoidsets the variable contingency value arrayvoidsetContingencyType(int itype) sets the downstream contingency typevoidvoidsetDownstreamControlLocationID(int id) sets the _downstreamLocationID, -1 indicates local limit.voidsetDownstreamControlParameter(int param) voidbooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetUseDefaultDSOptions(boolean set) voidsetUsesContingency(boolean b) sets the flag that indicates whether downstream contingency will be used.voidRegenerates the list of all TSProxies required for this location.booleanbooleanreturns true if rule uses downstream contingencyMethods inherited from class hec.rss.model.ReleaseFuncOpRule
evaluateRule, getElementDependencies, getFunctionRelease, getIndependentVariable, getLimitType, getOpValue, getPatternContainer, getPeriod, getReferencedStateVariables, getRequiredTSRecordProxies, getRuleLimitType, getSeasonalRecord, getStartingDay, getTimeInterpolationType, getWaterAccount, initializeCompute, isDnstrmRule, isLocalRule, isPerAvgRule, outputReport, setFunctionRelease, setIndependentVariable, setLimitType, setPatternContainer, setPeriod, setSeasonalRecord, setStartingDay, setTimeInterpolationType, setWaterAccount, updateByDemandScaleMethods inherited from class hec.rss.model.OpRule
applyHindcastData, checkRisingFallingCondition, computeStepLimit, evaluateRule, evaluateRule, getAveragingPeriod, getController, getDayOfWeekFactor, getDemandScale, getEnableRiseFallCondition, getGmtOffset, getKeyStringForObject, getLargestDayOfWeekFactor, getLargestTimeOfDayFactor, getMultiplier, getNetwork, getObjectForKeyString, getOperationsElement, getParameterType, getPowerOpValue, getPriority, getReservoirElement, getRiseFallCondition, getRiseFallTolerance, getRssSystem, getSystem, getTimeOfDayFactor, getTimeOfDayMultiplier, getTSProxyName, getUnitSystem, initForPostProcessing, initOperationStep, isActive, resetChildOwnership, restoreFunctionState, restoreHotstartState, riseFallConditionIsValid, saveFunctionState, saveHotstartState, setAveragingPeriod, setController, setDemandScale, setEnableRiseFallCondition, setMultiplier, setParameterType, setPeriodAverageLimit, setPriority, setRiseFallCondition, setRiseFallTolerance, setSystem, setTimeOfDayMultiplier, setUseDayOfWeekMultiplier, setUseDemandScale, setUsePeriodAverageLimit, setUseTimeOfDayMultiplier, toString, useDayOfWeekMultiplier, useDemandScale, usePeriodAverageLimit, useTimeOfDayMultiplierMethods inherited from class hec.rss.model.RssTSLocationObject
addTSRecord, addTSRecordProxy, addTSRecordProxy, addTSRecordProxy, clearTSProxyList, copyInto, getComputedTSRecordProxies, getTSArray, getTSArray, getTSArray, getTSArray, getTSContainer, getTSContainer, getTSDataSet, getTSRecordProxies, getTSRecordProxy, getTSRecordProxy, getTSRecordProxy, getTSRecordProxy, getTSRecordProxy, getTSRecordProxyVec, removeTSRecord, removeTSRecordProxy, removeTSRecordProxyMethods inherited from class hec.lang.NamedType
addModifiableListener, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
FLOW_PARAMETER_STR
- See Also:
-
STAGE_PARAMETER_STR
- See Also:
-
FLOW_PARAMETER
public static int FLOW_PARAMETER -
STAGE_PARAMETER
public static int STAGE_PARAMETER -
DSCONTINGENCY_CONST
public static int DSCONTINGENCY_CONST -
DSCONTINGENCY_VARIABLE
public static int DSCONTINGENCY_VARIABLE -
_downstreamOptions
-
-
Constructor Details
-
DownstreamOpRule
public DownstreamOpRule() -
DownstreamOpRule
-
-
Method Details
-
evaulatePerformance
post processing immediately following compute to evaluate performance- Overrides:
evaulatePerformancein classOpRule- Parameters:
rtw-
-
closeForecast
public void closeForecast() -
getResIntLag
public int getResIntLag(int ires) -
evaluateSysLimits
calculates the limiting system value for this rule for the given time step.- Parameters:
rts-
-
evaluateSysBalance
-
getNumRouteSteps
public int getNumRouteSteps()returns the number of time steps into the future that must be considered when evaluating the release for the current time step -
getTargetTSRecordProxy
returns the TSRecordProxy for the time series that is the target for this rule operation. Comparison of the target to the rule limit allows determination as to whether the rule was satisfied.- Overrides:
getTargetTSRecordProxyin classReleaseFuncOpRule
-
getReservoirs
add the list of reservoirs that operate for this rule to the given list. if the list is null, a new list is created. must have initialized this rule before calling this method to get correct list of reservoirs. -
getReservoirPassThru
public boolean[] getReservoirPassThru() -
clone
clone this object- Overrides:
clonein classReleaseFuncOpRule
-
usesContingency
public boolean usesContingency()returns true if rule uses downstream contingency -
useDefaultDSOptions
public boolean useDefaultDSOptions() -
setUseDefaultDSOptions
public void setUseDefaultDSOptions(boolean set) -
getActiveDownstreamOptions
-
getDownStreamOptions
-
setDownStreamOptions
-
getDefaultDownstreamOptions
-
setDefaultDownstreamOptions
-
setUsesContingency
public void setUsesContingency(boolean b) sets the flag that indicates whether downstream contingency will be used.- Parameters:
b- boolean flag
-
getContingencyType
public int getContingencyType()returns the type of downstream contingency- Returns:
- DSCONTINGENCY_CONST or DSCONTINGENCY_VARIABLE
-
setContingencyType
public void setContingencyType(int itype) sets the downstream contingency type- Parameters:
itype- either DSCONTINGENCY_CONST or DSCONTINGENCY_VARIABLE
-
getContingencyConstant
public double getContingencyConstant()returns the constant contingency value- Returns:
- percentage of rule limit value used for contingency
-
setContingencyConstant
public void setContingencyConstant(double d) sets the constant contingency value- Parameters:
d- percentage of rule limit value used for contingency
-
getContingencyPV
returns the varaible contingency value array- Returns:
- percentage of rule limit value used for contingency in a PairedValues object
-
setContingencyPV
sets the variable contingency value array- Parameters:
pv- PairedValues
-
clearForCompute
set system, node, and downstreamOp references and clear child list. When child rules initialize for compute the will register with their parent using addChildRule()- Parameters:
sys-node-dop-- Returns:
-
addChildRule
adds a child rule to list if not already in list. called from DownstreamCntrlOpRule.initCompute()- Parameters:
child-
-
initialize
initialize the rule for computation, called by the DownstreamOp that holds this rule- Parameters:
sys-node-- Returns:
-
initForPostProcessing
Prepares this run for post processing in the ResSim Simulation Module. This routing sets up all data model connectivity, but does not load time series arrays.- Returns:
- RTN_NOPROBLEM if successful
-
evaluateLimits
calculates the limiting value for this rule for the given time step. as of 12/04- Overrides:
evaluateLimitsin classReleaseFuncOpRule- Parameters:
rts-iteration-
-
evaluateLimits32
-
computeFlowLimit
called by assignReleases to get the limit value for a particular reservoir- Parameters:
dcrule-rts-- Returns:
-
computeFlowLimit_old
Deprecated.called by assignReleases to get the limit value for a particular reservoir- Parameters:
dcrule-rts-- Returns:
-
getActiveTSRecordProxies
add the time series record proxies associated current compute- Overrides:
getActiveTSRecordProxiesin classReleaseFuncOpRule
-
updateTSProxyList
public void updateTSProxyList()Regenerates the list of all TSProxies required for this location. This list includes all records that are generated by this function even if the records are held in another objects (e.g. RssNode) proxy list- Overrides:
updateTSProxyListin classReleaseFuncOpRule
-
getLargestLimitValue
public double getLargestLimitValue()returns the largest downstream flow limit for the any time step- Overrides:
getLargestLimitValuein classReleaseFuncOpRule- Returns:
-
getLimitValue
returns the downstream flow limit for the given time step- Overrides:
getLimitValuein classReleaseFuncOpRule- Parameters:
rts-- Returns:
-
copyInto
-
copyChildInto
-
removeRuleRef
-
getDownstreamControlParameter
public int getDownstreamControlParameter()downtream parameter ( flow or stage ) to control reservoir release for -
setDownstreamControlParameter
public void setDownstreamControlParameter(int param) -
getDownstreamControlLocationID
public int getDownstreamControlLocationID()returns the integer _downstreamLocationID, -1 indicates local limit. -
setDownstreamControlLocationID
public void setDownstreamControlLocationID(int id) sets the _downstreamLocationID, -1 indicates local limit. -
getTSRecordProxyVecResVar
Get TSRecordProxies for the Reservoir Variable time series managed by each associated child rule- Parameters:
proxyList- that will hold the set of TSRecordProxiesvarid- model variable id identifying the TSRecordProxy to retrieve
-
getTSRecordProxyResVar
Get the TSRecordProxy for the Reservoir Variable time series managed by indicated child rule- Parameters:
ires- index of the associated reservoir child rulevarid- model variable id identifying the TSRecordProxy to retrieve
-
getFieldObject
Description copied from class:ReleaseFuncOpRuleCalled just before ascii serialization. Prepares the paired data values by setting there dss record path names- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classReleaseFuncOpRule- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classReleaseFuncOpRule- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-
getManagedElements
Return a list of reservoirs whose storage is managed to meet this downstream control rule.This method requires that the reservoir array has been initialized as in preparing for computation.
- Returns:
- a new List
-