Package hec.rss.model
Class IndependentVariable
java.lang.Object
hec.rss.model.IndependentVariable
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,AltInputReportInfc,Serializable,Cloneable
public class IndependentVariable
extends Object
implements AsciiSerializable, Cloneable, AltInputReportInfc
Title: General CWMS Project
Description:
Copyright: Copyright (c) 2002
Company: RMA
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final inttype for Date Time Independent Variablestatic final intType for Date Independent Variablestatic final inttype for Global Variablestatic final inttype for Model Variable Independent Variablestatic final inttype for State Variable Independent Variablestatic final inttype for Time Series Independent Variablestatic final inttype id for Current Value time series functionstatic final String[]/** strings corresponding to Time Series Functionsstatic final inttype id for Lagged Value time series functionstatic final inttype id for Period Average time series functionstatic final inttype id for Period Maximum time series functionstatic final inttype id for Period Minimum time series functionstatic final inttype id for Previous Value time series functionstatic final inttype for State Variable Independent Variable -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor needed for Ascii DeserializationIndependentVariable(int type) Create a new IndependentVariable object -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if two IndependentVariable are essentially the sameBuild a string for display showing type, location and other info describing the rule.buildFunctionOfString(RssSystem network) Build a string for display showing type, location and other info describing the rule.Build a string for display showing type, location and other info describing the rule.clone()doubleComputes the value of the independent variable based on the Time Series Function.doubleevaluateTSFunction(RunTimeStep rts, double[] tsarray) Computes the value of the independent variable based on the Time Series Function 2/12/2010 added logic to support negative lag (positive offset)doubleGets the TimeSeries Lag with the - showing for display purposes.voidgetElementDependencies(List<Element> elemList, Element parentElem) Add elements that this independent variable depends on for its calculation, not including the element that holds this variable.intGets the Element of this object
Only valid if type isMODEL_VARIABLE_TYPEgetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.intint[]intGets the ModelVariable value
Only valid if type isMODEL_VARIABLE_TYPEintGets the TimeSeries Function only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPEdoubleGets the TimeSeries Lag only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPEGets the TimeSeries Name value only valid if the type isTIME_SERIES_TYPEdoubleGets the TimeSeries Period only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPEGets the name if the TSRecordProxyString[]intgetType()Gets the Type of this object one of:
DATE_TYPE
DATE_TIME_TYPE
MODEL_VARIABLE_TYPE
TIME_SERIES_TYPEstatic booleaninitializeCompute(IndependentVariable iv, RssSystem system, RssTSLocationObject tsLocationObject) Retrieves data for the _xvalArray of the IndependentVariable iv.booleaninitializeCompute(RssSystem system, RssTSLocationObject tsLocationObject) Retrieves data for the _xvalArray.booleanvoidoutputReport(AlternativeInputReport report, org.jdom.Element elem) Alternative Input Report Interface for data.voidsetColVariableInterpType(String colVarInterpType) booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidvoidsetModalVariableInfo(TSRecordProxy proxy, Element elem, ModelVariable mv) Sets the ModalVariableInfo information for this object.voidvoidsetRowVariableInterpType(String rowVarInterpType) voidvoidsetTimeSeriesLag(double lag) voidsetTimeSeriesName(String name) Sets the TimeSeries Name for this objectvoidsetTimeSeriesOptions(boolean usesTimeSeries) Sets the TimeSeriesOptions attribute of the IndependentVariable objectvoidsetTimeSeriesOptions(int function, double lag, double period) Sets the TimeSeriesOptions attribute of the IndependentVariable objectvoidsetTimeSeriesPeriod(double period) voidsetTwoVariableColumnValues(String[] columnValues) voidsetTwoVariableRule(IndependentVariable rowVar, IndependentVariable colVar) booleanCompare the time series options between two independent variablestoString()
-
Field Details
-
DATE_TYPE
public static final int DATE_TYPEType for Date Independent Variable- See Also:
-
DATE_TIME_TYPE
public static final int DATE_TIME_TYPEtype for Date Time Independent Variable- See Also:
-
MODEL_VARIABLE_TYPE
public static final int MODEL_VARIABLE_TYPEtype for Model Variable Independent Variable- See Also:
-
TIME_SERIES_TYPE
public static final int TIME_SERIES_TYPEtype for Time Series Independent Variable- See Also:
-
STATE_VARIABLE_TYPE
public static final int STATE_VARIABLE_TYPEtype for State Variable Independent Variable- See Also:
-
TWO_VARIABLE_TYPE
public static final int TWO_VARIABLE_TYPEtype for State Variable Independent Variable- See Also:
-
GLOBAL_VARIABLE_TYPE
public static final int GLOBAL_VARIABLE_TYPEtype for Global Variable- See Also:
-
TS_FUNCTION_STRINGS
/** strings corresponding to Time Series Functions -
TS_CURRENT_TYPE
public static final int TS_CURRENT_TYPEtype id for Current Value time series function- See Also:
-
TS_PREVIOUS_TYPE
public static final int TS_PREVIOUS_TYPEtype id for Previous Value time series function- See Also:
-
TS_LAGGED_TYPE
public static final int TS_LAGGED_TYPEtype id for Lagged Value time series function- See Also:
-
TS_PERAVG_TYPE
public static final int TS_PERAVG_TYPEtype id for Period Average time series function- See Also:
-
TS_PERMAX_TYPE
public static final int TS_PERMAX_TYPEtype id for Period Maximum time series function- See Also:
-
TS_PERMIN_TYPE
public static final int TS_PERMIN_TYPEtype id for Period Minimum time series function- See Also:
-
-
Constructor Details
-
IndependentVariable
public IndependentVariable(int type) Create a new IndependentVariable object- Parameters:
type- the type of IndependentVariable
-
IndependentVariable
public IndependentVariable()Default constructor needed for Ascii Deserialization
-
-
Method Details
-
getElementDependencies
Add elements that this independent variable depends on for its calculation, not including the element that holds this variable.- Parameters:
elemList-parentElem-
-
evaluateTSFunction
Computes the value of the independent variable based on the Time Series Function. Uses the _xvalArray established in the method initializeCompute()- Parameters:
rts- RunTimeStep at which the independent variable is to be evaluatedtsarray- Time Series array- Returns:
- value of independent variable
- See Also:
-
evaluateTSFunction
Computes the value of the independent variable based on the Time Series Function 2/12/2010 added logic to support negative lag (positive offset)- Parameters:
rts- RunTimeStep at which the independent variable is to be evaluatedtsarray- Time Series array- Returns:
- value of independent variable
-
initializeCompute
Retrieves data for the _xvalArray.- Parameters:
system- RssSystemtsLocationObject- RssTSLocationObject for possibly retrieving a TIME_SERIES_TYPE data- Returns:
- true if successfully filled _xvalArray
-
initializeCompute
public static boolean initializeCompute(IndependentVariable iv, RssSystem system, RssTSLocationObject tsLocationObject) Retrieves data for the _xvalArray of the IndependentVariable iv.- Parameters:
iv-system-tsLocationObject-- Returns:
-
getTSProxyName
Gets the name if the TSRecordProxy- Returns:
- name of proxy
-
getModelVariableElementIds
public int[] getModelVariableElementIds() -
setModalVariableInfo
Sets the ModalVariableInfo information for this object.- Parameters:
elem- the Elementmv- the ModelVariable- Throws:
IllegalStateException- if the type isn'tMODEL_VARIABLE_TYPE
-
setTimeSeriesName
Sets the TimeSeries Name for this object- Parameters:
name- The new TimeSeries Name- Throws:
IllegalStateException- if the type isn'tTIME_SERIES_TYPE
-
setTimeSeriesOptions
public void setTimeSeriesOptions(int function, double lag, double period) Sets the TimeSeriesOptions attribute of the IndependentVariable object- Parameters:
function- the TimeSeriesOption Functionlag- the TimeSeries lagperiod- the TimeSeries period- Throws:
IllegalStateException- if the type isn'tTIME_SERIES_TYPEorMODEL_VARIABLE_TYPE
-
setTimeSeriesOptions
public void setTimeSeriesOptions(boolean usesTimeSeries) Sets the TimeSeriesOptions attribute of the IndependentVariable object- Parameters:
function- the TimeSeriesOption Functionlag- the TimeSeries lagperiod- the TimeSeries period- Throws:
IllegalStateException- if the type isn'tTIME_SERIES_TYPEorMODEL_VARIABLE_TYPE
-
getTimeSeriesName
Gets the TimeSeries Name value only valid if the type isTIME_SERIES_TYPE- Returns:
- The TimeSeries Name value
-
getTimeSeriesFunction
Gets the TimeSeries Function only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPE- Returns:
- The TimeSeries Function value
-
getTimeSeriesLag
public double getTimeSeriesLag()Gets the TimeSeries Lag only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPE- Returns:
- The TimeSeries Lag value
-
getDisplayOnlyTimeSeriesLag
public double getDisplayOnlyTimeSeriesLag()Gets the TimeSeries Lag with the - showing for display purposes. THis value is for display only. The compute uses the getTimeSeriesLag() value, not this one. only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPE- Returns:
- The display Only TimeSeries Lag value. Do not use for calculations. Use getTimeSeriesLag() for compute.
-
setTimeSeriesLag
public void setTimeSeriesLag(double lag) -
getTimeSeriesPeriod
public double getTimeSeriesPeriod()Gets the TimeSeries Period only valid if the type isMODEL_VARIABLE_TYPEorTIME_SERIES_TYPE- Returns:
- The TimeSeries Period value
-
setTimeSeriesPeriod
public void setTimeSeriesPeriod(double period) -
getType
public int getType()Gets the Type of this object one of:
DATE_TYPE
DATE_TIME_TYPE
MODEL_VARIABLE_TYPE
TIME_SERIES_TYPE- Returns:
- The Type value
-
getElementId
public int getElementId()Gets the Element of this object
Only valid if type isMODEL_VARIABLE_TYPE- Returns:
- The Element value
-
getModelVariableId
public int getModelVariableId()Gets the ModelVariable value
Only valid if type isMODEL_VARIABLE_TYPE- Returns:
- The ModelVariable value
-
getModelVariable
-
getStateVariableId
public int getStateVariableId() -
getStateVariableName
-
getGlobalVariableId
public int getGlobalVariableId()- Returns:
-
getGlobalVariableName
-
getTwoVariableName
-
setStateVariable
-
setGlobalVariable
-
setTwoVariableRule
-
getRowVariable
-
getColVariable
-
areTheSame
Test if two IndependentVariable are essentially the same -
timeSeriesOptionsAreTheSame
Compare the time series options between two independent variables- Parameters:
iv-- Returns:
-
clone
-
buildFunctionOfString
-
buildFunctionOfString
Build a string for display showing type, location and other info describing the rule. This form is for a DiversionRule- Parameters:
rule-- Returns:
-
buildFunctionOfString
Build a string for display showing type, location and other info describing the rule. This form is for a DiversionRule- Parameters:
rule-- Returns:
-
buildFunctionOfString
Build a string for display showing type, location and other info describing the rule.- Parameters:
RssSystem- network- Returns:
-
toString
-
setModelVariableString
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
isTSOptChecked
public boolean isTSOptChecked() -
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- 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
-
setTwoVariableColumnValues
-
getTwoVariableColumnValues
-
setRowVariableInterpType
-
setColVariableInterpType
-
getRowVariableInterpType
-
getColVariableInterpType
-
outputReport
Description copied from interface:AltInputReportInfcAlternative Input Report Interface for data.- Specified by:
outputReportin interfaceAltInputReportInfc
-