SORTIE Java Interface  1
Public Member Functions | Protected Attributes | List of all members
sortie.data.funcgroups.statechange.ClimateImporter Class Reference

Corresponds to the clClimateImporter class. More...

Inheritance diagram for sortie.data.funcgroups.statechange.ClimateImporter:
sortie.data.funcgroups.Behavior

Public Member Functions

 ClimateImporter (GUIManager oManager, BehaviorTypeBase oParent, String sDescriptor, String sParFileTag, String sXMLRootString) throws ModelException
 Constructor. More...
 
void validateData (TreePopulation oPop) throws ModelException
 Makes sure that water deficit, solar radiation, and precipitation values are not negative. More...
 
boolean setVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, ArrayList< String > p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, org.xml.sax.Attributes oParentAttributes, org.xml.sax.Attributes[] p_oAttributes) throws ModelException
 Reads monthly temperature and precipitation data for the climate importer. More...
 
void writeXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException
 Writes the climate importer data to the parameter file. More...
 
double getTempData (int iTimestep, int iMonth) throws ModelException
 Get temperature data. More...
 
void setTempData (double fVal, int iTimestep, int iMonth) throws ModelException
 Set temperature data. More...
 
double getPptData (int iTimestep, int iMonth) throws ModelException
 Get precipitation data. More...
 
void setPptData (double fVal, int iTimestep, int iMonth) throws ModelException
 Set precipitation data. More...
 
int getNumberOfDataTimesteps ()
 Get the number of timesteps of data. More...
 
void callSetupDialog (JDialog jParent, MainWindow oMain)
 Overriden to call our special dialog. More...
 
void writeParametersToTextFile (FileWriter jOut, TreePopulation oPop) throws IOException
 Writes the parameters for the behavior to file, using the same system as the basic parameter display and entry system. More...
 
- Public Member Functions inherited from sortie.data.funcgroups.Behavior
GUIManager getGUIManager ()
 
 Behavior (GUIManager oManager, BehaviorTypeBase oParent, String sDescriptor, String sParFileTag, String sXMLRootString, String sHelpFileString)
 Constructor. More...
 
abstract void validateData (TreePopulation oPop) throws ModelException
 Override this to implement data checking. More...
 
void callSetupDialog (JDialog jParent, MainWindow oMain)
 Override this to call a specific setup dialog for this behavior. More...
 
int getNumberOfDataObjects ()
 Gets the number of managed data objects. More...
 
ModelData getDataObject (int iInd)
 Gets the managed data object at a particular index. More...
 
void validate () throws ModelException
 Behavior performs an internal check to make sure its settings are consistent and logical. More...
 
void setListPosition (int iListPosition) throws ModelException
 Sets the behavior list position. More...
 
int getListPosition ()
 Gets the behavior list position. More...
 
String getXMLParametersRoot ()
 Gets the XML parameter root string. More...
 
int getNumberNewDataMembers ()
 
DataMember getNewTreeDataMember (int iIndex) throws ModelException
 
void setCanApplyTo (int iType, boolean bCanApply)
 Sets whether this behavior can apply to a given tree type. More...
 
String getParameterFileBehaviorName ()
 Gets the parameter file name for this behavior. More...
 
double getVersion ()
 Gets behavior's parameter file version. More...
 
double getMinimumVersion ()
 Gets behavior's parameter file minimum version. More...
 
String getDescriptor ()
 Gets the descriptor string. More...
 
String getHelpFileString ()
 Gets the help file UD. More...
 
void setDescriptor (String s)
 Sets the descriptor string. More...
 
int getNumberOfCombos ()
 Gets the number of species/type combos to which this behavior applies. More...
 
int getNumberOfGrids ()
 Gets the number of grids to which this behavior applies. More...
 
void deleteSpeciesTypeCombo (int iIndex) throws ModelException
 Deletes the SpeciesTypeCombo at the given index. More...
 
void deleteSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Deletes a SpeciesTypeCombo. More...
 
void clearSpeciesTypeCombos ()
 Empties the species/type combo list. More...
 
SpeciesTypeCombo getSpeciesTypeCombo (int iIndex) throws ModelException
 Returns the SpeciesTypeCombo at the given index of the species/type combo list. More...
 
Grid getGrid (int iIndex) throws ModelException
 Returns the Grid at the given index of the grid applies to list. More...
 
