Package hec.rss.model
Class ReservoirSysOp
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.AbstractDataObject
hec.rss.model.AbstractReservoirOp
hec.rss.model.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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class hec.model.AbstractDataObject
_dataList, _id, _isLocked, _loaded, _objRefs, _observerList, _outOfDateData, _parent, _propertyChangeSupportFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENTFields inherited from interface hec.rss.model.RssReturnStatusConstants
RTN_CANCELED, RTN_NOPROBLEM, RTN_OPCHANGE, RTN_PROBLEM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReservoir(ReservoirElement resElem) Add a reservoir to the group of Reservoirs for this system.voidaddSystemOpSet(ResSystemOpSet opSet) voidremoves all refereces to reservoir elementsclone()Get ReservoirvoidcopyInto(ReservoirSysOp sysOp) Copies the given ReservoirSysOp into this on.createNewSystemOpSet(String name, String description) voiddeleteControllerReferences(int ctrlId) voiddeleteReservoir(ReservoirElement resElem) booleanequals(ReservoirSysOp that) booleanbooleanexists(ReservoirElement resElem) Tests to see if a reservoir exists in this systemstatic intgetDefaultSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj, double[] sysbalpoint, double[] sysStorCoef) static intgetDefaultSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance, double storAdj) Develops the storage balance for a set of reservoirs.static intgetDefaultSystemBalanceForCoef(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double sysbalpoint, double[] balanceStor) static SystemStorageDefinitiongetDefaultSystemDefinition(RssSystem system, ReservoirElement[] resArray) Develops the storage balance for a set of reservoirs.static double[][]getDefaultSystemStorageTable(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType) This looks at all reservoirs and finds the downstream elements that are common to all reservoirs.This looks at all reservoirs and finds the downstream nodes that are associated with elements that are downstream of all reservoirs in the system.getFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.getReservoirById(int id) Returns a ReservoirElement in this system.getReservoirByName(String name) Returns a ReservoirElement by nameint[]returns the IDS for all of the reservoirs in the systemstatic intgetSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj) static intgetSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj, double[] sysbalpoint, double[] sysStorCoef) static intgetSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance) Develops the storage balance for a set of reservoirs.static intgetSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance, double storAdj) static intgetSystemBalanceForCoef(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double sysbalpoint, double[] balanceStor) static SystemStorageDefinitiongetSystemDefinition(RssSystem system, ReservoirElement[] resArray) static SystemStorageDefinitiongetSystemDefinition(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 systemstatic intstatic SystemStorageDefinitiongetSystemEnergyDefinition(RssSystem system, ReservoirElement[] resArray, PairedValues[] energyTables) Same as getSystemStorageDefinition but adds allocation of stored energy arraygetSystemOpSet(int id) Returns a ResSystemOpSet object specified by the given id.int[]Returns an array of ids to all SystemOpSets.Returns a Vector of reservoir operation setsstatic double[][]getSystemStorageTable(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType) Calculate and return the full storage table for the given time step.intgetZoneSystemBalance(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double[] stor, double[] balanceStor, double storadj, double[] sysbalpoint, double[] sysStorCoef) intgetZoneSystemBalance(RssSystem system, Vector resVec, RunTimeStep baserts, boolean[] ruleActive, double[] storageBalance, double storAdj) Deprecated.intgetZoneSystemBalanceForCoef(RssSystem system, ReservoirElement[] resArray, boolean[] resActive, RunTimeStep rts, SystemStorageDefinition sysStorDef, double sysbalpoint, double[] balanceStor) getZoneSystemDefinition(ResSystemOpSet os, ReservoirElement[] resArray) getZoneSystemDefinition(RssSystem system, ReservoirElement[] resArray) Develops the system storage definition by the system storage zones for a set of reservoirs.double[][]getZoneSystemStorageTable(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType) double[][]getZoneSystemStorageTableB(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType) double[][]getZoneSystemStorageTableC(RssSystem system, ReservoirElement[] resArray, RunTimeStep rts, SystemStorageDefinition sysStorDef, int tableType) inthashCode()booleanloadData()this method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.voidlowerPriority(ReservoirElement resElem) Raises the priority of a reservoir within a system of reservoirscannot create new controllers for the system??intReturns the number of Reservoirs in this systemvoidraisePriority(ReservoirElement resElem) Lowers the priority of a reservoir within a system of reservoirsvoidvoidremoveReservoir(ReservoirElement reservoir) voidremoveSystemOpSet(int id) voidremoveSystemOpSet(ResSystemOpSet sysopset) voidresetId()reset this Objects id to undefined so that when a ReservoirSysOp is cloned and saved to the DataList, it won't overwrite the original objectvoidsetActiveOpSet(int id) sets the active operations set for the current computebooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetRssSystem(RssSystem system) voidsetUserName(String name) toString()Methods inherited from class hec.rss.model.AbstractReservoirOp
copyInto, copyInto, DataChanged, loadId, lockedMethods inherited from class hec.model.AbstractDataObject
addObjectReference, addObserver, addPropertyChangeListener, addPropertyChangeListener, decrementRefCnt, delete, fireDataChangeEvent, getCommonDataListContainer, getData, getDataList, getGmtOffset, getId, getLocked, getObjectReferences, getParent, getRefCnt, getUnitSystem, incrementRefCnt, isLoaded, locked, reload, removeObjectReference, removeObjectReference, removeObserver, removePropertyChangeSupport, removePropertyChangeSupport, save, setDataList, setDescription, setId, setLocked, setModified, setName, setParentMethods inherited from class hec.lang.NamedType
addModifiableListener, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setIgnoreModifiedEvents, setIndex, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.model.DataObject
getDescription, getName, isModified
-
Field Details
-
CONTROLLER_ID_OFFSET
public static final int CONTROLLER_ID_OFFSET- See Also:
-
DEFAULT_BALANCE
public static final int DEFAULT_BALANCE- See Also:
-
ZONE_BALANCE
public static final int ZONE_BALANCE- See Also:
-
TABLEAS_STOR
public static final int TABLEAS_STOR- See Also:
-
TABLEAS_ZONE
public static final int TABLEAS_ZONE- See Also:
-
TABLEAS_ELEV
public static final int TABLEAS_ELEV- See Also:
-
-
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
-
newController
cannot create new controllers for the system?? -
deleteControllerReferences
public void deleteControllerReferences(int ctrlId) -
addSystemOpSet
-
createNewSystemOpSet
-
removeSystemOpSet
public void removeSystemOpSet(int id) -
removeSystemOpSet
-
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
Returns a ResSystemOpSet object specified by the given id. If the id does not exist a null value is returned -
getSystemOpSets
Returns a Vector of reservoir operation sets -
loadData
public boolean loadData()Description copied from class:AbstractDataObjectthis method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.- Specified by:
loadDatain interfaceDataObject- Overrides:
loadDatain classAbstractDataObject
-
copyInto
Copies the given ReservoirSysOp into this on. This does a deep! copy -
toString
-
setUserName
-
getUserName
-
setRssSystem
-
clearReservoirs
public void clearReservoirs()removes all refereces to reservoir elements -
removeReservoir
-
addReservoir
Add a reservoir to the group of Reservoirs for this system. If the reservoir already exists then it returns. -
exists
Tests to see if a reservoir exists in this system -
lowerPriority
Raises the priority of a reservoir within a system of reservoirs -
raisePriority
Lowers the priority of a reservoir within a system of reservoirs -
removeAllReservoirs
public void removeAllReservoirs() -
getReservoirByName
Returns a ReservoirElement by name -
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
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
Returns a ReservoirElement in this system. Accepts an integer id as a parameter.- See Also:
-
getReservoirList
-
deleteReservoir
-
numReservoirs
public int numReservoirs()Returns the number of Reservoirs in this system -
clone
Get Reservoir- Overrides:
clonein classAbstractReservoirOp
-
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
-
equals
-
hashCode
public int hashCode() -
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classAbstractDataObject- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classAbstractDataObject- Parameters:
fld- The java field object representing the member field to be setfobj- 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)
-