Package hec.rss.model

Class ResSystemOpSet

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

public class ResSystemOpSet extends NamedType implements AsciiSerializable, Serializable, AltInputReportInfc
The object represents the Operational model for a System of Reservoirs. The set of reservoirs acts as one giant reservoir. ResSystemOpSet allows the setting of operational rules and storage zones as a whole, which are defined by each individual reservoir
See Also:
  • Constructor Details

    • ResSystemOpSet

      public ResSystemOpSet()
      Default Constructor. Mostly for the Ascii Serializer()
    • ResSystemOpSet

      public ResSystemOpSet(int idx, String name, String description)
  • Method Details

    • getSysZoneStorage

      public double getSysZoneStorage(HecTime htime, int syszoneId)
      Get the total storage for the a system storage zone at a specific time.
      Parameters:
      htime - HecTime for which the storage value is to be determined
      syszoneid - index of the SystemStorageZone
      Returns:
      system zone storage value
    • getResZoneStorage

      public double getResZoneStorage(HecTime htime, int syszoneId, int resid)
      Get the total storage for the a system storage zone at a specific time.
      Parameters:
      htime - HecTime for which the storage value is to be determined
      syszoneId - index of the SystemStorageZone
      resid - index of the ReservoirElement
      Returns:
      reservoir zone stoage value
    • getMaxSystemStorage

      public double getMaxSystemStorage()
      Get the maxium total system storage based on the largest storage value defined in each reservoir
      Returns:
      maximum system storage
    • getMaxReservoirStorage

      public double getMaxReservoirStorage(int resid)
      Get the the largest storage value defined in each reservoir
      Returns:
      maximum reservoir storage
    • getSystemStorageDefinition

      public SystemStorageDefinition getSystemStorageDefinition()
    • getResStoragePattern

      public double[][] getResStoragePattern(HecTime htime)
      Get the table of reservoir storage vs system storage for the given time.
      Parameters:
      htime - Hectime at which the table is to be developed
      Returns:
      two dimensional double array where there is one column (2nd array index)
    • setParent

      public void setParent(ReservoirSysOp sysOp)
      Sets the parent or owner of this Operation Set. The parent will be some ReservoirSysOp
    • getReservoirSystemOp

      public ReservoirSysOp getReservoirSystemOp()
    • getReservoir

      public ReservoirElement getReservoir(int id)
      Returns the resevoir for the given reservoir ID.
    • clone

      public Object clone()
      Returns copy of this ResSystemOpSet. A deep copy is performed so all memebers are cloned. The pointer to the parent is passed by reference to the clone. Both this object and the clone object will point to the same owner.
      Overrides:
      clone in class NamedType
    • copySystemStorageZones

      public void copySystemStorageZones(ResSystemOpSet opSet)
      Copies the SystemStorageZones from the opSet parameter. A shallow copy is made.
    • deleteSystemStorageZone

      public void deleteSystemStorageZone(int id)
      Deletes a zone from the Reservoir System Operation Set. The id parameter specifies the ID of the System Storage Zone to Delete
    • addNewSystemStorageZone

      public SystemStorageZone addNewSystemStorageZone(String name, String description)
      Creates a new SystemStorageZone, adds it to the internal list of storageZones are returns a reference to the caller.
    • getStorageZone

      public SystemStorageZone getStorageZone(int id)
      get an existing storage zone by id
    • getStorageZone

      public SystemStorageZone getStorageZone(String name)
      get an existing storage zone by name
    • getStorageZoneIDs

      public int[] getStorageZoneIDs()
      Returns the list of IDs for all SystemStorageZones owned by this SystemOpSet. The result is never null.
    • doesStorageZoneNameExist

      public boolean doesStorageZoneNameExist(String name)
      Tests to see if there is a storage zone in this System Operation Set with this name. Storage Zone names should be unique. Returns true if one exists and false other wise
    • removeRuleRef

      public void removeRuleRef(SystemStorageZone zone, SystemOpRule rule)
      Deletes a rule reference for a given zone
    • removeAllRuleRef

      public void removeAllRuleRef(SystemOpRule rule)
      Deletes all SystemOpRule References for the specified Rule
    • getNextStorageZoneIndex

      public int getNextStorageZoneIndex()
      Calculates the next index value for a storage zone
    • addReservoirReferenceSpace

      public void addReservoirReferenceSpace()
      Addes the space for reservoir data. This usually happens when a reservoir is added to the system and everything needs to be updated.
    • deleteReservoirReferences

      public void deleteReservoirReferences(int reservoirID)
      Deletes all refenences to a reservoir in this System Operation Set. This includes all Reservoir Op Set referenecs, Storage Zone References, and %Storage in the system
    • getOpSetReferenceArray

      public OpSetRef[] getOpSetReferenceArray()
      Returns an array of reservoir opset references. The return array is guaranteed to be not null.
    • getOpSetReferences

      public OpSetRef getOpSetReferences(int id)
      Returns an opset refefence represented by the given ID. Returns null if to OpSet Reference exists
      See Also:
    • deleteOpSetRefByReservoir

      public void deleteOpSetRefByReservoir(ReservoirElement elem)
      Deletes OpSetRef's that reference and operation set in the given reservoir
    • deleteOpSetRefByReservoirID

      public void deleteOpSetRefByReservoirID(int resID)
      Deletes OpSetRef's that reference and operation set in the reservoir indexed by the given ID
    • getOpSetReferences

      public OpSetRef getOpSetReferences(ReservoirElement resElem)
      Returns an opset reference for a given Reservoir Element. Each one of the opset references in this object is owned by a given reservoir element. This is just a method to do a reverse look up. This method returns null if no opset is found for a given ReservoirElement
      Parameters:
      hec - .rss.model.ReservoirElement
      See Also:
    • addReservoirOpSet

      public void addReservoirOpSet(OpSet opSet)
      Creates a reference to a reservoir opset. This is needed because storage zones allocate a column of data for a reservoir based on the OperationSet
    • toString

      public String toString()
      Returns the name of this object. Useful for putting this object into dialog components
      Overrides:
      toString in class NamedType
    • 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
    • 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
    • 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