ModelData getRequiredData (int iIndex)
 Returns the required data object at a given index. More...
 
int getNumberOfRequiredDataObjects ()
 Gets the number of required data objects for this behavior. More...
 
void addSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Adds a new species/type combo to the list to which this behavior applies. More...
 
void addGrid (Grid oGrid, boolean bReplace)
 Adds a new Grid to the list to which this behavior applies. More...
 
void addRequiredData (ModelData oData)
 Adds a piece of required data to the list. More...
 
boolean [] getWhichSpeciesUsed (TreePopulation oPop)
 Returns which species to which this behavior is applied. More...
 
boolean setVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, ArrayList< String > p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, Attributes oParentAttributes, Attributes[] p_oAttributes) throws ModelException
 Sets a data vector's value. More...
 
boolean setSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException
 Sets a data object's value. More...
 
ModelData findObjectByXMLTag (String sXMLTag)
 Finds an object based on its XML tag. More...
 
void copySpecies (int iSpeciesCopyFrom, int iSpeciesCopyTo) throws ModelException
 Copies one species to another. More...
 
void writeXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException
 Writes the XML data to a parameter file for the behaviors owned by this object. More...
 
void writeSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop) throws java.io.IOException, ModelException
 Writes a set of species-specific float values to a parameter file. More...
 
void writeSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop, boolean[] p_bFlags) throws java.io.IOException, ModelException
 Writes a set of species-specific values to a parameter file for a certain subset of species. More...
 
void readXMLParentTag (String sXMLTag, Attributes oAttributes) throws ModelException
 Accepts an XML parent tag (empty, no data) from the parser. More...
 
void changeOfSpeciesName (String sOldSpecies, String sNewSpecies)
 Performs any necessary tasks associated with changing the name of a species. More...
 
void changeOfSpecies (int iOldNumSpecies, int[] p_iIndexer, String[] p_sNewSpecies) throws ModelException
 Triggered when there is a change in the species list. More...
 
boolean getMustHaveTrees ()
 Gets whether this behavior must have trees. More...
 
ModelData findObjectByDescriptor (String sDescriptor)
 Finds an object based on its descriptor. More...
 
void writeBehaviorNode (BufferedWriter out, TreePopulation oPop) throws ModelException
 Writes behavior tags to the parameter file. More...
 
ArrayList< BehaviorParameterDisplayformatDataForDisplay (TreePopulation oPop)
 Formats data for display in a set of JTables. More...
 
String getAppliedToForDisplay (TreePopulation oPop)
 Get which species/types this behavior applies to, in a display-friendly format truncated to 250 chars. More...
 
void readDataFromDisplay (ArrayList< BehaviorParameterDisplay > oData, TreePopulation oPop) throws ModelException
 Reads in data from the parameter display window. More...
 
boolean canBeDuplicated ()
 Whether or not this behavior can be duplicated in the run. More...
 
void endOfParameterFileRead ()
 Called at the end of the parameter file read process. More...
 
void changeOfPlotResolution (float fOldX, float fOldY, float fNewX, float fNewY) throws ModelException
 Performs any tasks associated with a change of plot resolution. More...
 
setupType getSetupType ()
 
void writeParametersToTextFile (FileWriter jOut, TreePopulation oPop) throws IOException
 Writes the parameters for the behavior to file, using the same system as the basic parameter display and entry system. More...
 

Protected Attributes

ModelFloat m_fRadJan
 Radiation for January. More...
 
ModelFloat m_fRadFeb
 Radiation for February. More...
 
ModelFloat m_fRadMar
 Radiation for March. More...
 
ModelFloat m_fRadApr
 Radiation for April. More...
 
ModelFloat m_fRadMay
 Radiation for May. More...
 
ModelFloat m_fRadJun
 Radiation for June. More...
 
ModelFloat m_fRadJul
 Radiation for July. More...
 
ModelFloat m_fRadAug
 Radiation for August. More...
 
ModelFloat m_fRadSep
 Radiation for September. More...
 
ModelFloat m_fRadOct
 Radiation for October. More...
 
ModelFloat m_fRadNov
 Radiation for November. More...
 
ModelFloat m_fRadDec
 Radiation for December. More...
 
ModelFloat m_fAWS
 Available water storage. More...
 
double [][] mp_fTemp
 Monthly temperature data - first index = month, second = timestep. More...
 
