Package hec.rss.model

Class DownstreamOpRule

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, DemandRuleInf, AltInputReportInfc, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable
Direct Known Subclasses:
DownstreamCntrlOpRule

public class DownstreamOpRule extends ReleaseFuncOpRule
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 Details

    • FLOW_PARAMETER_STR

      public static final String FLOW_PARAMETER_STR
      See Also:
    • STAGE_PARAMETER_STR

      public static final String 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

      public DownstreamOptions _downstreamOptions
  • Constructor Details

    • DownstreamOpRule

      public DownstreamOpRule()
    • DownstreamOpRule

      public DownstreamOpRule(String name)
  • Method Details

    • evaulatePerformance

      public void evaulatePerformance(RunTimeWindow rtw)
      post processing immediately following compute to evaluate performance
      Overrides:
      evaulatePerformance in class OpRule
      Parameters:
      rtw -
    • closeForecast

      public void closeForecast()
    • getResIntLag

      public int getResIntLag(int ires)
    • evaluateSysLimits

      public void evaluateSysLimits(RunTimeStep rts, int iteration)
      calculates the limiting system value for this rule for the given time step.
      Parameters:
      rts -
    • evaluateSysBalance

      public void evaluateSysBalance(RunTimeStep rts, int iteration)
    • 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

      public TSRecordProxy 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:
      getTargetTSRecordProxy in class ReleaseFuncOpRule
    • getReservoirs

      public List<ReservoirElement> getReservoirs(List<ReservoirElement> resList)
      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

      public Object clone()
      clone this object
      Overrides:
      clone in class ReleaseFuncOpRule
    • usesContingency

      public boolean usesContingency()
      returns true if rule uses downstream contingency
    • useDefaultDSOptions

      public boolean useDefaultDSOptions()
    • setUseDefaultDSOptions

      public void setUseDefaultDSOptions(boolean set)
    • getActiveDownstreamOptions

      public DownstreamOptions getActiveDownstreamOptions()
    • getDownStreamOptions

      public DownstreamOptions getDownStreamOptions()
    • setDownStreamOptions

      public void setDownStreamOptions(DownstreamOptions dsOps)
    • getDefaultDownstreamOptions

      public DownstreamOptions getDefaultDownstreamOptions()
    • setDefaultDownstreamOptions

      public void setDefaultDownstreamOptions(DownstreamOptions dsOp)
    • 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

      public PairedValues getContingencyPV()
      returns the varaible contingency value array
      Returns:
      percentage of rule limit value used for contingency in a PairedValues object
    • setContingencyPV

      public void setContingencyPV(PairedValues pv)
      sets the variable contingency value array
      Parameters:
      pv - PairedValues
    • clearForCompute

      public int clearForCompute(RssSystem sys, RssNode node, DownstreamOp dop)
      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

      public void addChildRule(DownstreamCntrlOpRule child)
      adds a child rule to list if not already in list. called from DownstreamCntrlOpRule.initCompute()
      Parameters:
      child -
    • initialize

      public int initialize(RssSystem sys, RssNode node, DownstreamOp dop, RunTimeWindow rtw)
      initialize the rule for computation, called by the DownstreamOp that holds this rule
      Parameters:
      sys -
      node -
      Returns:
    • initForPostProcessing

      public int initForPostProcessing(RssSystem sys, RssNode node, DownstreamOp dop, RunTimeWindow rtw)
      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

      public void evaluateLimits(RunTimeStep rts, int iteration)
      calculates the limiting value for this rule for the given time step. as of 12/04
      Overrides:
      evaluateLimits in class ReleaseFuncOpRule
      Parameters:
      rts -
      iteration -
    • evaluateLimits32

      public void evaluateLimits32(RunTimeStep rts, int iteration)
    • computeFlowLimit

      public OpValue computeFlowLimit(DownstreamCntrlOpRule dcrule, RunTimeStep rts)
      called by assignReleases to get the limit value for a particular reservoir
      Parameters:
      dcrule -
      rts -
      Returns:
    • computeFlowLimit_old

      @Deprecated public OpValue computeFlowLimit_old(DownstreamCntrlOpRule dcrule, RunTimeStep rts)
      Deprecated.
      called by assignReleases to get the limit value for a particular reservoir
      Parameters:
      dcrule -
      rts -
      Returns:
    • getActiveTSRecordProxies

      public Vector getActiveTSRecordProxies(Vector vec, int iotype)
      add the time series record proxies associated current compute
      Overrides:
      getActiveTSRecordProxies in class ReleaseFuncOpRule
    • 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:
      updateTSProxyList in class ReleaseFuncOpRule
    • getLargestLimitValue

      public double getLargestLimitValue()
      returns the largest downstream flow limit for the any time step
      Overrides:
      getLargestLimitValue in class ReleaseFuncOpRule
      Returns:
    • getLimitValue

      public double getLimitValue(RunTimeStep rts)
      returns the downstream flow limit for the given time step
      Overrides:
      getLimitValue in class ReleaseFuncOpRule
      Parameters:
      rts -
      Returns:
    • copyInto

      public void copyInto(DownstreamOpRule drule)
    • copyChildInto

      public void copyChildInto(DownstreamCntrlOpRule drule)
    • removeRuleRef

      public void removeRuleRef(DownstreamCntrlOpRule rule)
    • 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

      public void getTSRecordProxyVecResVar(Vector proxyList, int varid)
      Get TSRecordProxies for the Reservoir Variable time series managed by each associated child rule
      Parameters:
      proxyList - that will hold the set of TSRecordProxies
      varid - model variable id identifying the TSRecordProxy to retrieve
    • getTSRecordProxyResVar

      public TSRecordProxy getTSRecordProxyResVar(int ires, int varid)
      Get the TSRecordProxy for the Reservoir Variable time series managed by indicated child rule
      Parameters:
      ires - index of the associated reservoir child rule
      varid - model variable id identifying the TSRecordProxy to retrieve
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from class: ReleaseFuncOpRule
      Called just before ascii serialization. Prepares the paired data values by setting there dss record path names
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class ReleaseFuncOpRule
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class ReleaseFuncOpRule
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful
    • getManagedElements

      public List<Element> 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