Package hec.rss.model

Class DownstreamOp

java.lang.Object
hec.rss.model.DownstreamOp
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, RssModelVariableConstants, RssReturnStatusConstants, Serializable

public class DownstreamOp extends Object implements AsciiSerializable, RssReturnStatusConstants, RssModelVariableConstants
Manages Downstream Controls Rules applied at an RssNode
See Also:
  • Constructor Details

    • DownstreamOp

      public DownstreamOp()
      Default Constructor
    • DownstreamOp

      public DownstreamOp(int nodeIndex)
  • Method Details

    • getResPulseTable

      public Hashtable getResPulseTable(int resId)
      return the pulseTable for the given reservoir index
      Parameters:
      resId -
      Returns:
    • evaluateLimits

      public void evaluateLimits(RunTimeStep rts, int iteration)
      evaluate rule limits for given time step
      Parameters:
      rts -
    • getMaxRoutingSteps

      public int getMaxRoutingSteps(ReservoirElement res)
    • computeFlowLimit

      public OpValue computeFlowLimit(DownstreamCntrlOpRule dcrule, RunTimeStep rts)
    • addActiveRule

      public void addActiveRule(DownstreamCntrlOpRule dcrule)
      Adds an active rule for the current decision step. Note that since for each reservoir rules are evaluated in priority order, they are added here in priority order.
      Parameters:
      dcrule -
    • evaluateBaseFlow

      public int evaluateBaseFlow(RunTimeStep rts, int itrial, int evalType)
    • evaluateOperationStep

      public int evaluateOperationStep(RunTimeStep rts, int itrial)
      This method is where the downstreamOp develops the flow space and allocates space to each reservoir rule. The downstreamOp also determines which reservoir rule is the controlling rule if there are more than one active for the current zone. InitOperationStep and addActiveRule methods must have been called previous to this method for the current time step
      Parameters:
      rts -
      Returns:
    • evaluateOperationStep

      public int evaluateOperationStep(RunTimeStep rts, int itrial, int evalType)
    • initOperationStep

      public int initOperationStep(RunTimeStep rts)
      Called at the begining of each decision step evaluation, this method clears the list of active rules for each reservoir operating for this downstream location.
      Parameters:
      rts -
      Returns:
    • setSystem

      public void setSystem(RssSystem sys)
    • initForPulse

      public int initForPulse(RssSystem sys, RssNode node)
      prepare the downstream op for compute of pulse routing
      Returns:
      RTN_NOPROBLEM if initialization is sucessful
    • clearForCompute

      public int clearForCompute(RssSystem sys, int nodeIndex)
      set system and node references and clear data prior to compute initialization
      Parameters:
      sys -
      nodeIndex -
      Returns:
    • initialize

      public int initialize(RssSystem sys, int nodeIndex, RunTimeWindow rtw)
      prepare the downstream op for system compute
      Returns:
      RTN_NOPROBLEM if initialization is sucessful
    • initForPostProcessing

      public int initForPostProcessing(RssSystem sys, int nodeIndex, RunTimeWindow rtw)
      Prepares this run for post processing in the ResSim Simulation Module. This routing sets up all data model connectivity, but does not load time series arrays.
      Returns:
      RTN_NOPROBLEM if successful
    • computePulseResponse

      public int computePulseResponse(ReservoirElement res, int outletId, RunTimeStep rts)
      Prepares the pulse routing data from the given reservoir outlet. Requires that the appropriate pulse routing has just been completed for the outlet and pulse results are in memory. Called from RssRun
      Parameters:
      res - ReservoirElement releasing the pulse
      outletId - Id of the reservoir child element that is the current outlet
      Returns:
      RTN_NOPROBLEM compute is successful
    • removeRuleRef

      public void removeRuleRef(DownstreamCntrlOpRule rule)
    • isRuleTableEmpty

      public boolean isRuleTableEmpty()
      returns true if there are no DownstreamOpRules in the ruleTable
      Returns:
      true if rule table is empty
    • addRule

      public DownstreamOpRule addRule(DownstreamCntrlOpRule drule)
      Add a rule
    • dispose

      public void dispose()
      clears data from the downstreamOp when it is to be deleted.
    • removeRule

      public DownstreamOpRule removeRule(int index)
      remove a rule by index
    • getDownstreamOpRule

      public DownstreamOpRule getDownstreamOpRule(String name)
      Get a rule by name
    • getDownstreamOpRule

      public DownstreamOpRule getDownstreamOpRule(int index)
      Get a rule by index
    • getRules

      public Vector getRules(Vector vec)
      adds all rules to the given vector, initializing vec if necessary
      Parameters:
      vec -
      Returns:
      vec
    • getFieldObject

      public Object getFieldObject(Field fld)
      Get the list of rules
      Specified by:
      getFieldObject in interface FieldAccessor
      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
      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