double [][] mp_fPpt
 Monthly precipitation data - first index = month, second = timestep. More...
 
- Protected Attributes inherited from sortie.data.funcgroups.Behavior
GUIManager m_oManager
 GUIManager object. More...
 
BehaviorTypeBase m_oParent
 Parent manager. More...
 
ArrayList< ModelDatamp_oAllData = new ArrayList<ModelData>()
 All data for this object. More...
 
ArrayList< SpeciesTypeCombomp_oTreesAppliesTo = new ArrayList<SpeciesTypeCombo>(0)
 A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees. More...
 
ArrayList< Integer > mp_iGridsAppliesTo = new ArrayList<Integer>(0)
 A set of hashcodes of the Grids to which this behavior is applied - or none if it is not applied to grids. More...
 
ArrayList< DataMembermp_oNewTreeDataMembers = new ArrayList<DataMember>(0)
 The new tree data members that this behavior adds, above and beyond the basic tree population data members. More...
 
boolean m_bCanBeDuplicated = true
 Whether or not this behavior can have multiple copies in a run or not. More...
 
String m_sDescriptor = ""
 This is what will be displayed as the name of a given behavior in the GUI. More...
 
String m_sParFileTag = ""
 String which is used to identify this behavior in the parameter file. More...
 
String m_sXMLRootString = ""
 XML tag to surround this behavior's data. More...
 
String m_sHelpFileString = ""
 Help file topic identifier string. More...
 
boolean [] mp_bCanApplyToTreeType
 For each tree type, whether or not this behavior can be applied to it. More...
 
double m_fVersion = 1.0
 Version of this behavior. More...
 
double m_fMinVersion = 1.0
 Minimum version of this behavior. More...
 
int m_iListPosition = -1
 This behavior's position in the behavior list. More...
 
setupType m_iBehaviorSetupType
 

Additional Inherited Members

- Static Public Member Functions inherited from sortie.data.funcgroups.Behavior
static void setVectorValues (ModelVector oData, Float[] p_fValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Float[] p_fValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Double[] p_fValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Double[] p_fValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Integer[] p_iValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, String[] p_sValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, String[] p_sValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Integer[] p_iValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector p_oData, ArrayList< String > p_oValuesToSet, boolean[] p_bAppliesTo) throws ModelException
 Sets the values for vector variables. More...
 
static void writeDataToFile (BufferedWriter ojOut, ModelData oData) throws java.io. IOException
 Writes a piece of data to an XML file. More...
 
static Object [] formatBlankHeaderRow (Object[][] p_oTable)
 Creates a blank header row for a table. More...
 
static Object [][] formatDataAsComboBox (Object[][] p_oExisting, ModelEnum oToFormat)
 Adds a value with combo box formatting to an Object array for display in a JTable. More...
 
static String formatComboBoxString (ModelEnum oToFormat)
 Formats a combo box string from a ModelEnum. More...
 
static void addDataObjectToDisplayArrays (ModelData p_oDataObject, ArrayList< ModelData > p_oSingles, ArrayList< ArrayList< SpeciesSpecific >> p_oSpeciesSpecific, boolean[] p_bAppliesTo)
 Adds a data object to the arrays which will eventually display run parameters in a set of tables. More...
 
static Object [][] addDataToArray (Object[][] p_oExistingArray, Object[] p_oAddArray)
 Adds an Object array to an existing Object array. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelFloat oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelInt oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelString oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelVector oToFormat)
 Formats a vector of values into an object array and adds it to another Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelVector oToFormat, boolean[] p_bWhichSpecies)
 Formats a vector of values into a plain vector suitable for placing in a JTable and adds it to a vector of vectors at the end. More...
 
static Object [] formatSpeciesHeaderRow (boolean[] p_bUsed, TreePopulation oPop)
 Creates an object array of strings consisting of species names, suitable for including in the parameter entry table. More...
 
static void ensureSize (ArrayList<?> list, int size)
 Ensure an ArrayList is at least a specific size. More...
 
- Public Attributes inherited from sortie.data.funcgroups.Behavior
boolean m_bMustHaveTrees = true
 If true, and a tree has no species/type combos, it automatically becomes disabled. More...
 
- Protected Member Functions inherited from sortie.data.funcgroups.Behavior
void setSingleValue (ModelData oDataMember, Object oData) throws ModelException
 Sets the value of a single data member. More...
 
