Package hec.rss.model

Class PowerGenerationPatternContainer

java.lang.Object
hec.rss.model.PowerGenerationPatternContainer
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, AltInputReportInfc, Serializable, Cloneable

public class PowerGenerationPatternContainer extends Object implements AsciiSerializable, Cloneable, AltInputReportInfc

Title: Hec Java Development

Description: This is a simple container class that manages and contains a group of individual Power Generation Patterns indexed by date.

Copyright: Copyright (c) 2003

Company:

See Also:
  • Constructor Details

    • PowerGenerationPatternContainer

      public PowerGenerationPatternContainer()
  • Method Details

    • setUseLocalGeneration

      public void setUseLocalGeneration(boolean b)
    • setResIds

      public void setResIds(int[] reservoirIndexArray)
    • setResPatternContainer

      public void setResPatternContainer(Hashtable<Object,PowerGenerationPatternContainer> resPatternTable)
    • fillPatternTSByLocal

      public void fillPatternTSByLocal(RunTimeWindow rtw, double[] tsarray)
    • fillPatternTS

      public void fillPatternTS(RunTimeWindow rtw, double[] tsarray)
      fill the given double array from the pattern
      Parameters:
      rtw -
      tsarray -
    • setPwrGenPattern

      public void setPwrGenPattern(String date, SystemPwrGenerationPattern pattern)
      Sets a specific power generation pattern for a given date. The date is of the form DDMMM. If another SystemPwrGenerationPattern exists for the given date, then that pattern is replaced by the new pattern. NULL input values for either parameter are not acceptable and the method will ingore them.
      Parameters:
      date - the seasonal date to apply the power generation pattern
      pattern - the specific power generation pattern.
    • clearPwrGenPatterns

      public void clearPwrGenPatterns()
    • getPowerGenerationTable

      public Map getPowerGenerationTable()
    • getPwrGenPaternDates

      public String[] getPwrGenPaternDates()
      Returns the set of dates that a power generation pattern is entered for.
      Returns:
    • getPwrGenPatternTimes

      public int[] getPwrGenPatternTimes()
    • getPwrGenPattern

      public SystemPwrGenerationPattern getPwrGenPattern(String key)
      Returns a SystemPwrGenerationPattern that containes the information for a speicific power generation. If no data is found for the given key then NULL data is returned.
      Parameters:
      key - is of the form 01JAN i.e. DDMMM
      Returns:
      the power generation pattern or null if nothing is found.
    • isSystemPwrGenarationPatternSeasonal

      public boolean isSystemPwrGenarationPatternSeasonal()
    • setSystemPwrGenearationPatternSeasonal

      public void setSystemPwrGenearationPatternSeasonal(boolean b)
    • getGenPatternForDay

      public SystemPwrGenerationPattern getGenPatternForDay(HecTime htime)
    • getPatternForDay

      public boolean getPatternForDay(HecTime htime, double[] daypattern)
      fills the given double array with the pattern factors for the given day
      Parameters:
      htime - HecTime representing the day
      daypattern - a double array of size 24
    • computePowerGenPattern

      public double[][] computePowerGenPattern(RunTimeStep rts, double powerReq, int computeType, int startOfWeek, int dayWeekBelongsTo, double maxCap, double overUnderPower, double shouldHaveBeenComputed, int periodToSatisfy, int dayOfPeriodSatisfyStart)
      Computes a power pattern that satisfies the given energy requirement. The pattern can vary as the time changes because the pattern may be sepecified by week, days, or week days/ends.
      Parameters:
      rts - the current time step that gives the current date. Used to find the correct seasonal pattern of the patterns are seasonal. Also, the day is used if the pattern differentiates between days,weeks, or week days/ends.
      enerygReq - the required enery to fullfill.
      int - computeType tells the duration of the energyReq, i.e. that pattern must statisfy the energy req over a month of time. Valid values are PowerGenerationOptions.REQ_SPECIFIED_DAILY,..._WEEKLY,or ..._MONTHLY
      double - maxCap
      Returns:
      a double array
    • computePatternValueForStep

      public double computePatternValueForStep(RunTimeStep rts, int requiredInterval, int period, int startDayOfWeek, double[] patmax, double[] patmin, double totalVol, double remainVol, int ipatStart)
      Computes the required value (energy or flow volume) required by the pattern for the given RunTimeStep. This method returns the energy or volume required over the given time step length (dt).
      Parameters:
      rts -
      Returns:
      an array of two double values representing the energy/flow volume required by the pattern with (array position 0) and without (array position 1) adjustment to compensate for known past and future generation/release.
    • scalePattern

      public static void scalePattern(double[] pattern, double reqval, int istart, int inum, double[] patmax, double[] patmin)
      adjust part of a base pattern to meet a total requirement by the "scaling" method give restrictions of max and min values.
      Parameters:
      pattern -
      istart -
      base -
    • clipPatternToMax

      public static void clipPatternToMax(double[] pattern, double[] patmax, int istart, int inum, double reqval)
      clip the pattern to the given max limit from the given starting index distributing overage filling the rest of the pattern
      Parameters:
      pattern -
      patmax -
      istart -
    • computeAdjustedPattern

      public double[] computeAdjustedPattern(double[] pattern, double targetValue, double preValue, double postValue, int adjustmentType, int istep)
    • getPattern

      public double[] getPattern(RunTimeStep rts, int requiredInterval, int startDayOfWeek)
      develops the specific pattern for the given time step and requirement interval
      Parameters:
      rts - current time step
      requiredInterval - GENERATION_PERIOD_DAILY or GENERATION_PERIOD_WEEKLY
      Returns:
      array of double values, one hour interval unscaled pattern over requirement interval
    • clone

      public Object clone()
      Clone this object
      Overrides:
      clone in class Object
      Returns:
      the clone
    • 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
    • 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