Package hec.rss.model

Class StorageZone

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, AltInputReportInfc, ZoneObjectParent, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class StorageZone extends NamedType implements Cloneable, ZoneObjectParent, AltInputReportInfc
A portion of a reservoir's storage pool where a particular operating strategy is defined.
See Also:
  • Field Details

  • Constructor Details

    • StorageZone

      public StorageZone()
    • StorageZone

      public StorageZone(String name)
  • Method Details

    • getElementDependencies

      public void getElementDependencies(List<Element> elemList)
      adds elements upon which the zone depends to evaluate the storage zone value to the given list. Does not add the element that owns the storage zone.
    • getReferencedStateVariables

      public void getReferencedStateVariables(List svlist)
      adds all downstream rules to the given vector
    • initializeCompute

      public boolean initializeCompute()
    • getActiveRules

      public List getActiveRules(RunTimeStep rts, List ruleList)
      return the active rules for the given time step
      Parameters:
      rts -
      Returns:
    • getPrimaryRules

      public List getPrimaryRules(List ruleList)
      gets the list of OpRules held directy by zone
    • getRules

      public List<OpRule> getRules(List<OpRule> ruleList)
      gets the unique list of all OpRules used by this zone
    • getZBOpRule

      public ZBOpRule getZBOpRule()
    • getRuleRefs

      public List<OpRuleRef> getRuleRefs(List<OpRuleRef> ruleRefList)
      gets the unique list of all OpRules used by this zone
    • decreaseZoneObjectPriority

      public void decreaseZoneObjectPriority(Object obj)
    • increaseZoneObjectPriority

      public void increaseZoneObjectPriority(Object obj)
    • setZonePriority

      public boolean setZonePriority(Object obj, int index)
      Parameters:
      index -
      userObject -
      Returns:
      true if the object was moved
    • moveZoneObjectToBottomPriority

      public void moveZoneObjectToBottomPriority(Object obj)
    • moveZoneObjectToTopPriority

      public void moveZoneObjectToTopPriority(Object obj)
    • getZoneObjectsList

      public List<ZoneObject> getZoneObjectsList()
      return the zone object list - does not return copy!
      Returns:
      the zone object List
    • addRule

      public OpRuleRef addRule(OpRule rule)
      Add an OpRuleRef to this zone's rule list
      Parameters:
      rule - the rule to reference
      Returns:
      the OpRuleRef
    • removeAllRules

      public void removeAllRules()
    • removeAllIfBlocks

      public void removeAllIfBlocks()
      remove all If Blocks from the StorageZone
    • removeIfBlock

      public void removeIfBlock(ConditionalBlock ifBlock)
      remove the if block from the Zone.
      Parameters:
      ifBlock -
    • removeRule

      public OpRuleRef removeRule(OpRuleRef opruleRef)
      remove the OpRuleRef from the StorageZone
      Parameters:
      opruleRef - the OpRuleRef to remove
      Returns:
      the removed OpRuleRef
    • removeRule

      public OpRuleRef removeRule(OpRule oprule)
      remove the OpRule from the StorageZone
      Parameters:
      oprule - the OpRule to remove
      Returns:
      the removed OpRuleRef
    • getControllerRules

      public List getControllerRules(int controllerId, List ruleList)
      adds all rules used in this operation set to the given List
    • removeControllerRefs

      public void removeControllerRefs(int ctrlId)
    • getConditionalBlockRefs

      public List getConditionalBlockRefs(List clist)
    • getAllRuleRefs

      public List getAllRuleRefs(int controllerIndex, int ruleRefIndex, List refList)
    • removeAllRuleRefs

      public void removeAllRuleRefs(int controllerIndex, int ruleRefIndex)
    • removeAllConditionalBlockRefs

      public void removeAllConditionalBlockRefs(int cbBlockIndex)
    • usesOpRule

      public boolean usesOpRule(OpRule rule, boolean recurse)
      test to see if the given rule is used in the zone rule set. Only recurse through conditional block references if recurse argument is true.
    • addConditionalBlock

      public ConditionalBlockRef addConditionalBlock(ConditionalBlock cblock)
    • removeConditionalBlock

      public ConditionalBlockRef removeConditionalBlock(ConditionalBlock cblock)
    • usesConditionalBlock

      public boolean usesConditionalBlock(ConditionalBlock cblock, boolean recurse)
      test to see if the given conditional block is used in the zone rule set. Only recurse through conditional block references if recurse argument is true.
    • setOpSet

      public void setOpSet(OpSet opset)
    • getOpSet

      public OpSet getOpSet()
    • getFullZoneName

      public String getFullZoneName(StorageZone z)
      returns a fully qualified name for a zone
    • getElementOp

      public ElementOp getElementOp()
      Description copied from interface: ZoneObjectParent
      Gets the ReservoirOp that owns the parent.
      Specified by:
      getElementOp in interface ZoneObjectParent
      Returns:
      the ReservoirOp
    • setOpSetForElevOverride

      public void setOpSetForElevOverride(OpSet opset)
    • setKnownElevTS

      public void setKnownElevTS(doubleArrayContainer ts)
    • setZoneElevTSContainer

      public void setZoneElevTSContainer(doubleArrayContainer ts)
    • setZoneStorTSContainer

      public void setZoneStorTSContainer(doubleArrayContainer ts)
    • setStorageFunction

      public void setStorageFunction(Storage stor)
    • getSystem

      public RssSystem getSystem()
      gets the parent system
      Returns:
      parent's system
    • getReservoirElement

      public ReservoirElement getReservoirElement()
      returns the reservoir element associated with this rule.
      Returns:
      the reservoir element associated with this rule
    • setUnitSysetm

      public void setUnitSysetm(int unitSystem)
    • useMultiYearData

      public void useMultiYearData(boolean useMYearData)
    • isMultiYearData

      public boolean isMultiYearData()
    • useTimeSeries

      public void useTimeSeries(boolean useTimeSeries)
    • isTimeSeries

      public boolean isTimeSeries()
    • setIndependentVariable

      public void setIndependentVariable(IndependentVariable independentVariable)
      sets zone's independent variable to the given independentVariable
      Parameters:
      IndependentVariable - independentVariable
    • getIndependentVariable

      public IndependentVariable getIndependentVariable()
      returns current zone's independent variable
      Returns:
      zone independentVariable
    • setStartYear

      public void setStartYear(int startYear)
    • getStartYear

      public int getStartYear()
    • getUnitSystem

      public int getUnitSystem()
    • toString

      public String toString()
      to string for display in combo boxes
      Overrides:
      toString in class NamedType
    • getInterpolateElev

      public double getInterpolateElev(HecTime htime)
    • getZoneTypeID

      public int getZoneTypeID()
      Returns either StorageZone.ZONE_ELEVATION or StorageZone.ZONE_STORAGE depending which way a zone is defined.
      Returns:
    • setZoneTypeID

      public void setZoneTypeID(int zoneTypeID)
      Sets how the storage zone is defined Storage or Elevation. Valid values are StorageZone.ZONE_ELEVATION or StorageZone.ZONE_STORAGE;
      Parameters:
      zoneType -
    • getElevation

      public double getElevation(RunTimeStep time)
      returns the elevation at a given time step using the seasonal data or time series override
      Parameters:
      time - time step
      Returns:
      elevation value
    • getIndpVarValue

      public double getIndpVarValue(RunTimeStep rts, boolean hasElevTS)
    • getTwoVarValue

      public double getTwoVarValue(IndependentVariable ivRow, IndependentVariable ivCol, RunTimeStep rts, boolean hasElevTS)
      Compute elevation for Two Independent Variable function
      Parameters:
      ivRow - Row IndependentVariable
      ivCol - Column IndependentVariable
      rts -
      hasElevTS -
      Returns:
    • getElevation

      public double getElevation(RunTimeStep time, Hashtable overrideTable)
      returns the elevation at a given time step using the seasonal data or time series override
      Parameters:
      time - time step
      overrideTable - Hashtable with user elevation overrides
      Returns:
      elevation value
    • getFirstValue

      public double getFirstValue()
      gets the first value in the seasonal record
    • getFirstElevation

      public double getFirstElevation()
      gets the first elevation in the seasonal record
    • setUseStorageScale

      public void setUseStorageScale(boolean useStorageScale, ReverseReservoirYieldAnalysis rya)
    • setUseStorageScale

      public void setUseStorageScale(boolean useStorageScale, ReservoirStorageVsYieldAnalysis svya)
    • setStorageScale

      public void setStorageScale(double storageScale)
    • setMobileZoneId

      public void setMobileZoneId(int mobileZoneId)
    • setAbvMobileZone

      public void setAbvMobileZone(boolean abvMobileZone)
    • setProportionScale

      public void setProportionScale(double proportionScale)
    • getReferenceValue

      public double getReferenceValue()
    • setReferenceValue

      public void setReferenceValue(double val)
      sets reference zone value The value is interpreted as elevation or storage depending on the setting of zoneTypeID
      Parameters:
      val - reference value
    • useReferenceValue

      public boolean useReferenceValue()
    • setUseReferenceValue

      public void setUseReferenceValue(boolean use)
    • setConstantValue

      public void setConstantValue(double value)
      set the zone value to a constant
    • useTwoVariableIndependentVariable

      public boolean useTwoVariableIndependentVariable()
    • setUseTwoVariableIndependentVariable

      public void setUseTwoVariableIndependentVariable(boolean use)
    • getTVRowIndependentVariable

      public IndependentVariable getTVRowIndependentVariable()
    • setTVRowIndependentVariable

      public void setTVRowIndependentVariable(IndependentVariable rowIV)
    • getTVColIndependentVariable

      public IndependentVariable getTVColIndependentVariable()
    • setTVColIndependentVariable

      public void setTVColIndependentVariable(IndependentVariable colIV)
    • setUserDefinedValues

      public void setUserDefinedValues(PairedValuesExt userDefinedValues)
    • setUserDefinedValues

      public void setUserDefinedValues(SeasonalRecordExt userDefinedValues)
    • setUserDefinedColumnValues

      public void setUserDefinedColumnValues(String[] columnValues)
    • getUserDefinedPairedValuesExt

      public PairedValuesExt getUserDefinedPairedValuesExt()
    • getUserDefinedSeasonalRecordExt

      public SeasonalRecordExt getUserDefinedSeasonalRecordExt()
    • getUserDefinedColumnValues

      public String[] getUserDefinedColumnValues()
    • hasSeasonalVariation

      public boolean hasSeasonalVariation()
      Returns:
      true if Elevation Function has seasonal variation
    • setSeasonalRecord

      public void setSeasonalRecord(SeasonalRecord sr)
    • setFunctionElevation

      public void setFunctionElevation(SeasonalPairedValues spv)
      Zone Elevation as a function of some parameter value. Can have seasonal variation
      Parameters:
      spv -
    • setFunctionElevation

      public void setFunctionElevation(PairedValuesExt pve)
      Zone Elevation as a function of some parameter value. Can have seasonal variation
      Parameters:
      spv -
    • setFunctionElevation

      public void setFunctionElevation(SeasonalRecordExt sre)
      Zone Elevation as a function of some parameter value. Can have seasonal variation
      Parameters:
      spv -
    • getFunctionElevation

      public Object getFunctionElevation()
    • getSeasonalRecord

      public SeasonalRecord getSeasonalRecord()
      zone is a function of date or date/time
    • clone

      public Object clone() throws CloneNotSupportedException
      Creates a new object of the same class as this object.
      It then initializes each of the new object's fields by assigning it the same value as the corresponding field in this object. No
      constructor is called.
      Overrides:
      clone in class NamedType
      Throws:
      CloneNotSupportedException
    • 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 NamedType
      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 NamedType
      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
    • outputReport

      public void outputReport(AlternativeInputReport report, org.jdom.Element elem)
      Description copied from interface: AltInputReportInfc
      Alternative Input Report Interface for data.
      Specified by:
      outputReport in interface AltInputReportInfc
    • getConditionalBlockRef

      public ConditionalBlockRef getConditionalBlockRef(ConditionalBlock cBlock)
      Parameters:
      cBlock -
    • setRuleDisabled

      public void setRuleDisabled(OpRule oprule, boolean disabled)
      Parameters:
      currentRule -
    • setRuleDisabled

      public void setRuleDisabled(OpRuleRef opruleRef, boolean disabled)
      Parameters:
      currentRuleRef -
    • setIfBlockDisabled

      public void setIfBlockDisabled(ConditionalBlock ifBlock, boolean disabled)
      Parameters:
      disabled -
      currentIfBlock -