BehaviorParameterDisplay formatTable (ArrayList< ModelData > p_oSingles, ArrayList< ArrayList< SpeciesSpecific >> p_oSpeciesSpecific, TreePopulation oPop)
 Turns vector groups of data objects into a set of tables for display. More...
 
- Static Protected Member Functions inherited from sortie.data.funcgroups.Behavior
static boolean boolArraysEqual (boolean[] p_bArrayOne, boolean[] p_bArrayTwo)
 Tests two boolean arrays for equality. More...
 

Detailed Description

Corresponds to the clClimateImporter class.

Author
lora

Constructor & Destructor Documentation

◆ ClimateImporter()

sortie.data.funcgroups.statechange.ClimateImporter.ClimateImporter ( GUIManager  oManager,
BehaviorTypeBase  oParent,
String  sDescriptor,
String  sParFileTag,
String  sXMLRootString 
) throws ModelException

Constructor.

Parameters
oManagerGUIManager object
oParentParent managing object.
sDescriptorThe name of the behavior for the user.
sParFileTagString which is used to identify this behavior in the parameter file.
sXMLRootStringXML tag to surround this behavior's data.

Member Function Documentation

◆ callSetupDialog()

void sortie.data.funcgroups.statechange.ClimateImporter.callSetupDialog ( JDialog  jParent,
MainWindow  oMain 
)

Overriden to call our special dialog.

◆ getNumberOfDataTimesteps()

int sortie.data.funcgroups.statechange.ClimateImporter.getNumberOfDataTimesteps ( )

Get the number of timesteps of data.

Returns
Number of timesteps of data.

◆ getPptData()

double sortie.data.funcgroups.statechange.ClimateImporter.getPptData ( int  iTimestep,
int  iMonth 
) throws ModelException

Get precipitation data.

Parameters
iTimestepTimestep to get data for, as a value from 1-number of timesteps.
iMonthMonth to get data for, as a value from 1-12.
Returns
Temperature for the specified time.
Exceptions
ModelExceptionif the month or timestep are not valid.

◆ getTempData()

double sortie.data.funcgroups.statechange.ClimateImporter.getTempData ( int  iTimestep,
int  iMonth 
) throws ModelException

Get temperature data.

Parameters
iTimestepTimestep to get data for, as a value from 1-number of timesteps.
iMonthMonth to get data for, as a value from 1-12.
Returns
Temperature for the specified time.
Exceptions
ModelExceptionif the month or timestep are not valid.

◆ setPptData()

void sortie.data.funcgroups.statechange.ClimateImporter.setPptData ( double  fVal,
int  iTimestep,
int  iMonth 
) throws ModelException

Set precipitation data.

Parameters
fValTemperature for the specified time.
iTimestepTimestep to get data for, as a value from 1-number of timesteps.
iMonthMonth to get data for, as a value from 1-12.
Exceptions
ModelExceptionif the month or timestep are not valid.

◆ setTempData()

void sortie.data.funcgroups.statechange.ClimateImporter.setTempData ( double  fVal,
int  iTimestep,
int  iMonth 
) throws ModelException

Set temperature data.

Parameters
iTimestepTimestep to get data for, as a value from 1-number of timesteps.
iMonthMonth to get data for, as a value from 1-12.
fValTemperature for the specified time.
Exceptions
ModelExceptionif the month or timestep are not valid.

◆ setVectorValueByXMLTag()

boolean sortie.data.funcgroups.statechange.ClimateImporter.setVectorValueByXMLTag ( String  sXMLTag,
String  sXMLParentTag,
ArrayList< String >  p_oData,
String []  p_sChildXMLTags,
boolean []  p_bAppliesTo,
org.xml.sax.Attributes  oParentAttributes,
org.xml.sax.Attributes []  p_oAttributes 
) throws ModelException

Reads monthly temperature and precipitation data for the climate importer.

Parameters
sXMLTagParent XML tag of data vector whose value is to be set.
sXMLParentTagThe immediate parent tag that sXMLTag is within.
p_oDataVector of data values appropriate to the data type
p_sChildXMLTagsThe XML tags of the child elements
p_bAppliesToArray of booleans saying which of the vector values should be set. This is important in the case of species-specifics - the vector index is the species number but not all species are set.
oParentAttributesAttributes of parent tag. May be useful when overridding this for unusual tags.
p_oAttributesAttributes passed from parser. This may be needed when overriding this function. Basic species-specific values are already handled by this function.
Returns
true if the value was set successfully; false if the value could not be found. (This would not be an error, because I need a way to cycle through the objects until one of the objects comes up with a match.) If a match to a data object is made via XML tag, but the found object is not a ModelVector, this returns false.
Exceptions
ModelExceptionif the value could not be assigned to the data object.

