Package hec.rss.model
Class StorageZone
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.rss.model.StorageZone
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,AltInputReportInfc,ZoneObjectParent,Serializable,Cloneable,Comparable,Observer,rma.lang.Modifiable
public class StorageZone
extends NamedType
implements Cloneable, ZoneObjectParent, AltInputReportInfc
A portion of a reservoir's storage pool where a particular operating strategy is defined.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddConditionalBlock(ConditionalBlock cblock) Add an OpRuleRef to this zone's rule listclone()Creates a new object of the same class as this object.voidgetActiveRules(RunTimeStep rts, List ruleList) return the active rules for the given time stepgetAllRuleRefs(int controllerIndex, int ruleRefIndex, List refList) getConditionalBlockRefs(List clist) getControllerRules(int controllerId, List ruleList) adds all rules used in this operation set to the given ListvoidgetElementDependencies(List<Element> elemList) adds elements upon which the zone depends to evaluate the storage zone value to the given list.Gets the ReservoirOp that owns the parent.doublegetElevation(RunTimeStep time) returns the elevation at a given time step using the seasonal data or time series overridedoublegetElevation(RunTimeStep time, Hashtable overrideTable) returns the elevation at a given time step using the seasonal data or time series overridegetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.doublegets the first elevation in the seasonal recorddoublegets the first value in the seasonal recordreturns a fully qualified name for a zonereturns current zone's independent variabledoublegetIndpVarValue(RunTimeStep rts, boolean hasElevTS) doublegetInterpolateElev(HecTime htime) getOpSet()getPrimaryRules(List ruleList) gets the list of OpRules held directy by zonevoidgetReferencedStateVariables(List svlist) adds all downstream rules to the given vectordoublereturns the reservoir element associated with this rule.getRuleRefs(List<OpRuleRef> ruleRefList) gets the unique list of all OpRules used by this zonegets the unique list of all OpRules used by this zonezone is a function of date or date/timeintgets the parent systemdoublegetTwoVarValue(IndependentVariable ivRow, IndependentVariable ivCol, RunTimeStep rts, boolean hasElevTS) Compute elevation for Two Independent Variable functionintString[]return the zone object list - does not return copy!intReturns either StorageZone.ZONE_ELEVATION or StorageZone.ZONE_STORAGE depending which way a zone is defined.booleanvoidbooleanbooleanbooleanvoidvoidvoidoutputReport(AlternativeInputReport report, org.jdom.Element elem) Alternative Input Report Interface for data.voidremoveAllConditionalBlockRefs(int cbBlockIndex) voidremove all If Blocks from the StorageZonevoidremoveAllRuleRefs(int controllerIndex, int ruleRefIndex) voidvoidremoveControllerRefs(int ctrlId) voidremoveIfBlock(ConditionalBlock ifBlock) remove the if block from the Zone.removeRule(OpRule oprule) remove the OpRule from the StorageZoneremoveRule(OpRuleRef opruleRef) remove the OpRuleRef from the StorageZonevoidsetAbvMobileZone(boolean abvMobileZone) voidsetConstantValue(double value) set the zone value to a constantbooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidZone Elevation as a function of some parameter value.voidZone Elevation as a function of some parameter value.voidZone Elevation as a function of some parameter value.voidsetIfBlockDisabled(ConditionalBlock ifBlock, boolean disabled) voidsetIndependentVariable(IndependentVariable independentVariable) sets zone's independent variable to the given independentVariablevoidvoidsetMobileZoneId(int mobileZoneId) voidvoidsetOpSetForElevOverride(OpSet opset) voidsetProportionScale(double proportionScale) voidsetReferenceValue(double val) sets reference zone value The value is interpreted as elevation or storage depending on the setting of zoneTypeIDvoidsetRuleDisabled(OpRule oprule, boolean disabled) voidsetRuleDisabled(OpRuleRef opruleRef, boolean disabled) voidvoidsetStartYear(int startYear) voidsetStorageFunction(Storage stor) voidsetStorageScale(double storageScale) voidvoidvoidsetUnitSysetm(int unitSystem) voidsetUserDefinedColumnValues(String[] columnValues) voidsetUserDefinedValues(PairedValuesExt userDefinedValues) voidsetUserDefinedValues(SeasonalRecordExt userDefinedValues) voidsetUseReferenceValue(boolean use) voidsetUseStorageScale(boolean useStorageScale, ReservoirStorageVsYieldAnalysis svya) voidsetUseStorageScale(boolean useStorageScale, ReverseReservoirYieldAnalysis rya) voidsetUseTwoVariableIndependentVariable(boolean use) voidbooleansetZonePriority(Object obj, int index) voidvoidsetZoneTypeID(int zoneTypeID) Sets how the storage zone is defined Storage or Elevation.toString()to string for display in combo boxesvoiduseMultiYearData(boolean useMYearData) booleanbooleanusesConditionalBlock(ConditionalBlock cblock, boolean recurse) test to see if the given conditional block is used in the zone rule set.booleanusesOpRule(OpRule rule, boolean recurse) test to see if the given rule is used in the zone rule set.voiduseTimeSeries(boolean useTimeSeries) booleanMethods inherited from class hec.lang.NamedType
addModifiableListener, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
ZONETYPEID_ELEV
public static final int ZONETYPEID_ELEV- See Also:
-
ZONETYPEID_STOR
public static final int ZONETYPEID_STOR- See Also:
-
-
Constructor Details
-
StorageZone
public StorageZone() -
StorageZone
-
-
Method Details
-
getElementDependencies
adds elements upon which the zone depends to evaluate the storage zone value to the given list. Does not add the element that owns the storage zone. -
getReferencedStateVariables
adds all downstream rules to the given vector -
initializeCompute
public boolean initializeCompute() -
getActiveRules
return the active rules for the given time step- Parameters:
rts-- Returns:
-
getPrimaryRules
gets the list of OpRules held directy by zone -
getRules
gets the unique list of all OpRules used by this zone -
getZBOpRule
-
getRuleRefs
gets the unique list of all OpRules used by this zone -
decreaseZoneObjectPriority
-
increaseZoneObjectPriority
-
setZonePriority
- Parameters:
index-userObject-- Returns:
- true if the object was moved
-
moveZoneObjectToBottomPriority
-
moveZoneObjectToTopPriority
-
getZoneObjectsList
return the zone object list - does not return copy!- Returns:
- the zone object List
-
addRule
Add an OpRuleRef to this zone's rule list- Parameters:
rule- the rule to reference- Returns:
- the OpRuleRef
-
removeAllRules
public void removeAllRules() -
removeAllIfBlocks
public void removeAllIfBlocks()remove all If Blocks from the StorageZone -
removeIfBlock
remove the if block from the Zone.- Parameters:
ifBlock-
-
removeRule
remove the OpRuleRef from the StorageZone- Parameters:
opruleRef- the OpRuleRef to remove- Returns:
- the removed OpRuleRef
-
removeRule
remove the OpRule from the StorageZone- Parameters:
oprule- the OpRule to remove- Returns:
- the removed OpRuleRef
-
getControllerRules
adds all rules used in this operation set to the given List -
removeControllerRefs
public void removeControllerRefs(int ctrlId) -
getConditionalBlockRefs
-
getAllRuleRefs
-
removeAllRuleRefs
public void removeAllRuleRefs(int controllerIndex, int ruleRefIndex) -
removeAllConditionalBlockRefs
public void removeAllConditionalBlockRefs(int cbBlockIndex) -
usesOpRule
test to see if the given rule is used in the zone rule set. Only recurse through conditional block references if recurse argument is true. -
addConditionalBlock
-
removeConditionalBlock
-
usesConditionalBlock
test to see if the given conditional block is used in the zone rule set. Only recurse through conditional block references if recurse argument is true. -
setOpSet
-
getOpSet
-
getFullZoneName
returns a fully qualified name for a zone -
getElementOp
Description copied from interface:ZoneObjectParentGets the ReservoirOp that owns the parent.- Specified by:
getElementOpin interfaceZoneObjectParent- Returns:
- the ReservoirOp
-
setOpSetForElevOverride
-
setKnownElevTS
-
setZoneElevTSContainer
-
setZoneStorTSContainer
-
setStorageFunction
-
getSystem
gets the parent system- Returns:
- parent's system
-
getReservoirElement
returns the reservoir element associated with this rule.- Returns:
- the reservoir element associated with this rule
-
setUnitSysetm
public void setUnitSysetm(int unitSystem) -
useMultiYearData
public void useMultiYearData(boolean useMYearData) -
isMultiYearData
public boolean isMultiYearData() -
useTimeSeries
public void useTimeSeries(boolean useTimeSeries) -
isTimeSeries
public boolean isTimeSeries() -
setIndependentVariable
sets zone's independent variable to the given independentVariable- Parameters:
IndependentVariable- independentVariable
-
getIndependentVariable
returns current zone's independent variable- Returns:
- zone independentVariable
-
setStartYear
public void setStartYear(int startYear) -
getStartYear
public int getStartYear() -
getUnitSystem
public int getUnitSystem() -
toString
to string for display in combo boxes -
getInterpolateElev
-
getZoneTypeID
public int getZoneTypeID()Returns either StorageZone.ZONE_ELEVATION or StorageZone.ZONE_STORAGE depending which way a zone is defined.- Returns:
-
setZoneTypeID
public void setZoneTypeID(int zoneTypeID) Sets how the storage zone is defined Storage or Elevation. Valid values are StorageZone.ZONE_ELEVATION or StorageZone.ZONE_STORAGE;- Parameters:
zoneType-
-
getElevation
returns the elevation at a given time step using the seasonal data or time series override- Parameters:
time- time step- Returns:
- elevation value
-
getIndpVarValue
-
getTwoVarValue
public double getTwoVarValue(IndependentVariable ivRow, IndependentVariable ivCol, RunTimeStep rts, boolean hasElevTS) Compute elevation for Two Independent Variable function- Parameters:
ivRow- Row IndependentVariableivCol- Column IndependentVariablerts-hasElevTS-- Returns:
-
getElevation
returns the elevation at a given time step using the seasonal data or time series override- Parameters:
time- time stepoverrideTable- Hashtable with user elevation overrides- Returns:
- elevation value
-
getFirstValue
public double getFirstValue()gets the first value in the seasonal record -
getFirstElevation
public double getFirstElevation()gets the first elevation in the seasonal record -
setUseStorageScale
-
setUseStorageScale
-
setStorageScale
public void setStorageScale(double storageScale) -
setMobileZoneId
public void setMobileZoneId(int mobileZoneId) -
setAbvMobileZone
public void setAbvMobileZone(boolean abvMobileZone) -
setProportionScale
public void setProportionScale(double proportionScale) -
getReferenceValue
public double getReferenceValue() -
setReferenceValue
public void setReferenceValue(double val) sets reference zone value The value is interpreted as elevation or storage depending on the setting of zoneTypeID- Parameters:
val- reference value
-
useReferenceValue
public boolean useReferenceValue() -
setUseReferenceValue
public void setUseReferenceValue(boolean use) -
setConstantValue
public void setConstantValue(double value) set the zone value to a constant -
useTwoVariableIndependentVariable
public boolean useTwoVariableIndependentVariable() -
setUseTwoVariableIndependentVariable
public void setUseTwoVariableIndependentVariable(boolean use) -
getTVRowIndependentVariable
-
setTVRowIndependentVariable
-
getTVColIndependentVariable
-
setTVColIndependentVariable
-
setUserDefinedValues
-
setUserDefinedValues
-
setUserDefinedColumnValues
-
getUserDefinedPairedValuesExt
-
getUserDefinedSeasonalRecordExt
-
getUserDefinedColumnValues
-
hasSeasonalVariation
public boolean hasSeasonalVariation()- Returns:
- true if Elevation Function has seasonal variation
-
setSeasonalRecord
-
setFunctionElevation
Zone Elevation as a function of some parameter value. Can have seasonal variation- Parameters:
spv-
-
setFunctionElevation
Zone Elevation as a function of some parameter value. Can have seasonal variation- Parameters:
spv-
-
setFunctionElevation
Zone Elevation as a function of some parameter value. Can have seasonal variation- Parameters:
spv-
-
getFunctionElevation
-
getSeasonalRecord
zone is a function of date or date/time -
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:
clonein classNamedType- Throws:
CloneNotSupportedException
-
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 classNamedType- 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 classNamedType- 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
-
outputReport
Description copied from interface:AltInputReportInfcAlternative Input Report Interface for data.- Specified by:
outputReportin interfaceAltInputReportInfc
-
getConditionalBlockRef
- Parameters:
cBlock-
-
setRuleDisabled
- Parameters:
currentRule-
-
setRuleDisabled
- Parameters:
currentRuleRef-
-
setIfBlockDisabled
- Parameters:
disabled-currentIfBlock-
-