Package hec.rss.model

Class WaterAccount

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

public class WaterAccount extends RssTSLocationObject implements Cloneable, AsciiSerializable
The Class WaterAccount.
See Also:
  • Field Details

  • Constructor Details

    • WaterAccount

      public WaterAccount()
      Instantiates a new water account.
    • WaterAccount

      public WaterAccount(String name, String description, int setIndex, int waIndex)
      Instantiates a new water account.
      Parameters:
      name - the name
      description - the description
      setIndex - the set index
      waIndex - the wa index
  • Method Details

    • getIndex

      public int getIndex()
      Description copied from class: NamedType
      Return the index of the NamedType as an int.
      Overrides:
      getIndex in class NamedType
    • setDefaultFlag

      public void setDefaultFlag(boolean defaultFlag)
      Sets the default flag.
    • getDefaultFlag

      public boolean getDefaultFlag()
      Gets the default flag.
    • getWaterAccountSetIndex

      public int getWaterAccountSetIndex()
      Gets the water account set index.
      Returns:
      the water account set index
    • setReservoir

      public void setReservoir(ReservoirElement res)
      Sets the reservoir.
      Parameters:
      res - the res
    • setReservoirs

      public void setReservoirs(ReservoirElement res, RunTimeStep rts)
    • setReservoir

      public void setReservoir(ReservoirElement res, RunTimeStep rts)
      Sets the reservoir.
      Parameters:
      res - the res
      rts - the rts
    • getReservoir

      public ReservoirElement getReservoir()
      Gets the reservoir.
      Returns:
      the reservoir
    • setStorageZone

      public void setStorageZone()
      Sets the storage zone.
    • getStorageZone

      public StorageZone getStorageZone()
      Gets the storage zone.
      Returns:
      the storage zone
    • setLowerStorageLimit

      public void setLowerStorageLimit(RunTimeStep rts)
      Sets the lower storage limit.
      Parameters:
      rts - the new lower storage limit
    • getLowerStorageLimit

      public double getLowerStorageLimit()
      Gets the lower storage limit.
      Returns:
      the lower storage limit
    • initialize

      public void initialize()
      Initialize.
    • isInitialized

      public boolean isInitialized()
    • initializeDefault

      public void initializeDefault()
      Initialize default account.
    • getHindcastDataList

      public Vector getHindcastDataList(Vector hvec)
      Gets the hindcast data list.
      Parameters:
      hvec - the hvec
      Returns:
      the hindcast data list
    • initializeRules

      public boolean initializeRules(RssSystem system)
      Initialize rules.
      Parameters:
      system - the system
      Returns:
      true, if successful
    • isFull

      public boolean isFull()
      Checks if is full.
      Returns:
      true, if is full
    • isEmpty

      public boolean isEmpty()
      Checks if is empty.
      Returns:
      true, if is empty
    • getExcessInflowVol

      public double getExcessInflowVol()
      Gets the excess inflow vol.
      Returns:
      the excess inflow vol
    • allAccountsFull

      public boolean allAccountsFull()
      Returns whether all water accts associated with a res are full.
    • allAccountsEmpty

      public boolean allAccountsEmpty()
      Returns whether all water accts associated with a res are empty.
    • setExcessInflowVol

      public void setExcessInflowVol(double excessInflowVol)
      Sets the excess inflow vol.
      Parameters:
      excessInflowVol - the new excess inflow vol
    • toString

      public String toString()
      Overrides:
      toString in class NamedType
    • initEvalControllerDecision

      public int initEvalControllerDecision(RunTimeStep rts, ReservoirElement res)
      Initializes start of ReservoirOp.evalControllerDecision rule stack loop Performed only on the default water account
    • updateCharges

      public void updateCharges(RunTimeStep rts, double gcOpDemand)
    • updateLosses

      public void updateLosses(RunTimeStep rts, double leakage)
    • initializeWADemands

      public void initializeWADemands(RunTimeStep rts)
    • getAvailableVolume

      public double getAvailableVolume(RunTimeStep rts)
    • evalConvergence

      public boolean evalConvergence(int iter, boolean gcOpChange)
    • updateCurrentVolume

      public void updateCurrentVolume(RunTimeStep rts)
    • updateWAStates

      public void updateWAStates(RunTimeStep rts)
    • redistributeInflow

      public void redistributeInflow(RunTimeStep rts)
    • sumWADemands

      public double sumWADemands(RunTimeStep rts, double physicalLimits)
    • updateVolumes

      public void updateVolumes(RunTimeStep rts)
    • updatePumpbackDestinationOnlyDefault

      public void updatePumpbackDestinationOnlyDefault(RunTimeStep rts, double pumpbackFlow)
    • updatePumpbackDestinationAllAccounts

      public void updatePumpbackDestinationAllAccounts(RunTimeStep rts, double pumpbackFlow)
    • updatePumpbackSource

      public void updatePumpbackSource(RunTimeStep rts, double pumpbackFlow)
    • sumResExcessInflowVol

      public void sumResExcessInflowVol()
      Sum all water account excess inflow volumes for a reservoir (default acct only)
    • getCurrentInflow

      public double getCurrentInflow(RunTimeStep rts)
    • setCurrentInflow

      public void setCurrentInflow(RunTimeStep rts, double inflow)
    • getPrevVolume

      public double getPrevVolume(RunTimeStep rts)
    • getCurrentVolume

      public double getCurrentVolume(RunTimeStep rts)
    • setCurrentVolume

      public void setCurrentVolume(RunTimeStep rts, double currentVol)
    • setDemand

      public void setDemand(RunTimeStep rts, double demand)
    • getDemand

      public double getDemand(RunTimeStep rts)
    • getRuleDemand

      public double getRuleDemand(RunTimeStep rts)
    • setRuleDemand

      public void setRuleDemand(RunTimeStep rts, double demand)
    • setMaxVolTS

      public void setMaxVolTS(RunTimeStep rts, double maxStor)
    • getMaxVolTS

      public double getMaxVolTS(RunTimeStep rts)
    • setSurplus

      public void setSurplus(RunTimeStep rts, double surplus)
    • getSurplus

      public double getSurplus(RunTimeStep rts)
    • setTransfers

      public void setTransfers(RunTimeStep rts, double transfers)
    • getTransfers

      public double getTransfers(RunTimeStep rts)
    • setCredit

      public void setCredit(RunTimeStep rts, double credit)
    • getCredit

      public double getCredit(RunTimeStep rts)
    • setLosses

      public void setLosses(RunTimeStep rts, double losses)
    • getLosses

      public double getLosses(RunTimeStep rts)
    • setCharges

      public void setCharges(RunTimeStep rts, double charges)
    • getCharges

      public double getCharges(RunTimeStep rts)
    • setPumpback

      public void setPumpback(RunTimeStep rts, double pb)
    • getPumpback

      public double getPumpback(RunTimeStep rts)
    • incrementTransfers

      public void incrementTransfers(RunTimeStep rts, double extraTransfers)
    • incrementSurplus

      public void incrementSurplus(RunTimeStep rts, double extraSurplus)
    • getTotalInflow

      public double getTotalInflow(RunTimeStep rts)
    • setUsePercentOfCon

      public void setUsePercentOfCon(boolean usePercentOfCon)
      Sets the use percent of con.
      Parameters:
      usePercentOfCon - the new use percent of con
    • usePercentOfCon

      public boolean usePercentOfCon()
      Use percent of con.
      Returns:
      true, if successful
    • setPercentOfCon

      public void setPercentOfCon(double percentOfCon)
      Sets the percent of con.
      Parameters:
      percentOfCon - the new percent of con
    • getPercentOfCon

      public double getPercentOfCon()
      Gets the percent of con.
      Returns:
      the percent of con
    • setMaxStorage

      public void setMaxStorage(double maxStorage)
      Sets the max storage.
      Parameters:
      maxStorage - the new max storage
    • getMaxStorage

      public double getMaxStorage()
      Gets the max storage.
      Returns:
      the max storage
    • setRuleRefs

      public void setRuleRefs(List<YieldAnalysisRuleRef> ruleRefs)
      Sets the rule refs.
      Parameters:
      ruleRefs - the new rule refs
    • getRuleRefs

      public List<YieldAnalysisRuleRef> getRuleRefs()
      Gets the rule refs.
      Returns:
      the rule refs
    • setName

      public void setName(String name)
      Sets the name.
      Overrides:
      setName in class NamedType
      Parameters:
      name - the new name
    • getName

      public String getName()
      Gets the name.
      Overrides:
      getName in class NamedType
      Returns:
      the name
    • setDescription

      public void setDescription(String description)
      Sets the description.
      Overrides:
      setDescription in class NamedType
      Parameters:
      description - the new description
    • getDescription

      public String getDescription()
      Gets the description.
      Overrides:
      getDescription in class NamedType
      Returns:
      the description
    • setTotalGCOpDemand

      public void setTotalGCOpDemand(double gcOpDemand)
    • getTotalGCOpDemand

      public double getTotalGCOpDemand()
    • setResExcessInflowVol

      public void setResExcessInflowVol(double excessQinVol)
    • getResExcessInflowVol

      public double getResExcessInflowVol()
    • inflowEvaled

      public boolean inflowEvaled()
    • setAccountFractions

      public int setAccountFractions(RunTimeStep rts)
      Method to set account fractions - should be called only for default water account on reservoir
    • setCurrentFractionOfCon

      public void setCurrentFractionOfCon(double fracOfCon)
    • getCurrentFractionOfCon

      public double getCurrentFractionOfCon()
    • hasYieldAnalysis

      public boolean hasYieldAnalysis()
    • applyHindcastData

      public void applyHindcastData(HindcastData hd)
      Apply hindcast data.
      Parameters:
      hd - the hd
    • getInitialStorage

      public double getInitialStorage()
      Gets the initial storage.
      Returns:
      the initial storage
    • setInitialStorage

      public void setInitialStorage(double s)
      Sets the initial storage.
      Parameters:
      s - the new initial storage
    • usesReservoir

      public boolean usesReservoir(ReservoirElement res)
      Check if water account uses a particular reservoir.
    • computeHindcastStep

      public int computeHindcastStep(RunTimeStep rts)
      Compute hindcast step.
      Parameters:
      rts - the runtime step
      Returns:
      the int
    • computeDefaultWAhindcastStep

      public int computeDefaultWAhindcastStep(RunTimeStep runtime)
      Compute hindcast step for a default water account. User defined hindcast values already defined by the time this method is called.
      Parameters:
      runtime - the runtime
      Returns:
      the int
    • checkUsesRule

      public boolean checkUsesRule(RssSystem sys, List<YieldAnalysisRuleRef> yarrList)
    • getStorageScale

      public double getStorageScale()
    • setStorageScale

      public void setStorageScale(double storScale)
    • setUseStorageScale

      public void setUseStorageScale(boolean useScaling)
    • writeFile

      public boolean writeFile(BufferedWriter writer) throws IOException
      Write file.
      Parameters:
      writer - the writer
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readFile

      public boolean readFile(BufferedReader reader) throws IOException
      Read file.
      Parameters:
      reader - the reader
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • clone

      public Object clone()
      Description copied from class: RssTSLocationObject
      clone method
      Overrides:
      clone in class RssTSLocationObject
    • 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 RssTSLocationObject
      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 RssTSLocationObject
      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
    • getSystem

      public RssSystem getSystem()
      Description copied from class: RssTSLocationObject
      Each subclass must provide a method to return its parent RssSystem
      Specified by:
      getSystem in class RssTSLocationObject
    • setSystem

      public void setSystem(RssSystem sys)
      Sets the system.
      Parameters:
      sys - the new system
    • updateTSProxyList

      public void updateTSProxyList(boolean createYield)
      Update ts proxy list.
      Parameters:
      createYield - the create yield
    • updateTSProxyList

      public void updateTSProxyList()
      Description copied from class: RssTSLocationObject
      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 sub-classes of Function should over-ride this method if they use TSRecordProxies
      Specified by:
      updateTSProxyList in class RssTSLocationObject
    • getActiveTSProxies

      public Vector getActiveTSProxies(Vector vec, int iotype)
      returns a vector of required input, or generated output TSRecordProxies used in the current water account default implementation function, assume all records are active.
      Parameters:
      vec - the vec
      iotype - the iotype
      Returns:
      the active ts proxies
    • getActiveTSProxy

      public TSRecordProxy getActiveTSProxy(int id)