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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic voidclipPatternToMax(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 patternclone()Clone this objectdouble[]computeAdjustedPattern(double[] pattern, double targetValue, double preValue, double postValue, int adjustmentType, int istep) doublecomputePatternValueForStep(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.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.voidfillPatternTS(RunTimeWindow rtw, double[] tsarray) fill the given double array from the patternvoidfillPatternTSByLocal(RunTimeWindow rtw, double[] tsarray) getFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.getGenPatternForDay(HecTime htime) double[]getPattern(RunTimeStep rts, int requiredInterval, int startDayOfWeek) develops the specific pattern for the given time step and requirement intervalbooleangetPatternForDay(HecTime htime, double[] daypattern) fills the given double array with the pattern factors for the given dayString[]Returns the set of dates that a power generation pattern is entered for.getPwrGenPattern(String key) Returns a SystemPwrGenerationPattern that containes the information for a speicific power generation.int[]booleanvoidoutputReport(AlternativeInputReport report, org.jdom.Element elem) Alternative Input Report Interface for data.static voidscalePattern(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.booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetPwrGenPattern(String date, SystemPwrGenerationPattern pattern) Sets a specific power generation pattern for a given date.voidsetResIds(int[] reservoirIndexArray) voidsetResPatternContainer(Hashtable<Object, PowerGenerationPatternContainer> resPatternTable) voidsetSystemPwrGenearationPatternSeasonal(boolean b) voidsetUseLocalGeneration(boolean b)
-
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
-
fillPatternTS
fill the given double array from the pattern- Parameters:
rtw-tsarray-
-
setPwrGenPattern
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 patternpattern- the specific power generation pattern.
-
clearPwrGenPatterns
public void clearPwrGenPatterns() -
getPowerGenerationTable
-
getPwrGenPaternDates
Returns the set of dates that a power generation pattern is entered for.- Returns:
-
getPwrGenPatternTimes
public int[] getPwrGenPatternTimes() -
getPwrGenPattern
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
-
getPatternForDay
fills the given double array with the pattern factors for the given day- Parameters:
htime- HecTime representing the daydaypattern- 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 ..._MONTHLYdouble- 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
develops the specific pattern for the given time step and requirement interval- Parameters:
rts- current time steprequiredInterval- GENERATION_PERIOD_DAILY or GENERATION_PERIOD_WEEKLY- Returns:
- array of double values, one hour interval unscaled pattern over requirement interval
-
clone
Clone this object -
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-
outputReport
Description copied from interface:AltInputReportInfcAlternative Input Report Interface for data.- Specified by:
outputReportin interfaceAltInputReportInfc
-