Inheritance diagram for javawrapper::TreePopulation:
Public Member Functions | |
TreePopulation (GUIManager oManager) | |
Constructor. | |
int | GetNumberOfSpecies () |
Returns the number of species. | |
Vector | GetTrees () |
Gets the list of trees. | |
int | GetSpeciesCodeFromName (String sName) |
When passed the name of a species, will give back the corresponding species number code. | |
void | AddTabDelimTreeMapFile (javax.swing.JFrame oWindow, String sFileName) throws ModelException |
Adds the trees from a tab-delimited text tree map file. | |
int | GetNumberOfSizeClasses () |
Returns the number of size classes. | |
Float | GetSizeClass (int iIndex) |
Returns the size class at a specific index. | |
void | SetInitialSeedlingSize (float fVal) throws ModelException |
Sets the value of the diameter at 10 cm for new seedlings. | |
void | SetSizeClasses (Float[] p_fVals) throws ModelException |
Sets the size classes. | |
void | SetMinimumAdultDbh (Float[] p_fVals) throws ModelException |
Sets the minimum adult dbhs. | |
void | SetSpeciesNames (String[] p_sVals) throws ModelException |
Sets the species name list. | |
void | DoSetup (TreePopulation oPop) |
Performs setup. | |
void | ChangeOfSpecies (int iOldNumSpecies, int[] p_iIndexer) throws ModelException |
Overridden from WorkerBase to take care of other arrays. | |
void | SetInitialDensities (int iSizeClass, Float[] p_fVals) throws ModelException |
Sets the initial densities for a given species. | |
String | GetSpeciesNameFromCode (int iSpecies) |
For a given species code, returns its name. | |
float | GetNewSeedlingDiam10 () |
Gets the new seedling diameter at 10 cm value, in cm. | |
void | WriteXML (BufferedWriter out, TreePopulation oPop) throws ModelException |
Writes the settings to XML for the parameter file for the tree population. | |
void | ValidateData (TreePopulation oPop) throws ModelException |
This makes sure all data is valid and can be used to run the model. | |
boolean | SetVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, Vector p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, Attributes oParentAttributes, Attributes[] p_oAttributes) throws ModelException |
Override this function in order to be able to handle initial densities and species names. | |
int | GetFloatDataCode (String sDataMember, int iSpecies, int iType) |
Gets the data code for accessing a float tree data member. | |
void | ReadXMLParentTag (String sXMLTag, Attributes oAttributes) throws ModelException |
Accepts an XML parent tag (empty, no data) from the parser. | |
void | ClearTrees () |
Clears all trees. | |
boolean | SetSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException |
This method is looking for tm_floatCode, tm_intCode, tm_charCode, tm_boolCode, fl, int, ch, and bl. | |
void | ChangeSpeciesName (String sOldSpecies, String sNewSpecies) throws ModelException |
Changes the name of a species. | |
Static Public Member Functions | |
static int | GetNumberOfTypes () |
Get the total number of tree types (life history stages). | |
static String | GetTypeNameFromCode (int iType) |
For a given type code, returns its name. | |
static int | GetTypeCodeFromName (String sName) |
For a given type name, returns its code. | |
Static Public Attributes | |
static final int | SEED = 0 |
static final int | SEEDLING = 1 |
static final int | SAPLING = 2 |
static final int | ADULT = 3 |
static final int | STUMP = 4 |
static final int | SNAG = 5 |
static final int | WOODY_DEBRIS = 6 |
Protected Member Functions | |
void | UpdateBehaviorSpecies (int[] p_oTranslator) throws ModelException |
When a change of species has been made, this updates all behaviors to reflect the new species. | |
int | GetCodeForDataMember (Vector p_oMemberList, String sDataMember) |
Gets the data member code for a data member label. | |
Protected Attributes | |
ModelVector | mp_fSeedlingClass1Density |
Species-specific - initial densities for seedling height class 1. | |
ModelVector | mp_fSeedlingClass2Density |
Species-specific - initial densities for seedling height class 2. | |
ModelVector | mp_fSeedlingClass3Density |
Species-specific - initial densities for seedling height class 3. | |
Vector | mp_oTrees = new Vector(0) |
Holds Tree objects to be written to a tree map. | |
Vector[][] | mp_sTreeIntDataMembers |
Tree integer data members. | |
Vector[][] | mp_sTreeFloatDataMembers |
Tree float data members. | |
Vector[][] | mp_sTreeCharDataMembers |
Tree char data members. | |
Vector[][] | mp_sTreeBoolDataMembers |
Tree bool data members. | |
Vector[][] | mp_iTreeIntTransforms |
Index positions for tree integer data members. | |
Vector[][] | mp_iTreeFloatTransforms |
Index positions for tree float data members. | |
Vector[][] | mp_iTreeCharTransforms |
Index positions for tree char data members. | |
Vector[][] | mp_iTreeBoolTransforms |
Index positions for tree bool data members. | |
ModelFloat | m_fInitialSeedlingSize |
Initial seedling diam10. | |
ModelFloat | m_fSeedlingHeightClass1 |
Upper limit of seedling 1 initial densities height class, in cm. | |
ModelFloat | m_fSeedlingHeightClass2 |
Upper limit of seedling 2 initial densities height class, in cm. | |
int[] | mp_iSpeciesTransforms |
When parsing tree maps, this will convert in case the species list is in a different order. | |
int | m_iSpeciesCounter |
Counter for tree map species list when parsing tree map files. | |
int | m_iCurrentTreeType |
When parsing tree map settings, the current tree type. | |
int | m_iCurrentSpecies |
When parsing tree map settings, the current tree species. | |
Private Member Functions | |
void | WriteTreeMap (BufferedWriter jOut) throws ModelException |
Writes an XML tree map if there are any trees to write. | |
Private Attributes | |
ModelVector | mp_sSpeciesNames |
List of species names - ignore XML tags since this data can't use the automated XML read-write system. | |
ModelVector | mp_fSizeClasses |
Size class list - the values in this are floats which represent the upper dbh limit of a class. | |
ModelVector | mp_fInitialDensities |
Species-specific - contains the initial density for each class. | |
ModelVector | mp_fMinAdultDbh |
Species-specific - the minimum adult dbh value. | |
ModelVector | mp_fMaxSeedlingHeight |
Species-specific - the maximum seedling height value. |
It also manages the windows necessary to display and retrieve information about the trees.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Institute of Ecosystem Studies
|
Constructor.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Adds the trees from a tab-delimited text tree map file.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) March 28, 2005: Rewrote with new format (LEM) |
|
Overridden from WorkerBase to take care of other arrays.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) Reimplemented from javawrapper::WorkerBase. |
|
Changes the name of a species. Everything about the species remains the same except for the name. This is an easier process than actually changing the species list.
Edit history: ------------------ November 2, 2005: Created (LEM) |
|
Performs setup. Causes the max seedling height to default to 1.35 for all species.
Implements javawrapper::WorkerBase. |
|
Gets the data member code for a data member label. If this is not a currently listed data member, it will be added.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Gets the data code for accessing a float tree data member. You can use the return code to get the data from a Tree class object.
|
|
Gets the new seedling diameter at 10 cm value, in cm.
|
|
Returns the number of size classes.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Returns the number of species.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Get the total number of tree types (life history stages).
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Returns the size class at a specific index.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
When passed the name of a species, will give back the corresponding species number code. If there are spaces in the name, they should be replaced with underscores BEFORE being passed.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
For a given species code, returns its name. If this name is for display, a replace should be done on underscores to spaces.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Gets the list of trees.
|
|
For a given type name, returns its code.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
For a given type code, returns its name.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Accepts an XML parent tag (empty, no data) from the parser. This method watches for the following tags:
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) Reimplemented from javawrapper::WorkerBase. |
|
Sets the initial densities for a given species. Any species number greater than zero is assumed to be valid.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Sets the value of the diameter at 10 cm for new seedlings.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Sets the minimum adult dbhs. There must be one for each species.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
This method is looking for tm_floatCode, tm_intCode, tm_charCode, tm_boolCode, fl, int, ch, and bl. For the last four, they are only set if m_iCurrentSpecies and m_iCurrentTreeType are greater than -1. Thus grid values with these tags will be ignored.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) July 26, 2004: Added validation of X and Y coordinates (LEM) Reimplemented from javawrapper::WorkerBase. |
|
Sets the size classes. The size class vector will be sized to match the array of Floats passed. The values in the array represent the upper dbh limits of each size class. A value of 0 is assumed to be for seedlings.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Sets the species name list. The species vector will be sized to match the array of Strings passed. All spaces in the species names are replaced with underscores. If there are species currently defined, this calls ChangeOfSpecies() for all objects. This calls the GUIManager::DoSetup() method so that behavior groups can adjust for the new species list if species were already defined. This function also declares certain arrays, since this is the first opportunity to know how many species there are.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) July 22, 2004: Bug fix |
|
Override this function in order to be able to handle initial densities and species names.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) Reimplemented from javawrapper::WorkerBase. |
|
When a change of species has been made, this updates all behaviors to reflect the new species. If a species has been eliminated, all species/type combos relating to it are removed. If a species still exists, this will update it to make sure the correct species number is reflected.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
This makes sure all data is valid and can be used to run the model.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) March 8, 2005: Added validation of seedling height class initial densities Implements javawrapper::WorkerBase. |
|
Writes an XML tree map if there are any trees to write.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Writes the settings to XML for the parameter file for the tree population.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) Reimplemented from javawrapper::WorkerBase. |
|
Initial value: new ModelFloat( "New Seedling Diameter at 10 cm", "tr_seedDiam10Cm")
|
|
Initial value: new ModelFloat(0, "Seedling Height Class 1 Upper Bound, in cm", "tr_seedlingHeightClass1")
|
|
Initial value: new ModelFloat(0, "Seedling Height Class 2 Upper Bound, in cm", "tr_seedlingHeightClass2")
|
|
Initial value: new ModelVector( "Initial Densities", "", "", 0, ModelVector.FLOAT) Each vector bucket contains another vector with the values for each species for that size class. Ignore XML tags since this data can't use the automated XML read-write system. |
|
Initial value: new ModelVector( "Max Seedling Height (meters)", "tr_maxSeedlingHeight", "tr_mshVal", 0, ModelVector.FLOAT, true)
|
|
Initial value: new ModelVector("Minimum Adult DBH", "tr_minAdultDBH", "tr_madVal", 0, ModelVector.FLOAT, true)
|
|
Initial value: new ModelVector( "Initial Density (#/ha) - Seedling Height Class 1", "tr_seedlingHeight1Density", "tr_sh1dVal", 0, ModelVector.FLOAT, true)
|
|
Initial value: new ModelVector( "Initial Density (#/ha) - Seedling Height Class 2", "tr_seedlingHeight2Density", "tr_sh2dVal", 0, ModelVector.FLOAT, true)
|
|
Initial value: new ModelVector( "Initial Density (#/ha) - Seedling Height Class 3", "tr_seedlingHeight3Density", "tr_sh3dVal", 0, ModelVector.FLOAT, true)
|
|
Initial value: new ModelVector("Size classes", "", "", 0, ModelVector.FLOAT) The lower limit of a class is the upper limit of the size class below it. A size class with an upper limit of 0 is for seedlings. Ignore XML tags since this data can't use the automated XML read-write system. |
|
When parsing tree maps, this will convert in case the species list is in a different order. The array index is the code to convert; the value in the array at that point is the corresponding old species number. |
|
Index positions for tree bool data members. The current tree map being read may have different data member indexes, and this will help translate to mp_sTreeBoolDataMembers. First index is species, second is type. Vector position equals the data member position in the map being read, and vector value is the position in mp_sTreeBoolDataMembers of the data member (and thus the tree index). |
|
Index positions for tree char data members. The current tree map being read may have different data member indexes, and this will help translate to mp_sTreeCharDataMembers. First index is species, second is type. Vector position equals the data member position in the map being read, and vector value is the position in mp_sTreeCharDataMembers of the data member (and thus the tree index). |
|
Index positions for tree float data members. The current tree map being read may have different data member indexes, and this will help translate to mp_sTreeFloatDataMembers. First index is species, second is type. Vector position equals the data member position in the map being read, and vector value is the position in mp_sTreeFloatDataMembers of the data member (and thus the tree index). |
|
Index positions for tree integer data members. The current tree map being read may have different data member indexes, and this will help translate to mp_sTreeIntDataMembers. First index is species, second is type. Vector position equals the data member position in the map being read, and vector value is the position in mp_sTreeIntDataMembers of the data member (and thus the tree index). |
|
Initial value: new ModelVector("Species names", "", "", 0, ModelVector.STRING)
|
|
Tree bool data members. First array index is species, second is type. The vector is a set of strings with the data member names. The position of the String in the vector corresponds to the data member code in the tree map. |
|
Tree char data members. First array index is species, second is type. The vector is a set of strings with the data member names. The position of the String in the vector corresponds to the data member code in the tree map. |
|
Tree float data members. First array index is species, second is type. The vector is a set of strings with the data member names. The position of the String in the vector corresponds to the data member code in the tree map. |
|
Tree integer data members. First array index is species, second is type. The vector is a set of strings with the data member names. The position of the String in the vector corresponds to the data member code in the tree map. |