Package hec.rss.model

Class PumpOpRule

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

public class PumpOpRule extends OpRule implements DemandRuleInf

Title: HecJava Development

Description:

Copyright: Copyright (c) 2003

Company:

See Also:
  • Field Details

    • PUMPING_STRATEGY_FULL_CAPACITY

      public static final int PUMPING_STRATEGY_FULL_CAPACITY
      See Also:
    • PUMPING_STRATEGY_FULL_PERIOD

      public static final int PUMPING_STRATEGY_FULL_PERIOD
      See Also:
    • PUMPING_BIAS_BEGINNING_PERIOD

      public static final int PUMPING_BIAS_BEGINNING_PERIOD
      See Also:
    • PUMPING_BIAS_MIDDLE_PERIOD

      public static final int PUMPING_BIAS_MIDDLE_PERIOD
      See Also:
    • PUMPING_BIAS_END_PERIOD

      public static final int PUMPING_BIAS_END_PERIOD
      See Also:
    • TARGET_ELEVATION_CONSTANT

      public static final int TARGET_ELEVATION_CONSTANT
      See Also:
    • TARGET_ELEVATION_STORAGE_ZONE

      public static final int TARGET_ELEVATION_STORAGE_ZONE
      See Also:
    • TARGET_ELEVATION_SEASONALLY

      public static final int TARGET_ELEVATION_SEASONALLY
      See Also:
    • DAILY_PUMPING_OPTION_NIGHTTIME

      public static final int DAILY_PUMPING_OPTION_NIGHTTIME
      See Also:
    • DAILY_PUMPING_OPTION_HOUR_RANGE

      public static final int DAILY_PUMPING_OPTION_HOUR_RANGE
      See Also:
    • MINPUMPING_OPTION_NONE

      public static final int MINPUMPING_OPTION_NONE
      no minimum pumping
      See Also:
    • MINPUMPING_OPTION_ALWAYS

      public static final int MINPUMPING_OPTION_ALWAYS
      always do minimum pumping no matter what
      See Also:
    • MINPUMPING_OPTION_IFPUMP

      public static final int MINPUMPING_OPTION_IFPUMP
      do minimum pumping if any pumping is required
      See Also:
    • MINPUMPING_OPTION_THRESHOLD

      public static final int MINPUMPING_OPTION_THRESHOLD
      only pump if at least the minimum pumping value is needed
      See Also:
  • Constructor Details

    • PumpOpRule

      public PumpOpRule()
    • PumpOpRule

      public PumpOpRule(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
    • setMinPumpHours

      public void setMinPumpHours(double min)
    • getMinPumpHours

      public double getMinPumpHours()
    • setMinPumpOption

      public void setMinPumpOption(int opt)
    • getMinPumpOption

      public int getMinPumpOption()
    • isWholeHourOption

      public boolean isWholeHourOption()
    • setWholeHourOption

      public void setWholeHourOption(boolean b)
    • getActiveTSRecordProxies

      public Vector getActiveTSRecordProxies(Vector vec, int iotype)
      add the time series record proxies associated current compute. subclassses that over-ride this method should also call this method
      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 sub-classes of OpRule may over-ride this method if they use TSRecordProxies but should also call this method
      Overrides:
      updateTSProxyList in class OpRule
    • getMaxPumpVol

      public double getMaxPumpVol(RunTimeStep rts, int istep, int periodSteps)
      calculate the maximum pump volume for the given interval
      Parameters:
      rts - current RunTimeStep
      istep - current step within the generation period
      periodSteps - number of steps in the generation period
      Returns:
      max pumping volume in ac-ft or m^3
    • getMinPumpVol

      public double getMinPumpVol(RunTimeStep rts, int istep, int periodSteps)
    • getSourceReservoirId

      public int getSourceReservoirId()
      return the source reservoir id
      Returns:
    • setSourceReservoirId

      public void setSourceReservoirId(int id)
      set the source reservoir id
      Parameters:
      id -
    • getSourceReservoir

      public ReservoirElement getSourceReservoir()
      return the source reservoir, finding it from the system if necessary. This method may return null if the source reservoir cannnot be found;
      Returns:
    • initPumpbackStep

      public int initPumpbackStep(RunTimeStep rts)
    • initPumpbackRecords

      public int initPumpbackRecords(RunTimeStep rts)
    • computePumpbackStep

      public int computePumpbackStep(RunTimeStep rts)
      performs pumpback operation for the given timestep removing water from the source reservoir and adding it to the parent reservoir. this method is called after the regular compute is complete for the time step
      Parameters:
      rts -
      Returns:
    • getRuleLimitType

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

      public PumpingHourRangeModel getPumpingRangeModel()
    • setPumpingHourRangeModel

      public void setPumpingHourRangeModel(PumpingHourRangeModel model)
    • getSuriseSunsetModel

      public SunriseSunsetModel getSuriseSunsetModel()
    • setSunriseSunsetModel

      public void setSunriseSunsetModel(SunriseSunsetModel model)
    • getPumpingStrategy

      public int getPumpingStrategy()
      Returns the currently set pumping strategy
      Returns:
      the pumping strategy
    • setPumpingStrategy

      public void setPumpingStrategy(int strategy)
      Sets the pumping strategy for this rule to either use full capacity of the pump, or to use the entire pumping period. Valid values are either PUMPING_STRATEGY_FULL_CAPACITY or PUMPING_STRATEG_FULL_PERIOD.
      Parameters:
      strategy -
    • getPumpingBias

      public int getPumpingBias()
      Returns the currently set pumping strategy
      Returns:
      the pumping strategy
    • setPumpingBias

      public void setPumpingBias(int bias)
      Sets the pumping bias for this rule to either be "BEGINNIG", "MIDDLE", or "END" of period.
      Parameters:
      bias -
    • setTargetElevationOption

      public void setTargetElevationOption(int option)
      Sets the target elevation fill option for this rule. The target fill elevation defines the objective for each nights pumping. The options are TARGET_ELEVATION_CONSTANT - A constant elevation value to maintain. TARGET_ELEVATION_SEASONALLY - A table of elevation values to use a certain times of the year. TARGET_ELEVATION_STORAGE_ZONE - Tries to keep the reservoir elevation within a certain storage zone.
      Parameters:
      option -
    • getTargetElevationOption

      public int getTargetElevationOption()
      Returns the option used by this rule to acheive a certain reservoir elevation. The avaiable methods are Seasonally, a constant value, or a storage zone.
      Returns:
    • setConstantTargetElevation

      public void setConstantTargetElevation(double value)
    • getConstantTargetElevation

      public double getConstantTargetElevation()
    • setSeasonalTargetElevation

      public void setSeasonalTargetElevation(SeasonalRecord rec)
    • getSeasonalTargetElevation

      public SeasonalRecord getSeasonalTargetElevation()
    • setStorageZoneTargetElevation

      public void setStorageZoneTargetElevation(OpSet opset, StorageZone sz)
    • getStorageZoneId

      public int getStorageZoneId()
    • getOpSetId

      public int getOpSetId()
    • setDailyPumpingOption

      public void setDailyPumpingOption(int pumpingOption)
    • getDailyPumpingOption

      public int getDailyPumpingOption()
    • getLongitude

      public double getLongitude()
    • setLongitude

      public void setLongitude(double longitude)
    • getLatitude

      public double getLatitude()
    • setLatitude

      public void setLatitude(double lat)
    • getPumpRuleFlow

      public double getPumpRuleFlow(RunTimeStep rts)
    • getTargetElevation

      protected double getTargetElevation(RunTimeStep rts)
      Calculates the reservoir elevation that we want to meet for pumping operations for a current time step. Returns RMAConst.UNDEF_DOUBLE is for some reason there is an error in the calculation.
      Parameters:
      rts - marks the timestep at which to compute the elevation
      Returns:
      elevation.
    • computeHoursLeftInPumpingPeriod

      protected int computeHoursLeftInPumpingPeriod(RunTimeStep rts)
      Returns the number of hours from the current time determined by the run time step until the end of the vaild pumping period.
      Parameters:
      rts -
      Returns:
    • computePumpingWindowHours

      protected int computePumpingWindowHours(RunTimeStep rts)
    • initializeCompute

      public boolean initializeCompute()
      Inintailizes this OpRule for a compute. All arrays and variable that are needed for a compute are allocation and set to some default state.
      Overrides:
      initializeCompute in class OpRule
      Returns:
      true if the initialization was successful otherwise false.
    • initOperationStep

      public int initOperationStep(RunTimeStep rts, int iteration)
      initialization call before each operation step, or before recomputing operations with different options
      Overrides:
      initOperationStep in class OpRule
    • getPump

      protected Pump getPump()
      Returns the Pump that this rule operates for.
      Returns:
    • 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()
      Description copied from interface: DemandRuleInf
      Gets the water account.
      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