Package hec.rss.model
Class GenerationRequirement
java.lang.Object
hec.rss.model.GenerationRequirement
- All Implemented Interfaces:
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.
-
Field Summary
Fields inherited from interface hec.rss.model.PowerGenerationOptions
GENERATION_PERIOD_DAILY, GENERATION_PERIOD_TIMESTEP, GENERATION_PERIOD_WEEKLY, MONTHLY_VARIATION, REQ_SPECIFIED_DAILY, REQ_SPECIFIED_MONTHLY, REQ_SPECIFIED_PLANT_FACTOR, REQ_SPECIFIED_SEASONALLY, REQ_SPECIFIED_WEEKLY, SEASONAL_VARIATION -
Constructor Summary
ConstructorsConstructorDescriptionGenerationRequirement(int generationReqVariation, int generationReqSpec, double[] monthlyGenerationReq, int generationPeriod, int startingDay, int startingDayOfPeriod, int dayOfWeekSettingMonth, SeasonalRecord seasonalPowerRequirement, double powerCapacity, RssSystem system) -
Method Summary
Modifier and TypeMethodDescriptionprotected static intbisearch(int[] xarray, int x, int n) bi-sectional search to find index location of x in xarray[]protected doublecalculates the energy that must be generated in one week based on the monthly table and specification optionsprotected doublecalculates the energy that must be generated in one week based on the seasonal table and specification optionsintintSets the way the model will attempt to meet the gereration requiremnt at period (TIME-STEP, DAILY, WEEKLY).static intgetLastDayOfMonth(HecTime hecTime) return the last day for the calendar monthdoublegetPeriodEnergyReguirement(RunTimeStep rts, double[] powerPatternValues) calculate the total energy requirement for generation period containing the give time stepintreturns the number of time steps in a generation periodintintReturns the Power Generation required variation.return a RunTimePeriod object set up according to the given time stepget the starting timestep and number of steps in each specification periodintintintreturn the index of the time step within the generation period associated with the given RunTimeStepvoidinitEnergyPattern(RunTimeWindow rtw, PowerGenerationPatternContainer patCont, double[] patArray, double[] perReqArray) fill the scaled pattern array and period cumulated energy requirement arrays based on the given unscaled patternvoidsetDayBelongsToTerm(int startDay) voidsetEnergyRequirementTSRecord(TSRecord inputTSRecord) voidsetGenerationPeriod(int period) voidsetPowerReqSpecification(int req) voidsetRequirementVariation(int var) Sets the Power Generation required variation.voidsetStartDayOfPeriod(int startDay) voidsetStartingDay(int startDay)
-
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:PowerGenerationOptionsSets the Power Generation required variation. It is either SEASONAL or MONTHLY. A IllegalArgumentException is thrown if the input value is not recognized.- Specified by:
setRequirementVariationin interfacePowerGenerationOptions- Parameters:
var-
-
getRequirementVariation
public int getRequirementVariation()Description copied from interface:PowerGenerationOptionsReturns the Power Generation required variation.- Specified by:
getRequirementVariationin interfacePowerGenerationOptions- Returns:
-
setPowerReqSpecification
public void setPowerReqSpecification(int req) - Specified by:
setPowerReqSpecificationin interfacePowerGenerationOptions
-
getPowerReqSpecification
public int getPowerReqSpecification()- Specified by:
getPowerReqSpecificationin interfacePowerGenerationOptions
-
setStartingDay
public void setStartingDay(int startDay) - Specified by:
setStartingDayin interfacePowerGenerationOptions
-
getStartingDay
public int getStartingDay()- Specified by:
getStartingDayin interfacePowerGenerationOptions
-
setDayBelongsToTerm
public void setDayBelongsToTerm(int startDay) - Specified by:
setDayBelongsToTermin interfacePowerGenerationOptions
-
getDayBelongsToTerm
public int getDayBelongsToTerm()- Specified by:
getDayBelongsToTermin interfacePowerGenerationOptions
-
setStartDayOfPeriod
public void setStartDayOfPeriod(int startDay) - Specified by:
setStartDayOfPeriodin interfacePowerGenerationOptions
-
getStartDayOfPeriod
public int getStartDayOfPeriod()- Specified by:
getStartDayOfPeriodin interfacePowerGenerationOptions
-
setGenerationPeriod
public void setGenerationPeriod(int period) - Specified by:
setGenerationPeriodin interfacePowerGenerationOptions
-
getGenerationPeriod
public int getGenerationPeriod()Description copied from interface:PowerGenerationOptionsSets 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:
getGenerationPeriodin interfacePowerGenerationOptions
-
setEnergyRequirementTSRecord
-
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
get the starting timestep and number of steps in each specification period- Parameters:
rtw-- Returns:
-
getRunTimePeriod
return a RunTimePeriod object set up according to the given time step- Parameters:
rts-
-
getPeriodSteps
returns the number of time steps in a generation period- Parameters:
rts-- Returns:
-
getStepInPeriod
return the index of the time step within the generation period associated with the given RunTimeStep- Returns:
-
getLastDayOfMonth
return the last day for the calendar month -
getPeriodEnergyReguirement
calculate the total energy requirement for generation period containing the give time step- Parameters:
rts-- Returns:
-
computeMonthlyEnergyReqPerWeek
calculates the energy that must be generated in one week based on the monthly table and specification options- Parameters:
rts-- Returns:
-
computeSeasonalEnergyReqPerWeek
calculates the energy that must be generated in one week based on the seasonal table and specification options- Parameters:
rts-- Returns:
-