Package hec.rss.model

Class OpSet

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

public class OpSet extends RssTSLocationObject implements AltInputReportInfc
Contains one complete operating strategy for a reservoir.
See Also:
  • Field Details

  • Constructor Details

    • OpSet

      public OpSet()
    • OpSet

      public OpSet(String name)
    • OpSet

      public OpSet(ElementOp resop, String name)
  • Method Details

    • getReleaseAllocationObject

      public ReleaseAllocationObject getReleaseAllocationObject()
    • setReleaseAllocationObject

      public void setReleaseAllocationObject(ReleaseAllocationObject rao)
      Sets the current release allocationObject. by setting to NULL, the Default Release Allocation Object will be used.
      Parameters:
      rao -
    • getMaxNumROCSteps

      public int getMaxNumROCSteps(RunTimeWindow rtw, double limitVal, int limitType)
    • getReleaseAllocation

      public ReleaseAllocation getReleaseAllocation(String releaseAllocationSetName, OpController opCont)
      Retrieves a ReleaseAllocation object for a given OpController. Returns null if there is no ReleaseAllocation for the given controller
      Parameters:
      opCont -
      Returns:
    • addReleaseAllocation

      public void addReleaseAllocation(ReleaseAllocationSet ras)
      Adds a release allocation to the list of release allocations owned by this OpSet. NULL Values will cause a IllegalArguementException to be thrown.
      Parameters:
      ras -
    • addReleaseAllocationConditional

      public boolean addReleaseAllocationConditional(ConditionalBlock conditionalBlock)
      add a release allocation conditional block
      Parameters:
      conditionalBlock - a new release allocation conditional block
      Returns:
      true if the conditional block was added
    • getDefaultReleaseAllocationSet

      public ReleaseAllocationSet getDefaultReleaseAllocationSet()
    • getReleaseAllocationSets

      public List<ReleaseAllocationSet> getReleaseAllocationSets()
    • getReleaseAllocationConditionals

      public List<ConditionalBlock> getReleaseAllocationConditionals()
      get the release allocation conditional blocks
      Returns:
      release allocation conditional blocks
    • addConditionalBlock

      public void addConditionalBlock(ConditionalBlock cb)
    • deleteReleaseAllocationSet

      public void deleteReleaseAllocationSet(ReleaseAllocationSet ras)
      Deletes the release allocation set from the list of release allocation sets. If successful, it will remove all release allocations associated with that set.
      Parameters:
      ras -
    • removeReleaseAllocationSet

      public void removeReleaseAllocationSet(ReleaseAllocationSet ras)
      Removes the release allocation set from the list of release allocation sets.
      Parameters:
      ras -
    • deleteReleaseAllocationSetIfBlock

      public void deleteReleaseAllocationSetIfBlock(ConditionalBlock ifRas)
      Deletes the if block release allocation set from the list of release allocation sets. If successful, it will remove all release allocations associated with that if block.
      Parameters:
      ifRas -
    • getReleaseAllocationSet

      public ReleaseAllocationSet getReleaseAllocationSet(String name)
      Returns a release allocation set with the same name as the provided name. NULL is returned if no existing release allocation exists with the given name.
      Parameters:
      name -
      Returns:
    • getReleaseAllocation

      public ReleaseAllocation getReleaseAllocation(String releaseAllocationSetName, int opControllerId)
      Retrieves a ReleaseAllocation object for a given OpController index. Returns the default Balanced release allocation if there is no ReleaseAllocation for the given index
      Parameters:
      opControllerId -
      Returns:
    • deleteReleaseAllocation

      public void deleteReleaseAllocation(OpController opCont)
      Deletes the release allocation for a given OpController
      Parameters:
      opCont -
    • deleteReleaseAllocation

      public void deleteReleaseAllocation(int opControllerId)
      Deletes the release allocation for a given OpController index
      Parameters:
      opControllerId -
    • setReleaseAllocation

      public void setReleaseAllocation(OpController opCont, ReleaseAllocation ra)
      Saves a release allocation for a given OpController. A null release allocation is a valid value and null will be returned in the retrieve.
      Parameters:
      opCont -
      ra -
    • setReleaseAllocation

      public void setReleaseAllocation(int opControllerId, ReleaseAllocation ra)
    • getStorageZones

      public List<StorageZone> getStorageZones(List<StorageZone> zoneList)
      gets the list of StorageZones used by this operation set
    • getRules

      public List<OpRule> getRules(List<OpRule> rulevec)
      gets the unique list of OpRules used by this operation set
    • getEnabledRules

      public List<OpRule> getEnabledRules(List<OpRule> ruleList)
    • getConditionals

      public List<ConditionalBlockRef> getConditionals(List<ConditionalBlockRef> condVec)
      gets the unique list of Conditionals used by this operation set
    • computeAdjustedZoneElev

      public double computeAdjustedZoneElev(StorageZone zone, RunTimeStep rts, double baseElev)
      Computes the adjusted zone elevation for variable guide curve operation.
      Parameters:
      zone - Storage Zone that will be modified. This implementation only affects the guide curve elevation, although later expansion of the method may also affect other zones.
      rts - current RunTimeStep
      baseElev - zone elevation at current RunTimeStep
      Returns:
    • getGuideCurveZone

      public StorageZone getGuideCurveZone()
      Get the StorageZone that represents the reservoir guide curve
      Returns:
      guide curve zone
    • getFloodZone

      public StorageZone getFloodZone()
    • getInactiveZone

      public StorageZone getInactiveZone()
    • getGuideCurveZoneIndex

      public int getGuideCurveZoneIndex()
      Get the Index of the StorageZone that represents the reservoir guide curve
      Returns:
      guide curve zone index
    • getInactiveZoneIndex

      public int getInactiveZoneIndex()
    • setInactiveZoneIndex

      public void setInactiveZoneIndex(int index)
    • getUseStorageCredit

      public boolean getUseStorageCredit()
      Returns:
      boolean to use storage credit
    • setGuideCurveZoneIndex

      public void setGuideCurveZoneIndex(int id)
      Sets the index of the Storage Zone representing the reservoir guide curve
      Parameters:
      id - guide curve zone index
    • setUseStorgeCredit

      public void setUseStorgeCredit(boolean set)
      Parameters:
      set - boolean for use storage credit
    • getStorageCredit

      public SeasonalPairedValues getStorageCredit()
      Get the set of curves for storage credit vs. available credit. If there is seasonal variation, then there is a curve for each date, with the date contained in the curve label
    • setStorageCredit

      public void setStorageCredit(SeasonalPairedValues storageCredit)
    • getCreditResRefVec

      public Vector getCreditResRefVec()
    • setCreditResRefVec

      public void setCreditResRefVec(Vector vec)
    • getDecisionSchedule

      public DecisionSch getDecisionSchedule()
      Gets the Decision Schedule object owned by this OpSet (not a copy)
      Returns:
      a reference to the _decisionSch object
    • isDecisionStep

      public boolean isDecisionStep(RunTimeStep rts)
      Determines whether the given time step is a decision step
      Parameters:
      rts - time step to test
      Returns:
      true if operating decisions are to be made.
    • getNumDecisionSteps

      public int getNumDecisionSteps(RunTimeStep rts)
      calculates and returns the number of time steps in the current decision interval - assume this method is called when isDecisionStep() has returned true.
      Parameters:
      rts -
      Returns:
    • getMaxNumDecisionSteps

      public int getMaxNumDecisionSteps(int dt)
      get the maximum number time steps in a decision interval
      Parameters:
      dt - time step in second
      Returns:
    • getActiveTSRecordProxies

      public Vector getActiveTSRecordProxies(Vector vec, int iotype)
      add the time series record proxies associated current compute.
      Overrides:
      getActiveTSRecordProxies in class RssTSLocationObject
    • 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
      Specified by:
      updateTSProxyList in class RssTSLocationObject
    • getTSRecordProxyVec

      public Vector getTSRecordProxyVec(int varId, Vector proxyVec)
      override method in RssTSLocationObject to do special handling for Guide Curve time series
      Overrides:
      getTSRecordProxyVec in class RssTSLocationObject
    • getFullZoneName

      public String getFullZoneName(StorageZone z)
      returns a fully qualified name for a zone
    • getSystem

      public RssSystem getSystem()
      Description copied from class: RssTSLocationObject
      Each subclass must provide a method to return its parent RssSystem
      Specified by:
      getSystem in class RssTSLocationObject
    • deleteControllerReferences

      public void deleteControllerReferences(int ctrlId)
      remove all references to a deleted controller
    • getUnitSystem

      public int getUnitSystem()
    • getTopZone

      public StorageZone getTopZone()
      return the top most zone assuming zone list is in ascending order
      Returns:
    • checkZonesAdjacent

      public boolean checkZonesAdjacent(StorageZone sz1, StorageZone sz2)
      Checks whether two storage zones are adjacent to one another Assumes _zoneVec is ordered Used in testing convergence when elevations are oscillating btw zones
    • getActiveZone

      public StorageZone getActiveZone(double elev, RunTimeStep time)
      Computes and save current elevation of all zones and returns the zone that is active for the given reservoir state
    • getControllerRules

      public List getControllerRules(int controllerId, List ruleList)
      adds all rules used in this operation set to the given List
    • getDownstreamRuleNodes

      public void getDownstreamRuleNodes(Hashtable nodetable)
      adds all downstream nodes used as downstream control points to the given vector
    • getDownstreamRules

      public void getDownstreamRules(List ruleVec)
      adds all downstream rules to the given vector
    • getSystemHydropowerOpRules

      public void getSystemHydropowerOpRules(List rList)
      adds all downstream rules to the given vector
    • getReferencedStateVariables

      public void getReferencedStateVariables(List svlist)
      adds all StateVariables refereced by rules or conditional block to the given List
    • hasDownstreamGoals

      public boolean hasDownstreamGoals()
      returns true if any rules referenced in the given opset have downstream operating goals
    • getAllRuleRefs

      public List getAllRuleRefs(int controllerIndex, int ruleRefIndex, List refList)
    • removeAllConditionalBlockRefs

      public void removeAllConditionalBlockRefs(int cbBlockIndex)
    • removeAllRuleRef

      public void removeAllRuleRef(int controllerIndex, int ruleRefIndex)
      removes a rule reference from all zones in this operation set.
    • deleteZone

      public void deleteZone(int index)
      Delete a storage zone and all related rule references
    • setElementOp

      public void setElementOp(ElementOp resop)
      set the reservoirOp
    • getElementOp

      public ElementOp getElementOp()
      get the parent reservoirOp
    • toString

      public String toString()
      over toString to return name - check if ok to move to namedtype
      Overrides:
      toString in class NamedType
    • getZoneVector

      public Vector getZoneVector()
      Get the vector of storage zones
    • initializeCompute

      public boolean initializeCompute(RunTimeWindow rtw)
      prepare for computations
    • setUseStorageScale

      public int setUseStorageScale(boolean b, ReverseReservoirYieldAnalysis rya)
      set the flag to use storage scaling for reverse firm yield analysis
    • setUseStorageScale

      public void setUseStorageScale(boolean b, ReservoirStorageVsYieldAnalysis svya)
      set the flag to use storage scaling for reverse firm yield analysis
    • useStorageScale

      public boolean useStorageScale()
      return flag to use storage scale for reverse firm yield analysis
      Returns:
      flag to use storage scale for reverse firm yield analysis
    • setStorageScale

      public void setStorageScale(double scl, ReverseReservoirYieldAnalysis rya)
      sets the storage scale used for reverse firm yield analysis
    • getStorageScale

      public double getStorageScale()
      gets the storage scale used for reverse firm yield analysis
    • getCapacityOutageOrOverride

      public OpValue getCapacityOutageOrOverride(Element elem, int currentStep, OpValue currentValue)
    • buildCapacityFactorArray

      protected void buildCapacityFactorArray()
    • getSortedZoneVector

      public Vector<StorageZone> getSortedZoneVector()
      returns a vector of zones sorted by first elevation in their seasonal records
    • getSortedZoneVector

      public Vector<StorageZone> getSortedZoneVector(boolean ascending)
      returns a vector of zones sorted by first elevation in their seasonal records
    • getZone

      public StorageZone getZone(int id)
      get an existing storage zone by id
    • getZone

      public StorageZone getZone(String name)
      get an existing storage zone by id
    • useRecursiveModifiedTest

      public boolean useRecursiveModifiedTest()
      Indicates whether object uses recursive modified testing. Should be overrided by subclasses that use recursive testing to return true
      Overrides:
      useRecursiveModifiedTest in class NamedType
    • addNewStorageZone

      public StorageZone addNewStorageZone(String name)
    • setCapacitySchedule

      public void setCapacitySchedule(CapacitySchedule cs)
    • hasUserDefinedReleaseAllocation

      public boolean hasUserDefinedReleaseAllocation()
    • setHasUserDefinedReleaseAllocation

      public void setHasUserDefinedReleaseAllocation(boolean hasEm)
    • hasCapacityOutages

      public boolean hasCapacityOutages()
    • setHasCapacityOutages

      public void setHasCapacityOutages(boolean hasEm)
    • setHasDecisionSchedule

      public void setHasDecisionSchedule(boolean hasDs)
    • hasDecisionSchedule

      public boolean hasDecisionSchedule()
    • hasStorageCredit

      public boolean hasStorageCredit()
    • setHasStorageCredit

      public void setHasStorageCredit(boolean b)
    • getCapacitySchedule

      public CapacitySchedule getCapacitySchedule()
    • clone

      public Object clone()
      Creates a new object of the same class as this object.
      It then initializes each of the new object's fields by assigning it the same value as the corresponding field in this object. No
      constructor is called.
      Overrides:
      clone in class RssTSLocationObject
    • computingProjectedElevation

      public boolean computingProjectedElevation()
    • setComputeProjectedElevation

      public void setComputeProjectedElevation(boolean computing)
    • setCompProjElevHours

      public void setCompProjElevHours(int hrs)
    • getCompProjElevHours

      public int getCompProjElevHours()
    • setUseProjectedResElevForOpZone

      public void setUseProjectedResElevForOpZone(boolean use)
    • useProjectedResElevForOpZone

      public boolean useProjectedResElevForOpZone()
    • 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
      Overrides:
      getFieldObject in class RssTSLocationObject
      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
      Overrides:
      setFieldObject in class RssTSLocationObject
      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