Package hec.rss.model

Class DiversionRule

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class DiversionRule extends Rule
Provides a more flexible diversion flow rule, similar the the ReleaseFunctionOpRule for reservoir releases. Uses the IndependentVariable. The DiversionRule is edited in the DiversionRulePanel.
See Also:
  • Field Details

  • Constructor Details

    • DiversionRule

      public DiversionRule()
    • DiversionRule

      public DiversionRule(String name)
    • DiversionRule

      @Deprecated public DiversionRule(Controller control)
      Deprecated.
    • DiversionRule

      public DiversionRule(OpController control)
  • Method Details

    • getElementDependencies

      public void getElementDependencies(List elemList)
      adds elements upon which the current rule depends to the given list. Does not add the element that owns this rule.
    • getSeasonalFlowValues

      public SeasonalPairedValues getSeasonalFlowValues()
      Return flow values with seasonal variation
      Returns:
    • setSeasonalFlowValues

      public void setSeasonalFlowValues(SeasonalPairedValues spv)
      Set flow function values having seasonal variation
      Parameters:
      spv -
    • hasSeasonalVariation

      public boolean hasSeasonalVariation()
      Returns:
      true if FlowFunction has seasonal variation
    • setHasSeasonalVariation

      public void setHasSeasonalVariation(boolean tf)
      Set flag for seasonal variation in flow function
    • setFunctionRelease

      public void setFunctionRelease(SeasonalPairedValues spv)
      Diversion flow a function of some parameter value. Can have seasonal variation
      Parameters:
      spv -
    • getFunctionRelease

      public SeasonalPairedValues getFunctionRelease()
    • setFunctionRelease

      public void setFunctionRelease(PairedValues pv)
      Diversion flow a function of some parameter value. No seasonal variation, using PairedValues but store data in a SeasonalPairedValues
      Parameters:
      pv -
    • getSeasonalRecord

      public SeasonalRecord getSeasonalRecord()
      rule is a function of date or date/time
    • setSeasonalRecord

      public void setSeasonalRecord(SeasonalRecord sr)
    • setIndependentVariable

      public void setIndependentVariable(IndependentVariable independentVariable)
    • getIndependentVariable

      public IndependentVariable getIndependentVariable()
    • getReferencedStateVariables

      public void getReferencedStateVariables(List svlist)
      adds StateVariables refereced by this rule to the given list
      Overrides:
      getReferencedStateVariables in class Rule
      Parameters:
      svlist - unique list of state variables
    • setFlowLocation

      public void setFlowLocation(String flowName)
    • getFlowLocation

      public String getFlowLocation()
    • setFlowLocationIndex

      public void setFlowLocationIndex(int id)
    • getFlowLocationIndex

      public int getFlowLocationIndex()
    • initialize

      public boolean initialize()
      Overrides:
      initialize in class Rule
    • initializeCompute

      public boolean initializeCompute()
      prep for compute
      Overrides:
      initializeCompute in class Rule
    • getValue

      public double getValue(AdjustableParameter adjparam, RunTimeStep runtime, double val)
      Description copied from class: Rule
      This method should be overriden
      Specified by:
      getValue in class Rule
    • getLimitValue

      public double getLimitValue(RunTimeStep rts)
    • 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 Rule
    • getActiveTSRecordProxies

      public Vector getActiveTSRecordProxies(Vector vec, int iotype)
      add the time series record proxies associated current compute
      Overrides:
      getActiveTSRecordProxies in class Rule
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class Rule
      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 Rule
      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
    • clone

      public Object clone()
      Description copied from class: RssTSLocationObject
      clone method
      Overrides:
      clone in class RssTSLocationObject