Package hec.rss.model

Class YieldAnalysisRuleRef

java.lang.Object
hec.rss.model.YieldAnalysisRuleRef
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, RssModelVariableConstants, RssReturnStatusConstants, Serializable, Cloneable

public class YieldAnalysisRuleRef extends Object implements RssReturnStatusConstants, RssModelVariableConstants, Cloneable, AsciiSerializable
The Class YieldAnalysisRuleRef.
See Also:
  • Field Details

  • Constructor Details

    • YieldAnalysisRuleRef

      public YieldAnalysisRuleRef()
      Default Constructor.
    • YieldAnalysisRuleRef

      public YieldAnalysisRuleRef(RssTSLocationObject rule, Object owner)
      Constructor used by RssAlt.
      Parameters:
      rule - the rule
      owner - the owner
  • Method Details

    • getRule

      public RssTSLocationObject getRule()
      Get the demand rule for the yield analysis.
      Returns:
      either a Rule object (Diversion) or OpRule (all other demands), may return null
    • getRuleOwner

      public Object getRuleOwner()
      Gets the rule owner.
      Returns:
      the rule owner
    • getLocationName

      public String getLocationName()
      Gets the Rule Location Name to be displayed in the tables of rules.
      Returns:
      String name or null
    • getRuleName

      public String getRuleName()
      Gets the Rule Name to be displayed in the tables of rules.
      Returns:
      String name or null
    • getRuleTypeString

      public String getRuleTypeString()
      Gets the Rule Type String to be displayed in the tables of rules.
      Returns:
      String name or null
    • getReservoirList

      public List<ReservoirElement> getReservoirList(RssAlt alt)
      Gets the list of reservoirs that may operate for this rule.
      Parameters:
      alt - the alt
      Returns:
      List of ReservoirElement Objects
    • getReservoirsForDnstrmRule

      public static List<ReservoirElement> getReservoirsForDnstrmRule(RssAlt alt, RssSystem system, DownstreamOpRule dor, List<ReservoirElement> resList)
      Gets the reservoirs for dnstrm rule.
      Parameters:
      alt - the alt
      system - the system
      dor - the dor
      resList - the res list
      Returns:
      the reservoirs for dnstrm rule
    • writeDataToFile

      public void writeDataToFile(BufferedWriter writer)
      writes the persistent data for this object to an ASCII file.
      Parameters:
      writer - the writer
    • readFile

      public void readFile(BufferedReader reader)
      reads the persistent data for this object from an ASCII file and saves it to a string until the rule is needed.
      Parameters:
      reader - the reader
    • isInitialized

      public boolean isInitialized()
      Checks if is initialized.
      Returns:
      true, if is initialized
    • initializeData

      public void initializeData(RssSystem sys)
      Initialize data.
    • initializeDataForCompute

      public void initializeDataForCompute(RssAlt alt)
      Initialize data for compute.
      Parameters:
      alt - the alt
    • getYieldAnalysisRules

      public static List<YieldAnalysisRuleRef> getYieldAnalysisRules(RssAlt alt, RssSystem system, boolean getWaterSupplyRules)
      Get the list of all rules that can be used as a basis for Yield Analysis. These include Downstream minimum flow rules, at site minimum flow rules, at site hydropower, system hydropower, and diversion rules. For first implementation, only Downstream minimum flow rules and at site minimum flow rules are considered!
      Parameters:
      alt - the alt
      system - the system
      getWaterSupplyRules - the get water supply rules
      Returns:
      ArrayList of rules that can be used as a basis for yield analysis analysis
    • getYieldAnalysisRules

      public static List<YieldAnalysisRuleRef> getYieldAnalysisRules(ReservoirElement res, OpSet operationSet)
      Gets the yield analysis rules.
      Parameters:
      res - the res
      operationSet - the operation set
      Returns:
      the yield analysis rules
    • getDefaultWAYieldAnalysisRules

      public static List<YieldAnalysisRuleRef> getDefaultWAYieldAnalysisRules(ReservoirElement res, OpSet operationSet)
      Gets the rules for default water account - includes rules where for which yield analysis not implemented on but need to be referenced and accounted for in the water balance because they influence minimum releases.
      Parameters:
      res - the res
      operationSet - the operation set
      Returns:
      the yield analysis rules
    • getZoneForReservoir

      public StorageZone getZoneForReservoir(ReservoirElement res)
      Gets the zone for reservoir.
      Parameters:
      res - the res
      Returns:
      the zone for reservoir
    • getTolerance

      public double getTolerance()
      Gets the tolerance.
      Returns:
      the tolerance
    • getResTolerance

      public double getResTolerance(int resId)
    • setTolerence

      public void setTolerence(double tol)
      Sets the tolerance.
      Parameters:
      tol - the new tolerance
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setZones

      public void setZones(List<StorageZoneRef> zones)
      Sets the zones.
      Parameters:
      zones - the new zones
    • getZones

      public List<StorageZoneRef> getZones()
      Gets the zones.
      Returns:
      the zones
    • initCompute

      public void initCompute(RssAlt rssAlt)
      Inits the compute.
      Parameters:
      rssAlt - the rss alt
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • rewriteInitString

      public void rewriteInitString()
    • 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
      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
      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