Package hec.rss.model

Class GenerationRequirement

java.lang.Object
hec.rss.model.GenerationRequirement
All Implemented Interfaces:
PowerGenerationOptions

public class GenerationRequirement extends Object implements PowerGenerationOptions
This class contains the logic to compute power generation requirements for ScheduledHydropowerOpRule and SystemHydropowerRule. Transient Objects of this class are instantiated at compute time based on the data stored in the OpRule objects.
  • Constructor Details

    • GenerationRequirement

      public GenerationRequirement(int generationReqVariation, int generationReqSpec, double[] monthlyGenerationReq, int generationPeriod, int startingDay, int startingDayOfPeriod, int dayOfWeekSettingMonth, SeasonalRecord seasonalPowerRequirement, double powerCapacity, RssSystem system)
  • Method Details

    • setRequirementVariation

      public void setRequirementVariation(int var)
      Description copied from interface: PowerGenerationOptions
      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()
      Description copied from interface: PowerGenerationOptions
      Returns the Power Generation required variation.
      Specified by:
      getRequirementVariation in interface PowerGenerationOptions
      Returns:
    • setPowerReqSpecification

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

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

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

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

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

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

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

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

      public void setGenerationPeriod(int period)
      Specified by:
      setGenerationPeriod in interface PowerGenerationOptions
    • getGenerationPeriod

      public int getGenerationPeriod()
      Description copied from interface: PowerGenerationOptions
      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
    • setEnergyRequirementTSRecord

      public void setEnergyRequirementTSRecord(TSRecord inputTSRecord)
    • initEnergyPattern

      public void initEnergyPattern(RunTimeWindow rtw, PowerGenerationPatternContainer patCont, double[] patArray, double[] perReqArray)
      fill the scaled pattern array and period cumulated energy requirement arrays based on the given unscaled pattern
      Parameters:
      rtw -
      patCont -
      patArray -
      perReqArray -
    • bisearch

      protected static int bisearch(int[] xarray, int x, int n)
      bi-sectional search to find index location of x in xarray[]
    • getSpecPeriodSteps

      public List getSpecPeriodSteps(RunTimeWindow rtw)
      get the starting timestep and number of steps in each specification period
      Parameters:
      rtw -
      Returns:
    • getRunTimePeriod

      public RunTimePeriod getRunTimePeriod(RunTimeStep rts)
      return a RunTimePeriod object set up according to the given time step
      Parameters:
      rts -
    • getPeriodSteps

      public int getPeriodSteps(RunTimeStep rts)
      returns the number of time steps in a generation period
      Parameters:
      rts -
      Returns:
    • getStepInPeriod

      public int getStepInPeriod(RunTimeStep rts)
      return the index of the time step within the generation period associated with the given RunTimeStep
      Returns:
    • getLastDayOfMonth

      public static int getLastDayOfMonth(HecTime hecTime)
      return the last day for the calendar month
    • getPeriodEnergyReguirement

      public double getPeriodEnergyReguirement(RunTimeStep rts, double[] powerPatternValues)
      calculate the total energy requirement for generation period containing the give time step
      Parameters:
      rts -
      Returns:
    • computeMonthlyEnergyReqPerWeek

      protected double computeMonthlyEnergyReqPerWeek(RunTimeStep rts)
      calculates the energy that must be generated in one week based on the monthly table and specification options
      Parameters:
      rts -
      Returns:
    • computeSeasonalEnergyReqPerWeek

      protected double computeSeasonalEnergyReqPerWeek(RunTimeStep rts)
      calculates the energy that must be generated in one week based on the seasonal table and specification options
      Parameters:
      rts -
      Returns: