Package hec.rss.model

Class Junction

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

public class Junction extends Continuity implements Cloneable, TailElevContainer
See Also:
  • Constructor Details

    • Junction

      public Junction()
    • Junction

      public Junction(Element elem)
  • Method Details

    • getBCAdjFac

      public double getBCAdjFac(int i)
      get the scaling factor applied to a boundary condition on node i of this junction
      Parameters:
      i - array location in list of nodes on this junction
      Returns:
      local inflow scaling factor multiplied by additional scaling applied to the alternative
    • getDiversionVolume

      public double getDiversionVolume(RunTimeStep rts)
      return the total diversion flow volume for the given time step from diversion elements connected to this junction. Note that this method returns the volume that would be diverted if there is no shortage.
      Parameters:
      rts -
      Returns:
    • getLocalInflowVolume

      public double getLocalInflowVolume(RunTimeStep rts)
      return the total local flow volume for the given time step
      Parameters:
      rts -
      Returns:
    • setupForSerialization

      public void setupForSerialization()
      Called just before ascii serialization. Prepares the paired data values by setting there dss record path names
      Overrides:
      setupForSerialization in class Function
    • getTailwaterElevation

      public TailwaterElevation getTailwaterElevation()
      Specified by:
      getTailwaterElevation in interface TailElevContainer
    • setHasTailElev

      public void setHasTailElev(boolean b)
      Description copied from interface: TailElevContainer
      activates/deactivates tailwater elevation
      Specified by:
      setHasTailElev in interface TailElevContainer
    • hasTailElev

      public boolean hasTailElev()
      Description copied from interface: TailElevContainer
      returns boolean indicating whether this element has a tailwater elevation
      Specified by:
      hasTailElev in interface TailElevContainer
    • setElement

      public void setElement(Element e)
      overrides parent method to pass element reference to child objects
      Overrides:
      setElement in class Function
    • 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 Function
    • getLastOutflow

      public double getLastOutflow()
    • getAvailableFlow

      public double getAvailableFlow()
      Returns the flow available for diversion
    • setAvailableFlow

      public void setAvailableFlow(double f)
      Returns the flow available for diversion
    • isConfluence

      public boolean isConfluence()
      Tests if this junction element joins more than one upstream reach, has a diversion, or has more than one outflow.
      Returns:
      true if this is a confluence junction
    • initialize

      public boolean initialize()
      Description copied from class: Function
      initialize prior to a compute
      Overrides:
      initialize in class Function
    • getTotalLocalFlowFactor

      public double getTotalLocalFlowFactor(String locName)
      compute and return the total inflow factor applied to an inflow node
      Parameters:
      locName -
      Returns:
      local flow factor * alternative time series factor
    • computeHindcastStep

      public int computeHindcastStep(RunTimeStep runtime)
      Overrides:
      computeHindcastStep in class Function
    • computeForecastStep

      public int computeForecastStep(RunTimeStep runtime)
      Overrides:
      computeForecastStep in class Function
    • getRatingType

      public Junction.JuncRatingType getRatingType()
      returns rating type used by this junction
      Returns:
      JuncRatingType enum value
    • setRatingType

      public void setRatingType(Junction.JuncRatingType type)
      sets the rating type used by this junction.
      Parameters:
      type - JuncRatingType enum value
    • getElevation

      public double getElevation(RunTimeStep runtime, double q)
      compute elevation for timestep from rating curve or rating object
      Parameters:
      runtime -
      Returns:
    • getRatingObjStageDatum

      public double getRatingObjStageDatum()
    • getStage

      public double getStage(RunTimeStep runtime, double q)
    • getFlowFromStage

      public double getFlowFromStage(RunTimeStep rts, double stage)
      Interpolate flow from stage based on rating at the junction. The junction must have a rating defined.
      Parameters:
      rts - time step when interpolation occurs, may be null
      stage - input stage
      Returns:
      interpolated flow or RMAConst.UNDEF_DOUBLE if interpolation is not successful
    • getActiveTSProxies

      public Vector getActiveTSProxies(Vector vec, int iotype)
      add the time series record proxies associated current compute
      Overrides:
      getActiveTSProxies in class Function
    • 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
      Overrides:
      updateTSProxyList in class Function
    • getComputedTSRecordProxies

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

      public boolean hasRatingCurve()
      returns true if the Junction has rating curve data for the selected rating type
    • getRatingCurve

      public PairedValues getRatingCurve()
      returns a clone of the junctions rating curve
    • setRatingCurve

      public void setRatingCurve(PairedValues rc)
      replaces the junctions existing rating curve with the given PairedValues object, also adds/removes a stage time series record proxy as required
    • getRatingObject

      public RssRatingObject getRatingObject()
    • setRatingObject

      public void setRatingObject(RssRatingObject ro)
    • getDefaultIndependentVariable

      public IndependentVariable getDefaultIndependentVariable()
      Default independent variable is two variable
      Returns:
    • getReferencedStateVariables

      public void getReferencedStateVariables(List svlist)
      adds StateVariables refereced by this rule to the given list
      Parameters:
      svlist - unique list of state variables
    • setVerticalDatumSettings

      public void setVerticalDatumSettings(VerticalDatumSettings verticalDatumSettings)
    • getVerticalDatumSettings

      public VerticalDatumSettings getVerticalDatumSettings()
    • writeData

      @Deprecated public boolean writeData(BufferedWriter out)
      Deprecated.
      Overrides:
      writeData in class Function
    • readData

      @Deprecated public boolean readData(BufferedReader input)
      Deprecated.
      Overrides:
      readData in class Function
    • 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 Continuity
      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 Continuity
      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