Package hec.rss.model

Class SystemHydropowerOpRule

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

public class SystemHydropowerOpRule extends OpRule implements PowerGenerationOptions, DemandRuleInf

Title: HecJava Development

Description:

Copyright: Copyright (c) 2003

Company:

See Also:
  • Field Details

  • Constructor Details

    • SystemHydropowerOpRule

      public SystemHydropowerOpRule()
    • SystemHydropowerOpRule

      public SystemHydropowerOpRule(String name)
  • 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.
      Overrides:
      getElementDependencies in class OpRule
    • getParentRule

      public SystemHydropowerRule getParentRule()
    • evaluateLimits

      public void evaluateLimits(RunTimeStep rts, int iteration)
      do nothing
      Overrides:
      evaluateLimits in class OpRule
      Parameters:
      rts - current RunTimeStep
      iteration -
    • setEnergyRequirement

      public void setEnergyRequirement(RunTimeStep rts, double energy)
    • setFlowRequirement

      public void setFlowRequirement(RunTimeStep rts, double flow)
    • getOpValue

      public OpValue getOpValue(RunTimeStep rts)
      returns the operation value based on the previously computed rule limit. As of 12/04
      Overrides:
      getOpValue in class OpRule
      Parameters:
      rts - current RunTimeStep
      Returns:
      OpValue associated with this rule for this time step
    • getPowerOpValue

      public OpValue getPowerOpValue(RunTimeStep rts)
      Returns the required power generation for the given time step Note! if the current reservoir may release flow and not generate power
      Overrides:
      getPowerOpValue in class OpRule
    • getMaxPeriodSteps

      public int getMaxPeriodSteps()
    • useEnergyRequiredTimeSeries

      public boolean useEnergyRequiredTimeSeries()
      Returns true if the parent rule SystemHydropwerRule uses a Time Series provided by the user to define the Energy Required
      Returns:
      boolean true if uses user input time series
    • setUseEnergyRequiredTimeSeries

      public void setUseEnergyRequiredTimeSeries(boolean use)
      Sets the parent SystemHydropwerRule's boolean to use a Time Series provided by the user to define the Energy Required
      Parameters:
      use - boolean
    • getContributeStorageOnly

      public boolean getContributeStorageOnly()
      Returns true if this SystemHydropwerOpRule causes the associated reservoir to make releases for system power but does not contribute any power generation
      Returns:
      boolean true if reservoir contributes storage only
    • getPassThruOnly

      public boolean getPassThruOnly()
    • setContributeStorageOnly

      public void setContributeStorageOnly(boolean use)
      Sets the parent SystemHydropwerRule's boolean to use a Time Series provided by the user to define the Energy Required
      Parameters:
      use - boolean
    • setPassThruOnly

      public void setPassThruOnly(boolean use)
    • isLocalRule

      public boolean isLocalRule()
      returns true if this rule is local to a reservoir
      Overrides:
      isLocalRule in class OpRule
      Returns:
      boolean false because this is not an at site only rule
    • isDnstrmRule

      public boolean isDnstrmRule()
      returns true if this rule is a downstream rule
      Overrides:
      isDnstrmRule in class OpRule
      Returns:
      boolean false because this not a downstream op rule
    • isPerAvgRule

      public boolean isPerAvgRule()
      returns true if this rule uses period average evaluation
      Overrides:
      isPerAvgRule in class OpRule
      Returns:
      boolean true because this rule uses period average evaluation
    • getDailyGenerationPattern

      public int getDailyGenerationPattern()
      Returns a value defining if the power generation pattern is either locally generated or specified. If it is specified then the System Power Generation Pattern data is used.
      Returns:
      integer indicating type of daily generation patter
    • setDailyGenerationPattern

      public void setDailyGenerationPattern(int pattern)
    • initializeCompute

      public boolean initializeCompute()
      prep for compute
      Overrides:
      initializeCompute in class OpRule
    • evaluateRule

      public OpValue evaluateRule(RunTimeStep rts, double initialValue, int iteration, boolean evalDownstream)
      If not performing downstream operation, then this method only registers itself with the system power op as an active rule. When downstream operation is active, then this rule asks the main power rule for its allocation of the power release.
      Overrides:
      evaluateRule in class OpRule
      Parameters:
      rts - the current time step
      initialValue - the value the controller currently will release
      iteration - iteration counter in RssSystem compute
      evalDownstream - flag indicating whether this call includes downstream operation
      Returns:
      the OpValue limit imposed by this rule
    • evaulatePerformance

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

      public int getParentRuleIndex()
      Returns the index of the parent rule i.e. SystemHydropowerRule. If no SystemHydropowerRule has been defined, then RMAConst.UNDEF_INT is returned.
      Returns:
    • setParentRuleIndex

      public void setParentRuleIndex(int index)
    • getReservoirIndexArray

      public int[] getReservoirIndexArray()
      returns a copy of the reservoirIndexArray, adding the reservoir associated with this element if necessary.
      Returns:
      array of reservoir indexes or null.
    • setReservoirIndexArray

      public void setReservoirIndexArray(int[] resIdArray)
      Sets the list if indicies for reservoirs that belong to this system. To clear the list, pass in a null value or an empty array.
      Parameters:
      resIdArray - array of reservoir IDs
    • getStartingDay

      public int getStartingDay()
      Specified by:
      getStartingDay in interface PowerGenerationOptions
    • setStartingDay

      public void setStartingDay(int startDay)
      Specified by:
      setStartingDay in interface PowerGenerationOptions
    • getDayBelongsToTerm

      public int getDayBelongsToTerm()
      Specified by:
      getDayBelongsToTerm in interface PowerGenerationOptions
    • setDayBelongsToTerm

      public void setDayBelongsToTerm(int startDay)
      Specified by:
      setDayBelongsToTerm in interface PowerGenerationOptions
    • getStartDayOfPeriod

      public int getStartDayOfPeriod()
      Specified by:
      getStartDayOfPeriod in interface PowerGenerationOptions
    • setStartDayOfPeriod

      public void setStartDayOfPeriod(int startDay)
      Specified by:
      setStartDayOfPeriod in interface PowerGenerationOptions
    • getGenerationPeriod

      public int getGenerationPeriod()
      Sets the way the model will attempt to meet the gereration requiremnt at period (TIME-STEP, DAILY, WEEKLY). The valid values are GENERATION_PERIOD_DAILY, GENERATION_PERIOD_TIMESTEP, invalid input: '&' GENERATION_PERIOD_WEEKLY. If any other value is passed in, an illegal argument exception is thrown.
      Specified by:
      getGenerationPeriod in interface PowerGenerationOptions
    • setGenerationPeriod

      public void setGenerationPeriod(int period)
      Sets the way the model will attempt to meet the gereration requiremnt at period (TIME-STEP, DAILY, WEEKLY). The valid values are GENERATION_PERIOD_DAILY, GENERATION_PERIOD_TIMESTEP, invalid input: '&' GENERATION_PERIOD_WEEKLY. If any other value is passed in, an illegal argument exception is thrown.
      Specified by:
      setGenerationPeriod in interface PowerGenerationOptions
      Parameters:
      period -
    • getMonthlyPowerRequirement

      public double[] getMonthlyPowerRequirement()
    • setMonthlyPowerRequirement

      public void setMonthlyPowerRequirement(double[] powerReq)
    • getSeasonalPowerRequirement

      public SeasonalRecord getSeasonalPowerRequirement()
    • setSeasonalPowerRequirement

      public void setSeasonalPowerRequirement(SeasonalRecord rec)
    • setRequirementVariation

      public void setRequirementVariation(int var)
      Sets the Power Generation required variation. It is either SEASONAL or MONTHLY. A IllegalArgumentException is thrown if the input value is not recognized.
      Specified by:
      setRequirementVariation in interface PowerGenerationOptions
      Parameters:
      var -
    • getRequirementVariation

      public int getRequirementVariation()
      Returns the Power Generation required variation.
      Specified by:
      getRequirementVariation in interface PowerGenerationOptions
      Returns:
    • getPowerReqSpecification

      public int getPowerReqSpecification()
      Specified by:
      getPowerReqSpecification in interface PowerGenerationOptions
    • setPowerReqSpecification

      public void setPowerReqSpecification(int req)
      Sets a flag to show how the power requirement is specified. The ONLY valid values are plant factor, daily, weekly, monthly, seasonally. Used the defined constants for this class.
      Specified by:
      setPowerReqSpecification in interface PowerGenerationOptions
      Parameters:
      req -
    • setUsePlantFactor

      public void setUsePlantFactor(boolean tf)
      Set true if the monthly energy requirements are to be interpreted as Plant Factor. Set false to interpret monthly values as MWh
    • usePlantFactor

      public boolean usePlantFactor()
      Is true if the monthly energy requirements are to be interpreted as Plant Factor. If false, interpret monthly values as MWh
    • getPowerPatternContainer

      public PowerGenerationPatternContainer getPowerPatternContainer()
    • setPowerPatternContainer

      public void setPowerPatternContainer(PowerGenerationPatternContainer pat)
    • getResPowerPatternContainer

      public PowerGenerationPatternContainer getResPowerPatternContainer(int resid)
    • setResPowerPatternContainer

      public void setResPowerPatternContainer(int resid, PowerGenerationPatternContainer pat)
    • getResPowerPatternTable

      public Hashtable<Object,PowerGenerationPatternContainer> getResPowerPatternTable()
    • copyParentInto

      public void copyParentInto(SystemHydropowerRule hydroRule)
    • useIndependantPowerRequirement

      public boolean useIndependantPowerRequirement()
    • setIndependantPowerRequirement

      public void setIndependantPowerRequirement(boolean b)
    • getRuleLimitType

      public int getRuleLimitType()
      get the limit type of this rule should be implemented by all subclasses of OpRule
      Overrides:
      getRuleLimitType in class OpRule
    • getActiveTSRecordProxies

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

      public void clearTSProxyList()
      Description copied from class: RssTSLocationObject
      dumps all ts proxies
      Overrides:
      clearTSProxyList 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 OpRule
      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 OpRule
      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 OpRule
    • 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
      Overrides:
      outputReport in class OpRule
    • getWaterAccount

      public WaterAccount getWaterAccount()
      Used in Water Accounting
      Specified by:
      getWaterAccount in interface DemandRuleInf
      Returns:
      the water account
    • setWaterAccount

      public void setWaterAccount(WaterAccount wa)
      Description copied from interface: DemandRuleInf
      Sets the water account.
      Specified by:
      setWaterAccount in interface DemandRuleInf
      Parameters:
      wa - the new water account