◆ validateData()

void sortie.data.funcgroups.statechange.ClimateImporter.validateData ( TreePopulation  oPop) throws ModelException

Makes sure that water deficit, solar radiation, and precipitation values are not negative.

Makes sure that the number of timesteps has not increased and left us without data.

Parameters
oPopNot used.

◆ writeParametersToTextFile()

void sortie.data.funcgroups.statechange.ClimateImporter.writeParametersToTextFile ( FileWriter  jOut,
TreePopulation  oPop 
) throws IOException

Writes the parameters for the behavior to file, using the same system as the basic parameter display and entry system.

Overriden to add the monthly data.

The file passed has been opened and should be appended to and then left unclosed.

Parameters
jOutFile to write to.
oPopTreePopulation object.

◆ writeXML()

void sortie.data.funcgroups.statechange.ClimateImporter.writeXML ( BufferedWriter  jOut,
TreePopulation  oPop 
) throws ModelException

Writes the climate importer data to the parameter file.

Parameters
jOutFileWriter File to write to.
oPopTree population object.
Exceptions
ModelExceptionwon't.

Member Data Documentation

◆ m_fAWS

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fAWS
protected
Initial value:
= new ModelFloat(0,
"Available Water Storage in Top 100 cm Soil", "sc_ciAWS")

Available water storage.

◆ m_fRadApr

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadApr
protected
Initial value:
= new ModelFloat(0,
"April Radiation (cal/cm2)", "sc_ciAprRad")

Radiation for April.

◆ m_fRadAug

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadAug
protected
Initial value:
= new ModelFloat(0,
"August Radiation (cal/cm2)", "sc_ciAugRad")

Radiation for August.

◆ m_fRadDec

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadDec
protected
Initial value:
= new ModelFloat(0,
"December Radiation (cal/cm2)", "sc_ciDecRad")

Radiation for December.

◆ m_fRadFeb

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadFeb
protected
Initial value:
= new ModelFloat(0,
"February Radiation (cal/cm2)", "sc_ciFebRad")

Radiation for February.

◆ m_fRadJan

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadJan
protected
Initial value:
= new ModelFloat(0,
"January Radiation (cal/cm2)", "sc_ciJanRad")

Radiation for January.

◆ m_fRadJul

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadJul
protected
Initial value:
= new ModelFloat(0,
"July Radiation (cal/cm2)", "sc_ciJulRad")

Radiation for July.

◆ m_fRadJun

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadJun
protected
Initial value:
= new ModelFloat(0,
"June Radiation (cal/cm2)", "sc_ciJunRad")

Radiation for June.

◆ m_fRadMar

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadMar
protected
Initial value:
= new ModelFloat(0,
"March Radiation (cal/cm2)", "sc_ciMarRad")

Radiation for March.

◆ m_fRadMay

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadMay
protected
Initial value:
= new ModelFloat(0,
"May Radiation (cal/cm2)", "sc_ciMayRad")

Radiation for May.

◆ m_fRadNov

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadNov
protected
Initial value:
= new ModelFloat(0,
"November Radiation (cal/cm2)", "sc_ciNovRad")

Radiation for November.

◆ m_fRadOct

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadOct
protected
Initial value:
= new ModelFloat(0,
"October Radiation (cal/cm2)", "sc_ciOctRad")

Radiation for October.

◆ m_fRadSep

ModelFloat sortie.data.funcgroups.statechange.ClimateImporter.m_fRadSep
protected
Initial value:
= new ModelFloat(0,
"September Radiation (cal/cm2)", "sc_ciSepRad")

Radiation for September.

◆ mp_fPpt

double [][] sortie.data.funcgroups.statechange.ClimateImporter.mp_fPpt
protected

Monthly precipitation data - first index = month, second = timestep.

◆ mp_fTemp

double [][] sortie.data.funcgroups.statechange.ClimateImporter.mp_fTemp
protected

Monthly temperature data - first index = month, second = timestep.


The documentation for this class was generated from the following file: