Package hec.rss.model

Class Function

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable
Direct Known Subclasses:
Continuity, ControlStructure, CumLocFunction, HoldoutFunction, PulseRoutingFunction, Routing

public abstract class Function extends RssTSLocationObject implements RssTSLocation, RssReturnStatusConstants, RssModelVariableConstants
See Also:
  • Constructor Details

    • Function

      public Function()
    • Function

      public Function(Element elem)
  • Method Details

    • cleanupFromDeSerialization

      public void cleanupFromDeSerialization()
    • initTSVals

      protected void initTSVals(int istep)
      set estimated values for un-initialized time series variables at the given time step
      Parameters:
      istep -
    • getFlowVolume

      public static double getFlowVolume(RunTimeStep rts, double q0, double q1)
      return the flow volume for the given time step assuming that the flow array has already been calculated
      Parameters:
      rts -
      array -
      Returns:
    • getFlowVolume

      public static double getFlowVolume(RunTimeStep rts, double[] array)
      return the flow volume for the given time step assuming that the flow array has already been calculated
      Parameters:
      rts -
      array -
      Returns:
    • getSystem

      public RssSystem getSystem()
      returns the Parent RssSytem of this functions element
      Specified by:
      getSystem in class RssTSLocationObject
    • printErrorMessage

      public void printErrorMessage(String msg)
      sends an error message with identification info to the systems UI
    • printErrorMessage

      public void printErrorMessage(String methodName, String msg)
      sends an error message with identification info to the systems UI
    • applyHindcastData

      public void applyHindcastData(HindcastData hd)
      applies specific hindcast data for compute
    • getDisplayName

      public String getDisplayName()
      returns a name suitable to use as the location (B) part of a DSS pathname
      Overrides:
      getDisplayName in class NamedType
    • getOutputBPart

      protected String getOutputBPart()
      Generates a B Part that is used during storage to DSS when this function is saved.
      Returns:
      String
    • getFullName

      public String getFullName()
      returns a name suitable to use as the location (B) part of a DSS pathname
    • setupForSerialization

      public void setupForSerialization()
      called just before ascii serialization - default no-op implementation
    • getHindcastDataList

      public void getHindcastDataList(Vector hvec)
      Default implementation of getHindcastDataList does not add any records to the list. This method is overriden in specific functions that require hindcast data.
    • getUnitSystem

      public int getUnitSystem()
    • resetParent

      public void resetParent(Element elem)
      resets the parent element and updates ownership of child objects
    • copyInto

      public void copyInto(Function f)
    • clone

      public Object clone()
      clone method
      Overrides:
      clone in class RssTSLocationObject
    • setElement

      public void setElement(Element e)
    • getElement

      public Element getElement()
    • initialize

      public boolean initialize()
      initialize prior to a compute
    • initForPostProcessing

      public boolean initForPostProcessing()
      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
    • initHindcastLoop

      public boolean initHindcastLoop(RunTimeWindow rtw)
      initialize prior to Hindcast computation loop. Default behavior is to return true when no initialization is requried.
    • initForecastLoop

      public boolean initForecastLoop(RunTimeWindow rtw)
      initialize prior to Forecast computation loop. Default behavior is to return true when no initialization is requried.
    • saveFunctionState

      public void saveFunctionState(int stateid)
      save the current state of the element and its function with the given identifier - default behavior is to do nothing
      Parameters:
      stateid - identifier for the state
    • restoreFunctionState

      public void restoreFunctionState(int stateid)
      restore the state of the element and its function matching the given identifier - default behavior is to do nothing
      Parameters:
      stateid - identifier for the state
    • hasDefaultParameters

      public boolean hasDefaultParameters()
      indicate if default function parameters have been changed
    • findAdjParam

      public AdjustableParameter findAdjParam(String param)
    • getForecastEquation

      public boolean getForecastEquation(RunTime runtime)
      Deprecated.
    • getHindcastEquation

      public boolean getHindcastEquation(RunTime runtime)
      Deprecated.
    • computeHindcastStep

      public int computeHindcastStep(RunTimeStep rts)
    • computeForecastStep

      public int computeForecastStep(RunTimeStep rts)
    • computeForecastStep

      public int computeForecastStep(RunTimeStep rts, double[] xt, double[] et, int tcount)
    • computeSubStepFlow

      public double computeSubStepFlow(RunTimeStep rts, double xt, double et)
    • writeData

      public boolean writeData(BufferedWriter out)
    • readData

      public boolean readData(BufferedReader input)
    • getAdjustableParameter

      public AdjustableParameter getAdjustableParameter()
    • getKeyStringForObject

      public String getKeyStringForObject(Object obj)
      Takes a object of class Element, Function, RssNode, OpController, or OpRule and returns a unique string identifying that object pass request to RssSystem This should be a TSLocation method
    • getObjectForKeyString

      public Object getObjectForKeyString(String keystr)
      Takes a key string and returns the object of class Element, Function, Node, OpController, or OpRule Pass request to RssSystem This should be a TSLocation method
    • getActiveTSProxies

      public Vector getActiveTSProxies(Vector vec, int iotype)
      returns a vector of required input, or generated output TSRecordProxies used in the current alternative default implementation, assume all records are active
    • 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 Function should over-ride this method if they use TSRecordProxies
      Specified by:
      updateTSProxyList in class RssTSLocationObject
    • updateWQTSProxyList

      public void updateWQTSProxyList(List<ModelVariable> conList)
      create WQ TS record proxies at all downstream nodes
      Parameters:
      conList -
    • getComputedTSRecordProxies

      public Vector getComputedTSRecordProxies()
      returns a vector of computed ts record proxies assuming the downstream flow is computed
    • getComputedTSRecordProxies

      public Vector getComputedTSRecordProxies(Vector v)
      returns a vector of computed ts record proxies assuming the downstream flow is computed
      Overrides:
      getComputedTSRecordProxies in class RssTSLocationObject
    • isNodeComputed

      public boolean isNodeComputed(int iorder, RssNode node, Integer idir)
      returns true if node is computed by the function, default is to return true if node is an outflow node
      Parameters:
      iorder - index of node in element vector
      node - node object
      idir - integer indicating whether node is inflow or outflow
      Returns:
      true if computed, else false
    • saveHotstartState

      public void saveHotstartState(HotstartState parentHotstartState, int stateId)
    • restoreHotstartState

      public boolean restoreHotstartState(HotstartState parentHotstartState)
    • 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