Package hec.rss.model

Class ReservoirSysOp

All Implemented Interfaces:
hec.event.AbstractDataListener, hec.event.DataChangeListener, hec.event.LockListener, AsciiSerializable, FieldAccessor, DataObject, DataStruct, RssReturnStatusConstants, Serializable, Cloneable, Comparable, EventListener, Observer, rma.lang.Modifiable

public class ReservoirSysOp extends AbstractReservoirOp implements AsciiSerializable, Serializable, RssReturnStatusConstants
ReservoirSysOp.java This class manages the Operations of a group of reservoirs. The group of reservoirs acts is one single large Reservoir.
See Also:
  • Field Details

  • Constructor Details

    • ReservoirSysOp

      public ReservoirSysOp()
  • Method Details

    • getSystemEnergyBalance

      public static int getSystemEnergyBalance()
    • getSystemBalanceForCoef

      public static int getSystemBalanceForCoef(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double sysbalpoint, double[] balanceStor)
    • getDefaultSystemBalanceForCoef

      public static int getDefaultSystemBalanceForCoef(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double sysbalpoint, double[] balanceStor)
    • getZoneSystemBalanceForCoef

      public int getZoneSystemBalanceForCoef(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double sysbalpoint, double[] balanceStor)
    • getSystemBalance

      public static int getSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj)
    • getSystemBalance

      public static int getSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj, double[] sysbalpoint, double[] sysStorCoef)
    • getDefaultSystemBalance

      public static int getDefaultSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj, double[] sysbalpoint, double[] sysStorCoef)
    • getZoneSystemBalance

      public int getZoneSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj, double[] sysbalpoint, double[] sysStorCoef)
    • getSystemDefinition

      public static SystemStorageDefinition getSystemDefinition(RssSystem system, ReservoirElement[] resArray)
    • getSystemDefinition

      public static SystemStorageDefinition getSystemDefinition(RssSystem system, ReservoirElement[] resArray, boolean[] active)
      Method to create the system storage definition for a set of reservoirs calls either the default method or system storage zone method depending on whether all the reservoirs belong to a know reservoir system
      Parameters:
      system -
      resArray -
      Returns:
    • getSystemEnergyDefinition

      public static SystemStorageDefinition getSystemEnergyDefinition(RssSystem system, ReservoirElement[] resArray, PairedValues[] energyTables)
      Same as getSystemStorageDefinition but adds allocation of stored energy array
      Parameters:
      system -
      resArray -
      Returns:
      system storage definition for given reservoirs.
    • getDefaultSystemDefinition

      public static SystemStorageDefinition getDefaultSystemDefinition(RssSystem system, ReservoirElement[] resArray)
      Develops the storage balance for a set of reservoirs. called by DownstreamOp
    • getZoneSystemDefinition

      public SystemStorageDefinition getZoneSystemDefinition(RssSystem system, ReservoirElement[] resArray)
      Develops the system storage definition by the system storage zones for a set of reservoirs. called by DownstreamOp
    • getZoneSystemDefinition

      public SystemStorageDefinition getZoneSystemDefinition(ResSystemOpSet os, ReservoirElement[] resArray)
    • getSystemBalance

      public static int getSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance)
      Develops the storage balance for a set of reservoirs. called by FlowLimitOpRule if all reservoirs do not belong to the same reservoir system, then default balancing is used
    • getSystemBalance

      public static int getSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance, double storAdj)
    • getDefaultSystemBalance

      public static int getDefaultSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance, double storAdj)
      Develops the storage balance for a set of reservoirs. called by FlowLimitOpRule
    • getZoneSystemBalance

      public int getZoneSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance, double storAdj)
      Deprecated.
      Develops the storage balance for a set of reservoirs. called by FlowLimitOpRule
    • setActiveOpSet

      public void setActiveOpSet(int id)
      sets the active operations set for the current compute
    • getSystem

      public RssSystem getSystem()
    • newController

      public OpController newController()
      cannot create new controllers for the system??
    • deleteControllerReferences

      public void deleteControllerReferences(int ctrlId)
    • addSystemOpSet

      public void addSystemOpSet(ResSystemOpSet opSet)
    • createNewSystemOpSet

      public ResSystemOpSet createNewSystemOpSet(String name, String description)
    • removeSystemOpSet

      public void removeSystemOpSet(int id)
    • removeSystemOpSet

      public void removeSystemOpSet(ResSystemOpSet sysopset)
    • getSystemOpSetIDs

      public int[] getSystemOpSetIDs()
      Returns an array of ids to all SystemOpSets. The array is guaranteed to be not null. The size of the array ranges from 0-number of opsets
    • getReservoirIDs

      public int[] getReservoirIDs()
      returns the IDS for all of the reservoirs in the system
    • getSystemOpSet

      public ResSystemOpSet getSystemOpSet(int id)
      Returns a ResSystemOpSet object specified by the given id. If the id does not exist a null value is returned
    • getSystemOpSets

      public Vector getSystemOpSets()
      Returns a Vector of reservoir operation sets
    • loadData

      public boolean loadData()
      Description copied from class: AbstractDataObject
      this method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.
      Specified by:
      loadData in interface DataObject
      Overrides:
      loadData in class AbstractDataObject
    • copyInto

      public void copyInto(ReservoirSysOp sysOp)
      Copies the given ReservoirSysOp into this on. This does a deep! copy
    • toString

      public String toString()
      Overrides:
      toString in class NamedType
    • setUserName

      public void setUserName(String name)
    • getUserName

      public String getUserName()
    • setRssSystem

      public void setRssSystem(RssSystem system)
    • clearReservoirs

      public void clearReservoirs()
      removes all refereces to reservoir elements
    • removeReservoir

      public void removeReservoir(ReservoirElement reservoir)
    • addReservoir

      public void addReservoir(ReservoirElement resElem)
      Add a reservoir to the group of Reservoirs for this system. If the reservoir already exists then it returns.
    • exists

      public boolean exists(ReservoirElement resElem)
      Tests to see if a reservoir exists in this system
    • lowerPriority

      public void lowerPriority(ReservoirElement resElem)
      Raises the priority of a reservoir within a system of reservoirs
    • raisePriority

      public void raisePriority(ReservoirElement resElem)
      Lowers the priority of a reservoir within a system of reservoirs
    • removeAllReservoirs

      public void removeAllReservoirs()
    • getReservoirByName

      public ReservoirElement getReservoirByName(String name)
      Returns a ReservoirElement by name
    • getDownStreamElements

      public Vector getDownStreamElements()
      This looks at all reservoirs and finds the downstream elements that are common to all reservoirs.
      Returns:
      Returns a Vector of downstream elements
    • getDownStreamNodes

      public Vector getDownStreamNodes()
      This looks at all reservoirs and finds the downstream nodes that are associated with elements that are downstream of all reservoirs in the system. Vector will never be null. If there are no downstream nodes then the vector will have size 0
      Returns:
      Returns a Vector of downstream elements
    • getReservoirById

      public ReservoirElement getReservoirById(int id)
      Returns a ReservoirElement in this system. Accepts an integer id as a parameter.
      See Also:
    • getReservoirList

      public List<ReservoirElement> getReservoirList()
    • deleteReservoir

      public void deleteReservoir(ReservoirElement resElem)
    • numReservoirs

      public int numReservoirs()
      Returns the number of Reservoirs in this system
    • clone

      public Object clone()
      Get Reservoir
      Overrides:
      clone in class AbstractReservoirOp
    • resetId

      public void resetId()
      reset this Objects id to undefined so that when a ReservoirSysOp is cloned and saved to the DataList, it won't overwrite the original object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(ReservoirSysOp that)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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 AbstractDataObject
      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 AbstractDataObject
      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
    • getSystemStorageTable

      public static double[][] getSystemStorageTable(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType)
      Calculate and return the full storage table for the given time step. There will be one row in the table for each reservoir and one final row for the total system storage. This method was developed for plotting the reservoir system storage distribution.
      Parameters:
      system -
      resArray -
      rts -
      sysDef -
      Returns:
      double array containing the reservoir and total system storage values for the given time step.
    • getDefaultSystemStorageTable

      public static double[][] getDefaultSystemStorageTable(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType)
    • getZoneSystemStorageTable

      public double[][] getZoneSystemStorageTable(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType)
    • getZoneSystemStorageTableC

      public double[][] getZoneSystemStorageTableC(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType)
    • getZoneSystemStorageTableB

      public double[][] getZoneSystemStorageTableB(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType)