Package hec.rss.model

Class DiversionOp

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, ElementOp, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class DiversionOp extends NamedType implements AsciiSerializable, ElementOp
See Also:
  • Constructor Details

    • DiversionOp

      public DiversionOp()
  • Method Details

    • updateDecisions

      public void updateDecisions(RunTimeStep rts, int iteration)
      process decision making for the given time step
      Parameters:
      rts -
      iteration -
    • initializeCompute

      public boolean initializeCompute(RunTimeWindow rtw)
      prepare for computations - to be called after setting the active operations set
    • doesOpSetExist

      public boolean doesOpSetExist(String opSetName)
      Tests to see if a given operation set exists. Returns true if it does, otherwise false.
      Parameters:
      opSetName - - name of the operation set to search for
    • addNewOpSet

      public OpSet addNewOpSet(String name)
      instatiates a new OpSet with the given name and adds it to the table.
    • removeOpSet

      public void removeOpSet(int id)
    • removeOpSet

      public void removeOpSet(OpSet opset)
    • setActiveOpSet

      public void setActiveOpSet(int id)
      sets the active operations set for the current compute
    • setDefaultOpSetActive

      public void setDefaultOpSetActive()
    • getActiveOpSet

      public OpSet getActiveOpSet()
      returns the active operations set for the current compute
      Specified by:
      getActiveOpSet in interface ElementOp
      Returns:
    • 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 NamedType
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • getControllers

      public Vector<OpController> getControllers()
      Returns a vector of controllers
      Specified by:
      getControllers in interface ElementOp
    • 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 NamedType
      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
    • getController

      public OpController getController()
      Specified by:
      getController in interface ElementOp
      Returns:
    • getDiversionElement

      public DiversionElement getDiversionElement()
      Returns:
    • getOperationsElement

      public OperationsElement getOperationsElement()
      Specified by:
      getOperationsElement in interface ElementOp
      Returns:
    • getUnitSystem

      public int getUnitSystem()
      Specified by:
      getUnitSystem in interface ElementOp
      Returns:
    • setDiversionElement

      public void setDiversionElement(DiversionElement diversionElement)
      Parameters:
      diversionElement -
    • getGmtOffset

      public int getGmtOffset()
      Specified by:
      getGmtOffset in interface ElementOp
    • getOperationSet

      public OpSet getOperationSet(int opsetId)
      Specified by:
      getOperationSet in interface ElementOp
      Parameters:
      opsetId -
      Returns:
    • getOperationSet

      public OpSet getOperationSet(String name)
      Specified by:
      getOperationSet in interface ElementOp
      Parameters:
      name -
      Returns:
    • getOperationSets

      public Vector<OpSet> getOperationSets()
      Returns a Vector of reservoir operation sets
      Specified by:
      getOperationSets in interface ElementOp
      Returns:
    • getController

      public OpController getController(int controllerIndex)
      Specified by:
      getController in interface ElementOp
      Parameters:
      controllerIndex -
      Returns:
    • newController

      public OpController newController()
      Specified by:
      newController in interface ElementOp
      Returns:
    • deleteControllerReferences

      public void deleteControllerReferences(int ctrlId)
      Specified by:
      deleteControllerReferences in interface ElementOp
      Parameters:
      ctrlId -
    • printErrorMessage

      public void printErrorMessage(String message)
      Specified by:
      printErrorMessage in interface ElementOp
    • printMessage

      public void printMessage(String message)
      Specified by:
      printMessage in interface ElementOp
    • getControllerRuleNameByID

      public String getControllerRuleNameByID(int ruleid)
      Specified by:
      getControllerRuleNameByID in interface ElementOp
      Parameters:
      ruleid -
      Returns:
    • getControllerConstraintNameByID

      public String getControllerConstraintNameByID(int cnstrntid)
      Specified by:
      getControllerConstraintNameByID in interface ElementOp
      Parameters:
      cnstrntid -
      Returns:
    • getController

      public OpController getController(Element re)
      Specified by:
      getController in interface ElementOp
      Parameters:
      re -
      Returns:
    • determinePhysicalLimits

      public void determinePhysicalLimits(OpController opController, RunTimeStep rts)
      Specified by:
      determinePhysicalLimits in interface ElementOp
      Parameters:
      opController -
      rts -
    • getOpSetTable

      public Hashtable<intContainer,OpSet> getOpSetTable()
      Specified by:
      getOpSetTable in interface ElementOp
      Returns:
    • getOperationSetNames

      public String[] getOperationSetNames()
      Returns:
    • addDuplicateOpSet

      public OpSet addDuplicateOpSet(int oid, String name)
      Create a new OpSet by cloning and existing OpSet
      Parameters:
      oid - ID of the existing OpSet to clone
      name - name to assign to the new OpSet
      Returns:
      newly created OpSet
    • getConditionalBlock

      public ConditionalBlock getConditionalBlock(String name)
      Parameters:
      name -
      Returns:
    • createNewConditionalBlock

      public ConditionalBlock createNewConditionalBlock(String name)
      Parameters:
      name -
      Returns:
    • getConditionalBlocks

      public List<ConditionalBlock> getConditionalBlocks()
      Returns:
    • deleteConditionalBlock

      public ConditionalBlock deleteConditionalBlock(ConditionalBlock cBlock)
      Parameters:
      cBlock -
    • deleteConditionalBlock

      public ConditionalBlock deleteConditionalBlock(int cbIndex)
    • deleteOpRule

      public void deleteOpRule(OpRule rule)
      Specified by:
      deleteOpRule in interface ElementOp
      Parameters:
      rule -
    • getRules

      public Vector<OpRule> getRules()
      Returns a vector all rules in this ReservoirOp controllers
      Specified by:
      getRules in interface ElementOp
      Returns:
    • getRules

      public void getRules(int opid, List<OpRule> ruleVec)
      adds all rules to the given vector
    • isRuleActive

      public boolean isRuleActive(OpRule rule, RunTimeStep rts)
      Specified by:
      isRuleActive in interface ElementOp
      Parameters:
      rule -
      rts -
      Returns:
    • clone

      public DiversionOp 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 NamedType
    • copyInto

      public void copyInto(DiversionOp dop)
      Performs a deep copy that clones data of the given reservoirOp. This method is used by the reservoir editor.
    • getConditionalBlock

      public ConditionalBlock getConditionalBlock(int index)
      Specified by:
      getConditionalBlock in interface ElementOp
      Parameters:
      index -
      Returns:
    • getActiveTSRecordProxies

      public void getActiveTSRecordProxies(Vector vec, int iotype)
      add the time series record proxies associated with the active operation set to the given vector
    • updateTSProxyList

      public void updateTSProxyList()
      Have top level controller update the TSRecordProxy set for itself and all child controllers and rules