Package hec.rss.model

Class DiversionElement

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, OperationsElement, PlotVariableConstants, ReleaseElement, AltInputReportInfc, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, SeepageConstants, hec.watershed.res.model.PlottableObject, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class DiversionElement extends Element implements SeepageConstants, ReleaseElement, AltInputReportInfc, OperationsElement
See Also:
  • Field Details

  • Constructor Details

    • DiversionElement

      public DiversionElement()
    • DiversionElement

      public DiversionElement(RssSystem sys, int idx)
  • Method Details

    • getDivOpName

      public String getDivOpName()
      return the name of the ReservoirOp object associated with this element
    • getLinkedElementList

      public List<Element> getLinkedElementList(int direction)
      Override default method in Element class to inlude inflow elements to source junction. return a new List object with either upstream (INFLOW) or downstream (OUTFLOW) linked elements
      Overrides:
      getLinkedElementList in class Element
      Parameters:
      direction - : Element.OUTFLOW or Element.INFLOW
      Returns:
    • getDiversionVolume

      public double getDiversionVolume(RunTimeStep rts)
      returns the desired diversion volume for the given time step. Does not consider limitation by shortage
    • getReferencedStateVariables

      public void getReferencedStateVariables(List svlist)
      adds all StateVariables refereced by diversion rule to the given List
    • getRuleConnectivityRefs

      public List getRuleConnectivityRefs()
      Returns a List of RuleConnectivityRef objects identifying all rule references to other objects in the network.
      Overrides:
      getRuleConnectivityRefs in class Element
      Returns:
      ArrayList RuleConnectivityRef objects
    • disconnectDownstream

      public void disconnectDownstream(double eoff, double noff)
      disconnects the diversion from downstream element and optionaly offsets the location of the downstream end
      Parameters:
      eoff - east offset in world coordinates added to downstream location
      noff - north offset in world coordinates added to downstream location
    • getComputedTSRecordProxies

      public Vector getComputedTSRecordProxies()
      requests vector of computed ts proxies from function Overrides method in Element class to return the diversion record and the routed diversion record if the diversion connects back to the network
      Overrides:
      getComputedTSRecordProxies in class Element
    • updateDecisions

      public void updateDecisions(RunTimeStep rts, int iteration)
      update operating decision (not implemented until full decision making logic is ported over from reservoir element)
      Specified by:
      updateDecisions in interface ReleaseElement
      Parameters:
      rts -
      iteration -
    • updateOperations

      public int updateOperations(RunTimeStep rts, int iteration, boolean evalDownstream)
      Updates the operating decisions for the given time step.
    • initialize

      public boolean initialize(RunTimeWindow rtw)
      initialize prior to a compute
      Overrides:
      initialize in class Element
    • initForecastOperations

      public int initForecastOperations(RunTimeWindow rtw)
      Initialzes adjustable parameter values over forecast time window
      Specified by:
      initForecastOperations in interface ReleaseElement
    • getDiversionProjectId

      public long getDiversionProjectId()
    • setDiversionProjectId

      public void setDiversionProjectId(long id)
    • 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 Element
    • getController

      public Controller getController()
      returns the controller from the diversion control element function
    • clone

      public Object clone()
      clone does a deep copy of child objects
      Overrides:
      clone in class Element
    • setActive

      public void setActive(boolean active)
      Sets whether element is active for computation. Also sets nodes computed by this element to the sam active or inactive state.
      Overrides:
      setActive in class Element
    • removeNode

      public void removeNode(RssNode node)
      override Element.removeNode to remove child routing element if necessary
      Overrides:
      removeNode in class Element
    • getControllerName

      public String getControllerName()
    • getControlElement

      public ControlStructure getControlElement()
    • hasReach

      public boolean hasReach()
    • getReachElement

      public Element getReachElement()
    • computeHindcastStep

      public int computeHindcastStep(RunTimeStep rts)
      computes a single hindcast time step
      Overrides:
      computeHindcastStep in class Element
    • computeForecastStep

      public int computeForecastStep(RunTimeStep rts)
      computes a single forecast time step
      Overrides:
      computeForecastStep in class Element
    • computeHindcast

      public int computeHindcast(RunTimeWindow rtw, int computeFlag)
      Compute diversion over hindcast time window
      Overrides:
      computeHindcast in class Element
    • computeForecast

      public int computeForecast(RunTimeWindow rtw, int computeFlag)
      Compute diversion over Forecast time window
      Overrides:
      computeForecast in class Element
    • getSourceElement

      public Element getSourceElement()
    • getRequiredTSRecordProxies

      public Vector getRequiredTSRecordProxies()
      returns an the required proxies from the source element
      Overrides:
      getRequiredTSRecordProxies in class Element
    • calcSeepageFlow

      public double calcSeepageFlow(double flow)
      Specified by:
      calcSeepageFlow in interface SeepageConstants
      Overrides:
      calcSeepageFlow in class Element
    • getConstSeepage

      public double getConstSeepage()
    • setConstSeepage

      public void setConstSeepage(double s)
    • getConstSeepage

      public void getConstSeepage(hec.data.ParamDouble pd)
    • setConstSeepage

      public void setConstSeepage(hec.data.ParamDouble pd)
    • getReturnRatio

      public double getReturnRatio()
    • setReturnRatio

      public void setReturnRatio(double s)
    • getSeepageValues

      public PairedValues getSeepageValues()
    • setSeepageValues

      public void setSeepageValues(PairedValues e)
    • getSeepageType

      public int getSeepageType()
    • setSeepageType

      public boolean setSeepageType(int cond)
    • getLine

      public hec.map.WorldLine getLine()
    • getReferencePt

      public hec.map.WorldPt getReferencePt()
      Overrides:
      getReferencePt in class Element
    • setReferencePt

      public void setReferencePt(hec.map.WorldPt pt)
    • setLine

      public void setLine(hec.map.WorldLine reg)
    • getUpstreamNode

      public RssNode getUpstreamNode()
      Description copied from class: Element
      returns the first upstream node in the node list
      Overrides:
      getUpstreamNode in class Element
      Returns:
      the first upstream node in the node list
    • getDownstreamNode

      public RssNode getDownstreamNode()
      Description copied from class: Element
      returns the first downstream node in the node list
      Overrides:
      getDownstreamNode in class Element
    • getDiversionNode

      public RssNode getDiversionNode()
    • setFlowHindcastCondition

      @Deprecated public void setFlowHindcastCondition(int hindcastCondition)
      Deprecated.
    • addNode

      public void addNode(RssNode n, int idir)
      Description copied from class: Element
      adds a node to this element
      Overrides:
      addNode in class Element
    • convertRoutingElement

      public void convertRoutingElement()
    • getLineColor

      public Color getLineColor()
    • getInflowType

      public int getInflowType()
    • setInflowType

      public void setInflowType(int inFlowType)
    • getComputeDuringUnReg

      public boolean getComputeDuringUnReg()
    • setComputeDuringUnReg

      public void setComputeDuringUnReg(boolean b)
    • getModelVariables

      public Vector getModelVariables(Vector variableList)
      returns the model variables available for plotting method required by PlottableObject interface
      Specified by:
      getModelVariables in interface hec.watershed.res.model.PlottableObject
      Overrides:
      getModelVariables in class Element
      Parameters:
      variableList - vector of model variables
      Returns:
      updated vector of model variables
    • getDefaultModelVariables

      public Vector getDefaultModelVariables()
      Returns a list of Model Variables that are used in the default plot required by PlottableObject interface
      Specified by:
      getDefaultModelVariables in interface hec.watershed.res.model.PlottableObject
      Overrides:
      getDefaultModelVariables in class Element
      Returns:
      list of ModelVariable objects
    • getTSRecords

      public Vector getTSRecords(ModelVariable plotVariable, Vector proxyList)
      Overrides:
      getTSRecords in class Element
    • importFrom

      public boolean importFrom(RuleResolution rr)
    • 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 Element
      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 Element
      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
    • updateOperations

      public void updateOperations(RssSystem rssSystem)
      called to create the default operations set for older diversions
      Parameters:
      rssSystem -
    • getStorageFunction

      public Storage getStorageFunction()
      Specified by:
      getStorageFunction in interface OperationsElement
      Returns:
    • getVerticalDatumSettings

      public VerticalDatumSettings getVerticalDatumSettings()
      Specified by:
      getVerticalDatumSettings in interface OperationsElement
      Returns:
    • setVeriticalDatumSettings

      public void setVeriticalDatumSettings(VerticalDatumSettings vSettings)
    • getCompositeRelease

      public PairedValuesExt getCompositeRelease()
      Specified by:
      getCompositeRelease in interface OperationsElement
    • getDiversionOps

      public DiversionOp getDiversionOps()
      Returns:
    • getElementOp

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

      public ElementOp getElementOp(boolean init)
      Specified by:
      getElementOp in interface OperationsElement
    • 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 elements, assume all records are active
      Overrides:
      getActiveTSProxies in class Element
    • updateTSProxyList

      public void updateTSProxyList()
      overrides Element.updateTSProxyList to also get proxies from active reservoir operations
      Overrides:
      updateTSProxyList in class Element
    • getRules

      public void getRules(int opid, List rulevec)
      Adds rule references to the given vector.
    • getConditionalBlockRefs

      public List<ConditionalBlockRef> getConditionalBlockRefs(int opid, List<ConditionalBlockRef> condList)
      Adds all ConditionalBlockRefs utilized by the Operation Set matching the given OpSet Id. This method is intended to provide the list of ConditionalBlockRef that may be utilized during a compute in order to evaluate the logical connectivity within the reservoir network. This method may be called within or outside a compute.
      Parameters:
      opid - id number for an existing OpSet
      condList - list object to hold the set of ConditionalBlockRef objects found by this method
      Returns:
      the list of ConditionalBlockRef objects
    • getFillColorName

      public String getFillColorName()
      get the Fill Color name
      Returns:
      the Fill Color name or null to use the default
    • setFillColorName

      public void setFillColorName(String fillColorName)
      set the Fill Color name or null to use the default