Package hec.rss.model
Class WaterAccount
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.rss.model.RssTSLocationObject
hec.rss.model.WaterAccount
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,TSLocation,RssModelVariableConstants,RssReturnStatusConstants,RssTSLocation,Serializable,Cloneable,Comparable,Observer,rma.lang.Modifiable
The Class WaterAccount.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RssSystemThe _system.static final doublestatic final intFields inherited from class hec.lang.NamedType
_ignoreModifiedEvents, _isValid, _modified, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENTFields inherited from interface hec.rss.model.RssModelVariableConstants
CUMLOC_OUTPUT_DATA, GRPID_DIVERSION, GRPID_JUNCTION, GRPID_REACH, GRPID_RESERVOIR, HINDCAST_IDS, HOLDOUT_OUTPUT_DATA, INPUT_DATA, OUTPUT_DATA, PULSE_OUTPUT_DATA, UNREG_OUTPUT_DATA, VID_ADJPARAM_FLOW, VID_CAPACITY_FACTOR, VID_CTRLOUT_HINDFLW, VID_CTRLOUT_RELEASE, VID_DAM_LEAK, VID_DAM_RELEASE, VID_DIV_FLOW, VID_DIV_FLOW_ROUTED, VID_DIV_HINDFLW, VID_DIV_RELEASE, VID_DIVOUT_FLOW, VID_DIVOUT_FLOW_ROUTED, VID_ENERGYREQUIRED_TSINPUT, VID_FIRST, VID_FOREBAY_ELEV, VID_FOREBAY_HEADLOSS, VID_GATE_OPENING, VID_GATE_PERCENTOPEN, VID_JUNC_ELEV, VID_JUNC_FLOW_CUMLOC, VID_JUNC_FLOW_DIV, VID_JUNC_FLOW_HOLD, VID_JUNC_FLOW_IN, VID_JUNC_FLOW_LIMIT, VID_JUNC_FLOW_LOCAL, VID_JUNC_FLOW_PULSE, VID_JUNC_FLOW_REG, VID_JUNC_FLOW_UNREG, VID_JUNC_FLOW_VIOL, VID_JUNC_HINDFLOW, VID_JUNC_INFLOW, VID_JUNC_INFLOW_LOCAL_TOTAL, VID_JUNC_STAGE, VID_JUNC_STAGE_LIMIT, VID_JUNC_STAGE_REG, VID_JUNC_STAGE_UNREG, VID_JUNC_STAGE_VIOL, VID_LAST, VID_NODE_FLOW, VID_NODE_HINDFLW, VID_NODE_HINDSTG, VID_NODE_KNOWNFLOW, VID_NODE_STAGE, VID_OPCTRL_CONSTRAINTID, VID_OPCTRL_DECISION, VID_OPCTRL_MAXLIMIT, VID_OPCTRL_MINLIMIT, VID_OPCTRL_RULEID, VID_OPCTRL_ZONEID, VID_OPRULE_FLOW_SPACE, VID_OPRULE_MAX, VID_OPRULE_MAX_STAGE, VID_OPRULE_MIN, VID_OPRULE_MIN_STAGE, VID_OPRULE_PRIORITY, VID_OPRULE_ROUTE_LAG, VID_OPRULE_ROUTE_MAXOFFSET, VID_OPRULE_ROUTE_MINOFFSET, VID_OPRULE_SPEC, VID_OPRULE_STOR_BAL, VID_OPRULE_STOR_BAL_INDEX, VID_OPRULE_VIOL_ELEV, VID_OPRULE_VIOL_FLOW, VID_OPRULE_VIOL_STAGE, VID_OPRULE_VIOL_STOR, VID_OPRULE_WQCD_ELEV, VID_OPRULEFL_CUMLOC, VID_OPRULETS_TSINPUT, VID_OPSET_ACTIVEZONE, VID_OPSET_GC_ELEV, VID_OPSET_GC_STOR, VID_OPSET_KNOWNZONEELEV, VID_OPSET_PROJECTEDELEV, VID_OPSET_ZONEELEV, VID_OPSET_ZONESTOR, VID_OUTGRP_RELEASE, VID_POOL_AREA, VID_POOL_ELEV, VID_POOL_ELEV_EST, VID_POOL_ELEVROC, VID_POOL_EVAP, VID_POOL_FLOWINTOSTOR, VID_POOL_HINDELEV, VID_POOL_HINDSTOR, VID_POOL_HOLDOUT, VID_POOL_INFLOW, VID_POOL_INPUTEVAP, VID_POOL_NETINFLOW, VID_POOL_OUTFLOW, VID_POOL_OUTFLOW_EST, VID_POOL_SEEP, VID_POOL_STOR, VID_PULSE_BACKQ, VID_PULSE_PULSEQ, VID_PUMP_FLOWAVG, VID_PUMP_VOL, VID_PUMPRULE_FLOWAVG, VID_PUMPRULE_FLOWAVG_CAP, VID_PUMPRULE_FLOWINST, VID_PUMPRULE_FLOWINST_CAP, VID_PUMPRULE_HOURS, VID_PUMPRULE_HOURS_CAP, VID_PUMPRULE_NUMPUMP, VID_PUMPRULE_NUMPUMP_CAP, VID_PUMPRULE_UNITHOURS, VID_PUMPRULE_UNITHOURS_CAP, VID_PUMPRULE_VOL, VID_PUMPRULE_VOL_CAP, VID_PWR_CAPABILITY, VID_PWR_EFF, VID_PWR_ENGYGEN, VID_PWR_ENGYPATTERN, VID_PWR_ENGYPERGEN, VID_PWR_ENGYPERREQD, VID_PWR_ENGYREQD, VID_PWR_ENGYVIOL, VID_PWR_FLWPWR, VID_PWR_HDPWR, VID_PWR_HYDLSS, VID_PWR_MAXCAPACITY, VID_PWR_PER_BALGEN, VID_PWR_PER_GCGEN, VID_PWR_PER_MINPUMPGEN, VID_PWR_PER_MINRELGEN, VID_PWR_PER_POWGEN, VID_PWR_PER_PUMPGEN, VID_PWR_PLNTFAC, VID_PWR_PWRCAP, VID_PWR_REQUIRED, VID_PWR_SPILL, VID_PWR_VIOL, VID_RCH_SEEP, VID_REACH_FLOW_CUMLOC, VID_REACH_FLOW_IN, VID_REACH_FLOW_REG, VID_REACH_FLOW_UNREG, VID_RES_GCRELEASE, VID_RES_HOLDOUT, VID_RES_RELEASE, VID_SPILL_FLOW, VID_SPILL_HINDFLOW, VID_STATE_VAR, VID_STATE_VAR_HIND, VID_TAIL_ELEV, VID_UNCTOUT_FLOW, VID_UNCTOUT_HINDFLW, VID_WA_ACCOUNT_DEMAND, VID_WA_ACCOUNT_INFLOW, VID_WA_CHARGES, VID_WA_CREDIT, VID_WA_CURRENT_MAX_VOLUME, VID_WA_CURRENT_VOLUME, VID_WA_HINDSTOR, VID_WA_LOSSES, VID_WA_PUMPBACK, VID_WA_RULE_DEMAND, VID_WA_SURPLUS, VID_WA_TRANSFERS, WQID_OFFSETFields inherited from interface hec.rss.model.RssReturnStatusConstants
RTN_CANCELED, RTN_NOPROBLEM, RTN_OPCHANGE, RTN_PROBLEM -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new water account.WaterAccount(String name, String description, int setIndex, int waIndex) Instantiates a new water account. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether all water accts associated with a res are empty.booleanReturns whether all water accts associated with a res are full.voidApply hindcast data.booleancheckUsesRule(RssSystem sys, List<YieldAnalysisRuleRef> yarrList) clone()clone methodintcomputeDefaultWAhindcastStep(RunTimeStep runtime) Compute hindcast step for a default water account.intCompute hindcast step.booleanevalConvergence(int iter, boolean gcOpChange) getActiveTSProxies(Vector vec, int iotype) returns a vector of required input, or generated output TSRecordProxies used in the current water account default implementation function, assume all records are active.getActiveTSProxy(int id) doubledoublegetCharges(RunTimeStep rts) doublegetCredit(RunTimeStep rts) doubledoubledoublebooleanGets the default flag.doublegetDemand(RunTimeStep rts) Gets the description.doubleGets the excess inflow vol.getFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.getHindcastDataList(Vector hvec) Gets the hindcast data list.intgetIndex()Return the index of the NamedType as an int.doubleGets the initial storage.doublegetLosses(RunTimeStep rts) doubleGets the lower storage limit.doubleGets the max storage.doublegetMaxVolTS(RunTimeStep rts) getName()Gets the name.doubleGets the percent of con.doublegetPrevVolume(RunTimeStep rts) doublegetPumpback(RunTimeStep rts) Gets the reservoir.doubledoublegetRuleDemand(RunTimeStep rts) Gets the rule refs.doubleGets the storage zone.doublegetSurplus(RunTimeStep rts) Each subclass must provide a method to return its parent RssSystemdoubledoubledoublegetTransfers(RunTimeStep rts) intGets the water account set index.booleanvoidincrementSurplus(RunTimeStep rts, double extraSurplus) voidincrementTransfers(RunTimeStep rts, double extraTransfers) booleanintInitializes start of ReservoirOp.evalControllerDecision rule stack loop Performed only on the default water accountvoidInitialize.voidInitialize default account.booleaninitializeRules(RssSystem system) Initialize rules.voidbooleanisEmpty()Checks if is empty.booleanisFull()Checks if is full.booleanbooleanreadFile(BufferedReader reader) Read file.voidintMethod to set account fractions - should be called only for default water account on reservoirvoidsetCharges(RunTimeStep rts, double charges) voidsetCredit(RunTimeStep rts, double credit) voidsetCurrentFractionOfCon(double fracOfCon) voidsetCurrentInflow(RunTimeStep rts, double inflow) voidsetCurrentVolume(RunTimeStep rts, double currentVol) voidsetDefaultFlag(boolean defaultFlag) Sets the default flag.voidsetDemand(RunTimeStep rts, double demand) voidsetDescription(String description) Sets the description.voidsetExcessInflowVol(double excessInflowVol) Sets the excess inflow vol.booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetInitialStorage(double s) Sets the initial storage.voidsetLosses(RunTimeStep rts, double losses) voidSets the lower storage limit.voidsetMaxStorage(double maxStorage) Sets the max storage.voidsetMaxVolTS(RunTimeStep rts, double maxStor) voidSets the name.voidsetPercentOfCon(double percentOfCon) Sets the percent of con.voidsetPumpback(RunTimeStep rts, double pb) voidSets the reservoir.voidsetReservoir(ReservoirElement res, RunTimeStep rts) Sets the reservoir.voidsetReservoirs(ReservoirElement res, RunTimeStep rts) voidsetResExcessInflowVol(double excessQinVol) voidsetRuleDemand(RunTimeStep rts, double demand) voidsetRuleRefs(List<YieldAnalysisRuleRef> ruleRefs) Sets the rule refs.voidsetStorageScale(double storScale) voidSets the storage zone.voidsetSurplus(RunTimeStep rts, double surplus) voidSets the system.voidsetTotalGCOpDemand(double gcOpDemand) voidsetTransfers(RunTimeStep rts, double transfers) voidsetUsePercentOfCon(boolean usePercentOfCon) Sets the use percent of con.voidsetUseStorageScale(boolean useScaling) voidSum all water account excess inflow volumes for a reservoir (default acct only)doublesumWADemands(RunTimeStep rts, double physicalLimits) toString()voidupdateCharges(RunTimeStep rts, double gcOpDemand) voidvoidupdateLosses(RunTimeStep rts, double leakage) voidupdatePumpbackDestinationAllAccounts(RunTimeStep rts, double pumpbackFlow) voidupdatePumpbackDestinationOnlyDefault(RunTimeStep rts, double pumpbackFlow) voidupdatePumpbackSource(RunTimeStep rts, double pumpbackFlow) voidRegenerates the list of all TSProxies required for this location.voidupdateTSProxyList(boolean createYield) Update ts proxy list.voidupdateVolumes(RunTimeStep rts) voidbooleanUse percent of con.booleanCheck if water account uses a particular reservoir.booleanwriteFile(BufferedWriter writer) Write file.Methods inherited from class hec.rss.model.RssTSLocationObject
addTSRecord, addTSRecordProxy, addTSRecordProxy, addTSRecordProxy, clearTSProxyList, copyInto, getActiveTSRecordProxies, getComputedTSRecordProxies, getTSArray, getTSArray, getTSArray, getTSArray, getTSContainer, getTSContainer, getTSDataSet, getTSRecordProxies, getTSRecordProxy, getTSRecordProxy, getTSRecordProxy, getTSRecordProxy, getTSRecordProxy, getTSRecordProxyVec, removeTSRecord, removeTSRecordProxy, removeTSRecordProxyMethods inherited from class hec.lang.NamedType
addModifiableListener, compareTo, fireModifiedStateChanged, getDisplayName, getIgnoreModifiedEvents, isModified, isValid, readResolve, removeModifiableListener, rename, set, setIgnoreModifiedEvents, setIndex, setModified, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
_system
The _system. -
FLOW_TOLERANCE
public static final double FLOW_TOLERANCE- See Also:
-
MAX_ITERATIONS
public static final int MAX_ITERATIONS- See Also:
-
-
Constructor Details
-
WaterAccount
public WaterAccount()Instantiates a new water account. -
WaterAccount
Instantiates a new water account.- Parameters:
name- the namedescription- the descriptionsetIndex- the set indexwaIndex- the wa index
-
-
Method Details
-
getIndex
public int getIndex()Description copied from class:NamedTypeReturn the index of the NamedType as an int. -
setDefaultFlag
public void setDefaultFlag(boolean defaultFlag) Sets the default flag. -
getDefaultFlag
public boolean getDefaultFlag()Gets the default flag. -
getWaterAccountSetIndex
public int getWaterAccountSetIndex()Gets the water account set index.- Returns:
- the water account set index
-
setReservoir
Sets the reservoir.- Parameters:
res- the res
-
setReservoirs
-
setReservoir
Sets the reservoir.- Parameters:
res- the resrts- the rts
-
getReservoir
Gets the reservoir.- Returns:
- the reservoir
-
setStorageZone
public void setStorageZone()Sets the storage zone. -
getStorageZone
Gets the storage zone.- Returns:
- the storage zone
-
setLowerStorageLimit
Sets the lower storage limit.- Parameters:
rts- the new lower storage limit
-
getLowerStorageLimit
public double getLowerStorageLimit()Gets the lower storage limit.- Returns:
- the lower storage limit
-
initialize
public void initialize()Initialize. -
isInitialized
public boolean isInitialized() -
initializeDefault
public void initializeDefault()Initialize default account. -
getHindcastDataList
Gets the hindcast data list.- Parameters:
hvec- the hvec- Returns:
- the hindcast data list
-
initializeRules
Initialize rules.- Parameters:
system- the system- Returns:
- true, if successful
-
isFull
public boolean isFull()Checks if is full.- Returns:
- true, if is full
-
isEmpty
public boolean isEmpty()Checks if is empty.- Returns:
- true, if is empty
-
getExcessInflowVol
public double getExcessInflowVol()Gets the excess inflow vol.- Returns:
- the excess inflow vol
-
allAccountsFull
public boolean allAccountsFull()Returns whether all water accts associated with a res are full. -
allAccountsEmpty
public boolean allAccountsEmpty()Returns whether all water accts associated with a res are empty. -
setExcessInflowVol
public void setExcessInflowVol(double excessInflowVol) Sets the excess inflow vol.- Parameters:
excessInflowVol- the new excess inflow vol
-
toString
-
initEvalControllerDecision
Initializes start of ReservoirOp.evalControllerDecision rule stack loop Performed only on the default water account -
updateCharges
-
updateLosses
-
initializeWADemands
-
getAvailableVolume
-
evalConvergence
public boolean evalConvergence(int iter, boolean gcOpChange) -
updateCurrentVolume
-
updateWAStates
-
redistributeInflow
-
sumWADemands
-
updateVolumes
-
updatePumpbackDestinationOnlyDefault
-
updatePumpbackDestinationAllAccounts
-
updatePumpbackSource
-
sumResExcessInflowVol
public void sumResExcessInflowVol()Sum all water account excess inflow volumes for a reservoir (default acct only) -
getCurrentInflow
-
setCurrentInflow
-
getPrevVolume
-
getCurrentVolume
-
setCurrentVolume
-
setDemand
-
getDemand
-
getRuleDemand
-
setRuleDemand
-
setMaxVolTS
-
getMaxVolTS
-
setSurplus
-
getSurplus
-
setTransfers
-
getTransfers
-
setCredit
-
getCredit
-
setLosses
-
getLosses
-
setCharges
-
getCharges
-
setPumpback
-
getPumpback
-
incrementTransfers
-
incrementSurplus
-
getTotalInflow
-
setUsePercentOfCon
public void setUsePercentOfCon(boolean usePercentOfCon) Sets the use percent of con.- Parameters:
usePercentOfCon- the new use percent of con
-
usePercentOfCon
public boolean usePercentOfCon()Use percent of con.- Returns:
- true, if successful
-
setPercentOfCon
public void setPercentOfCon(double percentOfCon) Sets the percent of con.- Parameters:
percentOfCon- the new percent of con
-
getPercentOfCon
public double getPercentOfCon()Gets the percent of con.- Returns:
- the percent of con
-
setMaxStorage
public void setMaxStorage(double maxStorage) Sets the max storage.- Parameters:
maxStorage- the new max storage
-
getMaxStorage
public double getMaxStorage()Gets the max storage.- Returns:
- the max storage
-
setRuleRefs
Sets the rule refs.- Parameters:
ruleRefs- the new rule refs
-
getRuleRefs
Gets the rule refs.- Returns:
- the rule refs
-
setName
Sets the name. -
getName
Gets the name. -
setDescription
Sets the description.- Overrides:
setDescriptionin classNamedType- Parameters:
description- the new description
-
getDescription
Gets the description.- Overrides:
getDescriptionin classNamedType- Returns:
- the description
-
setTotalGCOpDemand
public void setTotalGCOpDemand(double gcOpDemand) -
getTotalGCOpDemand
public double getTotalGCOpDemand() -
setResExcessInflowVol
public void setResExcessInflowVol(double excessQinVol) -
getResExcessInflowVol
public double getResExcessInflowVol() -
inflowEvaled
public boolean inflowEvaled() -
setAccountFractions
Method to set account fractions - should be called only for default water account on reservoir -
setCurrentFractionOfCon
public void setCurrentFractionOfCon(double fracOfCon) -
getCurrentFractionOfCon
public double getCurrentFractionOfCon() -
hasYieldAnalysis
public boolean hasYieldAnalysis() -
applyHindcastData
Apply hindcast data.- Parameters:
hd- the hd
-
getInitialStorage
public double getInitialStorage()Gets the initial storage.- Returns:
- the initial storage
-
setInitialStorage
public void setInitialStorage(double s) Sets the initial storage.- Parameters:
s- the new initial storage
-
usesReservoir
Check if water account uses a particular reservoir. -
computeHindcastStep
Compute hindcast step.- Parameters:
rts- the runtime step- Returns:
- the int
-
computeDefaultWAhindcastStep
Compute hindcast step for a default water account. User defined hindcast values already defined by the time this method is called.- Parameters:
runtime- the runtime- Returns:
- the int
-
checkUsesRule
-
getStorageScale
public double getStorageScale() -
setStorageScale
public void setStorageScale(double storScale) -
setUseStorageScale
public void setUseStorageScale(boolean useScaling) -
writeFile
Write file.- Parameters:
writer- the writer- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
readFile
Read file.- Parameters:
reader- the reader- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
clone
Description copied from class:RssTSLocationObjectclone method- Overrides:
clonein classRssTSLocationObject
-
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 classRssTSLocationObject- 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 classRssTSLocationObject- 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
-
getSystem
Description copied from class:RssTSLocationObjectEach subclass must provide a method to return its parent RssSystem- Specified by:
getSystemin classRssTSLocationObject
-
setSystem
Sets the system.- Parameters:
sys- the new system
-
updateTSProxyList
public void updateTSProxyList(boolean createYield) Update ts proxy list.- Parameters:
createYield- the create yield
-
updateTSProxyList
public void updateTSProxyList()Description copied from class:RssTSLocationObjectRegenerates the list of all TSProxies required for this location. This list includes all records that are generated by this function even if the records are held in another objects (e.g. RssNode) proxy list sub-classes of Function should over-ride this method if they use TSRecordProxies- Specified by:
updateTSProxyListin classRssTSLocationObject
-
getActiveTSProxies
returns a vector of required input, or generated output TSRecordProxies used in the current water account default implementation function, assume all records are active.- Parameters:
vec- the veciotype- the iotype- Returns:
- the active ts proxies
-
getActiveTSProxy
-