SORTIE Core C++ Documentation
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
clTreePopulation Class Reference

TREE POPULATION CLASS - Version 1.4. More...

#include <TreePopulation.h>

Inheritance diagram for clTreePopulation:
clPopulationBase clWorkerBase

Classes

struct  speciesCodes
 For maintaining a list of species and their codes. More...
 
struct  stcOpenSearches
 Holds open tree searches. More...
 

Public Types

enum  iTreeType {
  seed, seedling, sapling, adult,
  stump, snag, woody_debris
}
 Tree life history stages, or tree type. More...
 

Public Member Functions

 ~clTreePopulation ()
 Destructor. More...
 
 clTreePopulation (clSimManager *p_oSimManager)
 Constructor. More...
 
clTreeSearchFind (std::string sArgs)
 Acquires trees which meet certain criteria. More...
 
clTreeCreateTree (float fX, float fY, int iSp, int iType, float fDiam)
 Creates a new tree and organizes it into the hash table. More...
 
clTreeKillTree (clTree *p_deadTree, deadCode iReason)
 Kills a tree. More...
 
void BarebonesDataSetup (xercesc::DOMDocument *p_oDoc)
 Reads type and species info from the parameter file. More...
 
short int TranslateSpeciesNameToCode (std::string sSpeciesName)
 Translates a species name string into its code. More...
 
std::string TranslateSpeciesCodeToName (int iSpecies)
 Translates a species code into its name string. More...
 
short int RegisterInt (std::string sLabel, int iSpecies, int iType)
 Adds an integer data member to the tree data structure. More...
 
short int RegisterFloat (std::string sLabel, int iSpecies, int iType)
 Adds a float data member to the tree data structure. More...
 
short int RegisterChar (std::string sLabel, int iSpecies, int iType)
 Adds a char data member to the tree data structure. More...
 
short int RegisterBool (std::string sLabel, int iSpecies, int iType)
 Adds a boolean data member to the tree data structure. More...
 
short int GetIntDataCode (std::string sLabel, int iSpecies, int iType)
 Gets the data code for accessing an integer tree data member. More...
 
short int GetFloatDataCode (std::string sLabel, int iSpecies, int iType)
 Gets the data code for accessing a float tree data member. More...
 
short int GetStringDataCode (std::string sLabel, int iSpecies, int iType)
 Gets the data code for accessing a string tree data member. More...
 
short int GetBoolDataCode (std::string sLabel, int iSpecies, int iType)
 Gets the data code for accessing a bool tree data member. More...
 
std::string GetIntDataLabel (short int iCode, int iSpecies, int iType)
 Gets the label for an integer tree data member. More...
 
std::string GetFloatDataLabel (short int iCode, int iSpecies, int iType)
 Gets the label for a float tree data member. More...
 
std::string GetStringDataLabel (short int iCode, int iSpecies, int iType)
 Gets the label for a string tree data member. More...
 
std::string GetBoolDataLabel (short int iCode, int iSpecies, int iType)
 Gets the label for a bool tree data member. More...
 
void DoDataUpdates ()
 Determines if the hash table needs to be sorted by checking the bDoUpdates flag, and if it does, it sorts it. More...
 
void EmptyHashTable ()
 Deletes all trees from the hash table without deleting the table itself. More...
 
void SortHashTable ()
 Sorts the hash table by height. More...
 
float GetRandomDiam10Value (float fDiam10Seed=0)
 Gets a random diameter at 10 cm value for a seedling. More...
 
short int GetXCode (int iSpecies, int iType)
 Gets the code for the "X" data member, which is registered by the tree population. More...
 
short int GetYCode (int iSpecies, int iType)
 Gets the code for the "Y" data member, which is registered by the tree population. More...
 
short int GetHeightCode (int iSpecies, int iType)
 Gets the code for the "Height" data member, which is registered by the tree population. More...
 
short int GetDbhCode (int iSpecies, int iType)
 Gets the code for the "DBH" data member, which is registered by the tree population. More...
 
short int GetDiam10Code (int iSpecies, int iType)
 Gets the code for the "Diam10" data member, which is registered by the tree population. More...
 
short int GetCrownRadiusCode (int iSpecies, int iType)
 Gets the code for the "Crown Radius" data member, which is registered by the tree population. More...
 
short int GetCrownDepthCode (int iSpecies, int iType)
 Gets the code for the "Crown Depth" data member, which is registered by the tree population. More...
 
short int GetWhyDeadCode (int iSpecies)
 Gets the code for the "Why dead" snag data member, which is registered by the tree population. More...
 
short int GetAgeCode (int iSpecies)
 Gets the code for the "Age" snag data member, which is registered by the tree population. More...
 
float GetMinAdultDBH (int iSpecies)
 Gets the minimum adult DBH. More...
 
clAllometryGetAllometryObject ()
 Gets the allometry object. More...
 
int GetNumberOfSpecies ()
 Gets the total number of species. More...
 
int GetNumberOfTypes ()
 Gets the total number of tree types (life history stages). More...
 
int GetGridCellSize ()
 Gets the tree population internal grid cell size (grids are square). More...
 
int GetNumXCells ()
 Gets the number of cells in the X direction for the tree population's internal tree organizational grid. More...
 
int GetNumYCells ()
 Gets the number of cells in the Y direction for the tree population's internal tree organizational grid. More...
 
bool GetUsesSnags ()
 Gets whether or not this run uses snags. More...
 
float GetXPlotLength ()
 Gets the length in the X direction of the tree's internal grid (should match the value received from the plot object). More...
 
float GetYPlotLength ()
 Gets the length in the Y direction of the tree's internal grid (should match the value received from the plot object). More...
 
float GetMaxSeedlingHeight (int iSpecies)
 Gets the maximum possible seedling height for a species. More...
 
float GetMinimumAdultHeight ()
 Gets the minimum possible adult height. More...
 
float GetNewSeedlingDiam10 ()
 Gets the default new seedling diameter at 10 cm. More...
 
float GetMaxSaplingHeight ()
 Gets the max sapling height. More...
 
clTreeGetShortestTreeInCell (int iX, int iY)
 Allows direct access to the tree hash table. More...
 
clTreeGetTallestTreeInCell (int iX, int iY)
 Allows direct access to the tree hash table. More...
 
clTreeGetShortestInCellHeightDiv (int iX, int iY, int iDiv)
 
clTreeGetTallestInCellHeightDiv (int iX, int iY, int iDiv)
 
clTreeGetFirstStump ()
 Gets first stump in the stump linked list. More...
 
- Public Member Functions inherited from clPopulationBase
virtual ~clPopulationBase ()
 Destructor. More...
 
 clPopulationBase (clSimManager *p_oSimManager)
 Constructor. More...
 
- Public Member Functions inherited from clWorkerBase
 clWorkerBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clWorkerBase ()
 Destructor. More...
 
std::string GetName ()
 Gets the object's namestring. More...
 
clSimManagerGetSimManager ()
 
void DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType)
 Triggers the setup process. More...
 
virtual void EndOfRunCleanup ()
 Performs any necessary cleanup operations at the end of a run. More...
 

Protected Member Functions

void DataMemberRegistrations ()
 Triggers the tree data member registration process for all behaviors. More...
 
void GetData (xercesc::DOMDocument *p_oDoc)
 Performs setup. More...
 
void TimestepCleanup ()
 Performs end-of-timestep cleanup tasks. More...
 
void GetPlotDimensions ()
 Retrieves the plot dimensions. More...
 
void SetupCalculations ()
 Performs setup calculations. More...
 
void CreateHashTable ()
 Allocates memory for the hash table. More...
 
short int RegisterDataMember (std::string sLabel, int iSpecies, int iType, short int **p_iNumTreeVals, std::string ***p_sLabels)
 Core function for registering new tree data members. More...
 
void DoTreeDataStructureSetup ()
 Queries all behaviors for data members that they wish to add to the tree's data structure. More...
 
void ReadParameters (xercesc::DOMDocument *p_oDoc)
 Allocates memory and reads data from the parameter file into arrays. More...
 
void CreateTreesFromInitialDensities (xercesc::DOMDocument *p_oDoc)
 Creates trees according to initial density information in an input file. More...
 
void CreateTreesFromTreeMap (xercesc::DOMDocument *p_oDoc)
 Creates trees according to tree map information in an input file. More...
 
void CreateTreesFromTextTreeMap (xercesc::DOMDocument *p_oDoc)
 Creates trees by reading in a text tree map, if such a map has been specified. More...
 
void AddTreeToHashTable (clTree *p_oNewTree)
 Adds a tree to the hash table. More...
 
void UpdateTreeInHashTable (clTree *p_oChangedTree)
 Updates a tree's position in the hash table. More...
 
void RemoveTreeFromHashTable (clTree *p_oByeTree)
 Removes a tree from the hash table. More...
 
void DeleteStumps ()
 Deletes stumps from the stump linked list and sets the linked list pointer to NULL. More...
 
void ChangeTreeType (clTree *p_oTree, enum iTreeType iNewType)
 Changes a tree's type (life history stage). More...
 
void UpdateTree (clTree *p_oTree, short int iCode, int iValue)
 Updates an integer data member of a tree. More...
 
void UpdateTree (clTree *p_oTree, short int iCode, float fValue, bool bUpdateNow, bool bUpdateAllometry)
 Updates a float data member of a tree. More...
 
void UpdateTree (clTree *p_oTree, short int iCode, std::string sValue)
 Updates a char data member of a tree. More...
 
void UpdateTree (clTree *p_oTree, short int iCode, bool bValue)
 Updates a bool data member of a tree. More...
 
- Protected Member Functions inherited from clWorkerBase
void AssembleFileCode (int iFileType, int iFileVersion, char *cCode)
 Creates the proper identifying filecode for an XML file. More...
 

Protected Attributes

struct clTreePopulation::stcOpenSearchesmp_openSearches
 The linked list of open search requests. More...
 
double m_fNewSeedlingDiam10
 New diameter at 10 cm for seedlings. More...
 
float m_fMinAdultHeight
 Shortest possible adult tree height, in meters. More...
 
float m_fMaxSaplingHeight
 Maximum possible height a sapling can have, in meters. More...
 
double * mp_fMaxSeedlingHeight
 Maximum possible seedling height, in meters. More...
 
double * mp_fMinAdultDbh
 Minimum adult DBH, in cm, for each species. More...
 
float m_fPlotLengthX
 Plot length in X dimension, in meters. More...
 
float m_fPlotLengthY
 Plot length in Y dimension, in meters. More...
 
float * mp_fSizeClasses
 Size classes for live trees. More...
 
int m_iNumHeightDivs
 Number of height divisions in tree hash table. More...
 
int m_iSizeHeightDivs
 size of height divisions in tree hash table, in meters. More...
 
int m_iNumSpecies
 Number of species. More...
 
int m_iNumTypes
 Number of tree types (life history stages). More...
 
int m_iNumXCells
 Mumber of tree population internal grid cells in the X direction. More...
 
int m_iNumYCells
 Mumber of tree population internal grid cells in the Y direction. More...
 
int m_iNumSizeClasses
 Number of tree size classes defined. More...
 
int m_iLengthGrids
 Length of internal grid cells, in meters. More...
 
bool m_bDoUpdates
 Whether or not to sort the hash table when DoDataUpdates is called. More...
 
bool * mp_bMakeStump
 Whether a harvested tree should be made into a stump, for each species. More...
 
bool m_bMakeSnag
 Whether a dead adult should be made into a snag. More...
 
short int ** mp_iNumTreeIntVals
 Number of tree integer data members that have been defined for this run. More...
 
short int ** mp_iNumTreeFloatVals
 Number of tree float data members that have been defined for this run. More...
 
short int ** mp_iNumTreeStringVals
 Number of tree string data members that have been defined for this run. More...
 
short int ** mp_iNumTreeBoolVals
 Number of tree bool data members that have been defined for this run. More...
 
std::string *** mp_sIntLabels
 List of tree integer data member labels. More...
 
std::string *** mp_sFloatLabels
 List of tree float data member labels. More...
 
std::string *** mp_sStringLabels
 List of tree string data member labels. More...
 
std::string *** mp_sBoolLabels
 List of tree bool data member labels. More...
 
short int ** mp_iXCode
 Codes for "X" tree data member. More...
 
short int ** mp_iYCode
 Codes for "Y" tree data member. More...
 
short int ** mp_iHeightCode
 Codes for "Height" tree data member. More...
 
short int ** mp_iDiam10Code
 Codes for "Diam10" tree data member. More...
 
short int ** mp_iDbhCode
 Codes for "DBH" tree data member. More...
 
short int ** mp_iCrownRadCode
 Codes for "Crown Radius" tree data member. More...
 
short int ** mp_iCrownDepthCode
 Codes for "Crown Depth" tree data member. More...
 
short int * mp_iAgeCode
 Codes for "Age" snag tree data member. More...
 
short int * mp_iWhyDeadCode
 Codes for "Why dead" snag tree data member. More...
 
speciesCodesmp_speciesCodes
 List of species codes and names. More...
 
clAllometrymp_oAllom
 Allometry object. More...
 
clTree **** mp_oTreeTallest
 Hash table of tallest tree links. More...
 
clTree **** mp_oTreeShortest
 Hash table of shortest tree links. More...
 
clTreemp_oStumps
 Linked list of stumps. More...
 
clGhostTreePopulationmp_oGhosts
 Link to the ghost population. More...
 
- Protected Attributes inherited from clWorkerBase
std::string m_sNameString
 If a behavior has registered a command line command with the sim manager, this allows it to be called. More...
 
clSimManagermp_oSimManager
 Pointer to the simulation manager object. More...
 
int * mp_iAllowedFileTypes
 List of the input file types this object can handle. More...
 
int m_iNumAllowedTypes
 Number of input file types this object can handle. More...
 

Private Member Functions

 clTreePopulation (const clTreePopulation &oldPop)
 Copy constructor. More...
 

Friends

class clTreeSearch
 
class clTree
 
class clAllometry
 

Detailed Description

TREE POPULATION CLASS - Version 1.4.

The tree population class encapsulates all the types of trees and provides a common interface for accessing them. The trees are organized into a hash table. The trees are organized spatially in an internal grid and then by height within that grid. All seedlings, saplings, adults, and snags appear in the hash table. Stumps are organized separately since they have no height (if they are even used at all); seeds and woody debris currently don't exist.

When behavior objects operate on trees, they receive a pointer to the tree population in order to do so. Then they use the search method to get the trees they need.

Plot trees can only be created by the tree population class (if other objects want to create their own local trees for some reason, that's fine). Behaviors can ask the pop. to create seedlings (i.e. as a reproduction calculation). If it turns out to be necessary for other kinds of trees to be created then we can add those methods.

The population takes care of all organization and housekeeping skills related to trees. When a tree dies it tells the population so that the population can remove it. When a tree changes its height it tells the population so that the population can update its position in the hash table.

The hash table array holding the trees is based on grid cells of 8X8 m (no matter what the user has them set to), and the trees within each grid cell are organized by height. By far, the greatest number of searches that SORTIE has to do are distance and height searches (neighborhood searches) so the table is optimized for this. This class keeps some shortcut values calculated in order to handle other types of searches more quickly. The reason the grid is 8X8 m is because since 8 is a power of two, we can do very fast bitwise shifts instead of very slow division when we're doing grid cell calculations. (I leave it to the compiler to turn my divisions into shifts - makes the code easier to read.)

Copyright 2003 Charles D. Canham.

Author
Lora E. Murphy


Edit history:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)
November 12, 2012 - Chars became strings (LEM)

Member Enumeration Documentation

◆ iTreeType

Tree life history stages, or tree type.

Enumerator
seed 

Seed.

Currently not supported

seedling 

Trees shorter than 1.35 m tall and have no DBH.

sapling 

Trees with a DBH smaller than the minimum adult DBH for growth.

adult 

Trees with a DBH equal to or greater than the minimum adult DBH for growth.

stump 

Trees cut by harvest.

Stumps only last one timestep. They are currently only used in dispersal.

snag 

Standing dead tree.

woody_debris 

Downed dead tree.

Currently not supported.

Constructor & Destructor Documentation

◆ clTreePopulation() [1/2]

clTreePopulation::clTreePopulation ( const clTreePopulation oldPop)
private

Copy constructor.

Off limits! It's too much to try to copy all the trees, and too dangerous to allow two objects running around with pointers to the same trees.

◆ ~clTreePopulation()

clTreePopulation::~clTreePopulation ( )

Destructor.

◆ clTreePopulation() [2/2]

clTreePopulation::clTreePopulation ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerSim Manager object.

Member Function Documentation

◆ AddTreeToHashTable()

void clTreePopulation::AddTreeToHashTable ( clTree p_oNewTree)
protected

Adds a tree to the hash table.

Parameters
p_oNewTreeTree to add to hash table.

◆ BarebonesDataSetup()

void clTreePopulation::BarebonesDataSetup ( xercesc::DOMDocument *  p_oDoc)

Reads type and species info from the parameter file.

This function should be called before GetData. This is because behaviors need to validate against species and type in the CreateObjects phase.

Parameters
p_oDocDOM tree of parsed input file.

◆ ChangeTreeType()

void clTreePopulation::ChangeTreeType ( clTree p_oTree,
enum iTreeType  iNewType 
)
protected

Changes a tree's type (life history stage).

This will change a tree's type and copy over all the applicable variables. If a variable has no counterpart in the new type, it will be discarded. Allometric values will not be recalculated (with the exception of the seedling to sapling transition, where the new dbh value will be calculated and assigned).

Parameters
p_oTreeThe tree whose type will be changed
iNewTypeThe new tree type

◆ CreateHashTable()

void clTreePopulation::CreateHashTable ( )
protected

Allocates memory for the hash table.

GetPlotDimensions() must be called first.

◆ CreateTree()

clTree* clTreePopulation::CreateTree ( float  fX,
float  fY,
int  iSp,
int  iType,
float  fDiam 
)

Creates a new tree and organizes it into the hash table.

If this is supposed to be a seedling, and the diam10 creates a height taller than 1.35 m, the tree becomes a sapling. If the dbh is larger than the min adult dbh and the type is given as sapling, the tree is created as an adult.

Parameters
fXX coordinate of the new tree
fYY coordinate of the new tree
iSpSpecies number of the new tree
iTypeThe type (life history stage) of the new tree
fDiamThe diameter of the new tree. If this is a seedling, this is diam at 10 cm. For all others, this is dbh. If this is set to 0, a random diam10 is chosen.
Returns
Pointer to the newly created tree
Exceptions
BAD_DATAerror if:
  • Species is unrecognized
  • Type (life history stage) is unrecognized
  • Tree coordinates are outside of the plot

◆ CreateTreesFromInitialDensities()

void clTreePopulation::CreateTreesFromInitialDensities ( xercesc::DOMDocument *  p_oDoc)
protected

Creates trees according to initial density information in an input file.

If initial density information it is not present, no trees are created. This is not considered an error condition. In addition to as many DBH size classes as the user wants, this can also handle three height classes for seedling initial densities.

Parameters
p_oDocDOM tree of parsed input file.

◆ CreateTreesFromTextTreeMap()

void clTreePopulation::CreateTreesFromTextTreeMap ( xercesc::DOMDocument *  p_oDoc)
protected

Creates trees by reading in a text tree map, if such a map has been specified.

This type of tree map file is a tab-delimited text file, with the first row being column headers. The columns are in the following order: X, Y, Species (as a text string), Type (as a text string), Diam, and Height. If height is 0, the allometric equations will set it.

Parameters
p_oDocDOM tree of parsed input file.
Exceptions
BAD_FILEif the file can't be found. BAD_DATA if coordinates, diameters, or heights are negative, or if the species or type is unrecognized.

◆ CreateTreesFromTreeMap()

void clTreePopulation::CreateTreesFromTreeMap ( xercesc::DOMDocument *  p_oDoc)
protected

Creates trees according to tree map information in an input file.

If tree map information it is not present, no trees are created. This is not considered an error condition.

Parameters
p_oDocDOM tree of parsed input file.
Exceptions
BAD_DATAerror if the tree map data member codes do not match those already defined.

◆ DataMemberRegistrations()

void clTreePopulation::DataMemberRegistrations ( )
protected

Triggers the tree data member registration process for all behaviors.

◆ DeleteStumps()

void clTreePopulation::DeleteStumps ( )
protected

Deletes stumps from the stump linked list and sets the linked list pointer to NULL.

◆ DoDataUpdates()

void clTreePopulation::DoDataUpdates ( )
virtual

Determines if the hash table needs to be sorted by checking the bDoUpdates flag, and if it does, it sorts it.

Reimplemented from clPopulationBase.

◆ DoTreeDataStructureSetup()

void clTreePopulation::DoTreeDataStructureSetup ( )
protected

Queries all behaviors for data members that they wish to add to the tree's data structure.

The data members to be added are only added for the species and types that the behavior works on. This will also check for any behaviors that work on stumps and snags. If any are found, the appropriate bucket in mp_bMakeStump is set to true or m_bMakeSnag is set to true, respectively.

The tree population also uses this opportunity to add its own tree data member registrations. It registers "Diam10" for seedlings and saplings; "DBH" for saplings, adults, stumps, and snags; "Height" for seedlings, saplings, adults, and snags; "Age" and "Why dead" for snags; and "X" and "Y" for seedlings, saplings, adults, stumps, and snags.

◆ EmptyHashTable()

void clTreePopulation::EmptyHashTable ( )

Deletes all trees from the hash table without deleting the table itself.

◆ Find()

clTreeSearch* clTreePopulation::Find ( std::string  sArgs)

Acquires trees which meet certain criteria.

Any function needing to act on trees uses this function to find them. A clTreeSearch object is returned, and the trees can then be accessed repeatedly by calling the clTreeSearch object's NextTree() method. Stumps are not returned by this method. Use the GetFirstStump() method to access them directly.

To set up a search, a search string is passed to Find(). The string is formatted as follows: search term 1::search term 2:: ... search term n where the search terms are described below. Only those terms of interest are used; when a search term is ommitted, it is assumed that any value for that term is acceptable.

Valid terms:

  • all (all trees are returned)
  • type=seed, seedling, sapling, adult, snag, woody_debris (as ints); separate multiple choices with commas. Unrecognized type causes error to be thrown.
  • species=int(,int,int). Unrecognized species causes error to be thrown.
  • distance=float FROM x=float,y=float::height=float. This will return all trees less than the distance and greater than the height.

Type and species may be combined or separate. Distance must be alone.

Example: Find("species=0,2,3::type=1") or Find("distance=10.5 FROM x=5.5,y=5.6::height=4.5")

If no trees are found as the result of a search, the NextTree() method of the returned treeSearch object returns NULL.

Parameters
sArgsString with query terms for the search.
Exceptions
Errorif the query cannot be understood, such as an unrecognized argument or text that cannot be turned into a number.

◆ GetAgeCode()

short int clTreePopulation::GetAgeCode ( int  iSpecies)

Gets the code for the "Age" snag data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
Returns
Data member code.
Exceptions
Errorif given a bad species code.

◆ GetAllometryObject()

clAllometry* clTreePopulation::GetAllometryObject ( )
inline

Gets the allometry object.

Returns
The allometry object.

◆ GetBoolDataCode()

short int clTreePopulation::GetBoolDataCode ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Gets the data code for accessing a bool tree data member.

This code can be used for accessing its value through the tree's GetValue() and SetValue() functions. This function will not be responsible for duplicate labels.

Parameters
sLabelThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code, or -1 if the label is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetBoolDataLabel()

std::string clTreePopulation::GetBoolDataLabel ( short int  iCode,
int  iSpecies,
int  iType 
)

Gets the label for a bool tree data member.

This function will not be responsible for duplicate labels.

Parameters
iCodeThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member label, or an empty string if the code is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetCrownDepthCode()

short int clTreePopulation::GetCrownDepthCode ( int  iSpecies,
int  iType 
)

Gets the code for the "Crown Depth" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetCrownRadiusCode()

short int clTreePopulation::GetCrownRadiusCode ( int  iSpecies,
int  iType 
)

Gets the code for the "Crown Radius" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetData()

void clTreePopulation::GetData ( xercesc::DOMDocument *  p_oDoc)
protectedvirtual

Performs setup.

If the input file is a parameter file, this calls:

If the input file is a tree map or detailed output file, only the CreateTrees... functions are called.

Parameters
p_oDocDOM tree of parsed input file.

Implements clWorkerBase.

◆ GetDbhCode()

short int clTreePopulation::GetDbhCode ( int  iSpecies,
int  iType 
)

Gets the code for the "DBH" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetDiam10Code()

short int clTreePopulation::GetDiam10Code ( int  iSpecies,
int  iType 
)

Gets the code for the "Diam10" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetFirstStump()

clTree* clTreePopulation::GetFirstStump ( )
inline

Gets first stump in the stump linked list.

Returns
First stump in the stump linked list.

◆ GetFloatDataCode()

short int clTreePopulation::GetFloatDataCode ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Gets the data code for accessing a float tree data member.

This code can be used for accessing its value through the tree's GetValue() and SetValue() functions. This function will not be responsible for duplicate labels.

Parameters
sLabelThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code, or -1 if the label is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetFloatDataLabel()

std::string clTreePopulation::GetFloatDataLabel ( short int  iCode,
int  iSpecies,
int  iType 
)

Gets the label for a float tree data member.

This function will not be responsible for duplicate labels.

Parameters
iCodeThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member label, or an empty string if the code is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetGridCellSize()

int clTreePopulation::GetGridCellSize ( )
inline

Gets the tree population internal grid cell size (grids are square).

Returns
Grid cell size in meters.

◆ GetHeightCode()

short int clTreePopulation::GetHeightCode ( int  iSpecies,
int  iType 
)

Gets the code for the "Height" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetIntDataCode()

short int clTreePopulation::GetIntDataCode ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Gets the data code for accessing an integer tree data member.

This code can be used for accessing its value through the tree's GetValue() and SetValue() functions. This function will not be responsible for duplicate labels.

Parameters
sLabelThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code, or -1 if the label is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetIntDataLabel()

std::string clTreePopulation::GetIntDataLabel ( short int  iCode,
int  iSpecies,
int  iType 
)

Gets the label for an integer tree data member.

This function will not be responsible for duplicate labels.

Parameters
iCodeThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member label, or an empty string if the code is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetMaxSaplingHeight()

float clTreePopulation::GetMaxSaplingHeight ( )
inline

Gets the max sapling height.

Returns
The max sapling height.

◆ GetMaxSeedlingHeight()

float clTreePopulation::GetMaxSeedlingHeight ( int  iSpecies)
inline

Gets the maximum possible seedling height for a species.

Parameters
iSpeciesSpecies for which to get the maximum height.
Returns
Maximum possible seedling height, in meters.

◆ GetMinAdultDBH()

float clTreePopulation::GetMinAdultDBH ( int  iSpecies)

Gets the minimum adult DBH.

Parameters
iSpeciesSpecies for which to get the minimum adult DBH.
Returns
Minimum adult DBH in cm.
Exceptions
Errorif the species isn't valid.

◆ GetMinimumAdultHeight()

float clTreePopulation::GetMinimumAdultHeight ( )
inline

Gets the minimum possible adult height.

Returns
The smallest possible adult height, in meters.

◆ GetNewSeedlingDiam10()

float clTreePopulation::GetNewSeedlingDiam10 ( )
inline

Gets the default new seedling diameter at 10 cm.

Returns
Default new seedling diameter at 10 cm.

◆ GetNumberOfSpecies()

int clTreePopulation::GetNumberOfSpecies ( )
inline

Gets the total number of species.

Returns
Total number of species.

◆ GetNumberOfTypes()

int clTreePopulation::GetNumberOfTypes ( )
inline

Gets the total number of tree types (life history stages).

Returns
Total number of tree types.

◆ GetNumXCells()

int clTreePopulation::GetNumXCells ( )
inline

Gets the number of cells in the X direction for the tree population's internal tree organizational grid.

Returns
Number of cells in the X direction.

◆ GetNumYCells()

int clTreePopulation::GetNumYCells ( )
inline

Gets the number of cells in the Y direction for the tree population's internal tree organizational grid.

Returns
Number of cells in the Y direction.

◆ GetPlotDimensions()

void clTreePopulation::GetPlotDimensions ( )
protected

Retrieves the plot dimensions.

Exceptions
modelErrif the plot object cannot be found.

◆ GetRandomDiam10Value()

float clTreePopulation::GetRandomDiam10Value ( float  fDiam10Seed = 0)

Gets a random diameter at 10 cm value for a seedling.

This function slightly randomizes the diameter at 10 cm value around a "seed" value.

Parameters
fDiam10SeedThe "seed" value around which to randomize the new value. Optional. If no "seed" is passed, the new seedling diam10 value is used.
Returns
Random diameter at 10 cm.

◆ GetShortestInCellHeightDiv()

clTree* clTreePopulation::GetShortestInCellHeightDiv ( int  iX,
int  iY,
int  iDiv 
)
inline

◆ GetShortestTreeInCell()

clTree* clTreePopulation::GetShortestTreeInCell ( int  iX,
int  iY 
)

Allows direct access to the tree hash table.

Parameters
iXX cell number of tree population internal grid cell.
iYY cell number of tree population internal grid cell.
Returns
Shortest tree in the internal cell, or NULL if there are no trees in that cell.

◆ GetStringDataCode()

short int clTreePopulation::GetStringDataCode ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Gets the data code for accessing a string tree data member.

This code can be used for accessing its value through the tree's GetValue() and SetValue() functions. This function will not be responsible for duplicate labels.

Parameters
sLabelThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code, or -1 if the label is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetStringDataLabel()

std::string clTreePopulation::GetStringDataLabel ( short int  iCode,
int  iSpecies,
int  iType 
)

Gets the label for a string tree data member.

This function will not be responsible for duplicate labels.

Parameters
iCodeThe data member's label.
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member label, or an empty string if the code is unrecognized.
Exceptions
Anerror if an unrecognized species or type is passed.

◆ GetTallestInCellHeightDiv()

clTree* clTreePopulation::GetTallestInCellHeightDiv ( int  iX,
int  iY,
int  iDiv 
)
inline

◆ GetTallestTreeInCell()

clTree* clTreePopulation::GetTallestTreeInCell ( int  iX,
int  iY 
)

Allows direct access to the tree hash table.

Parameters
iXX cell number of tree population internal grid cell.
iYY cell number of tree population internal grid cell.
Returns
Tallest tree in the internal cell, or NULL if there are no trees in that cell.

◆ GetUsesSnags()

bool clTreePopulation::GetUsesSnags ( )
inline

Gets whether or not this run uses snags.

Returns
true if snags will be made from dead trees, false if they will not.

◆ GetWhyDeadCode()

short int clTreePopulation::GetWhyDeadCode ( int  iSpecies)

Gets the code for the "Why dead" snag data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
Returns
Data member code.
Exceptions
Errorif given a bad species code.

◆ GetXCode()

short int clTreePopulation::GetXCode ( int  iSpecies,
int  iType 
)

Gets the code for the "X" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetXPlotLength()

float clTreePopulation::GetXPlotLength ( )
inline

Gets the length in the X direction of the tree's internal grid (should match the value received from the plot object).

Returns
X length of plot in meters.

◆ GetYCode()

short int clTreePopulation::GetYCode ( int  iSpecies,
int  iType 
)

Gets the code for the "Y" data member, which is registered by the tree population.

Parameters
iSpeciesThe species.
iTypeThe tree type.
Returns
Data member code.
Exceptions
Errorif given bad species or type codes.

◆ GetYPlotLength()

float clTreePopulation::GetYPlotLength ( )
inline

Gets the length in the Y direction of the tree's internal grid (should match the value received from the plot object).

Returns
Y length of plot in meters.

◆ KillTree()

clTree* clTreePopulation::KillTree ( clTree p_deadTree,
deadCode  iReason 
)

Kills a tree.

What happens to the tree depends on what kind it is, why it died, and what behaviors are set up.

  • If the reason code is remove, the tree is deleted from memory.
  • If a tree is a seedling, it is deleted from memory no matter why it died.
  • If a tree is a sapling or adult, the reason killed is harvest, and the tree is of a species which makes stumps (indicated by the mp_bMakeStump flag), the tree is removed from memory and a stump of the same DBH is added to the stumps list.
  • If the tree is a sapling killed by any reason other than harvest, or if it is killed by harvest and the species does not make stumps, then it is deleted from memory.
  • If the tree is an adult killed by harvest and is of a species that does not make stumps, it is deleted from memory.
  • If the tree is an adult killed by reason "natural", "disease", "fire", "storm", or "insects", and snags are supported (m_bMakeSnags = true), the tree is replaced by a snag with the same DBH and height.
  • If the tree is an adult killed by reason "natural", "disease", "fire", "storm", or "insects", and snags are not supported (m_bMakeSnags = false), the tree is removed from memory.
  • If the tree is a snag, it is removed from memory.

No matter what the reason, a copy of the tree is transferred to the ghost tree population.

Parameters
p_deadTreeTree to delete.
iReasonWhy the tree is being deleted. This should be an enum from iWhyDead.
Returns
Tree that was killed, if it became a snag or a stump; otherwise NULL is returned.

◆ ReadParameters()

void clTreePopulation::ReadParameters ( xercesc::DOMDocument *  p_oDoc)
protected

Allocates memory and reads data from the parameter file into arrays.

◆ RegisterBool()

short int clTreePopulation::RegisterBool ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Adds a boolean data member to the tree data structure.

A behavior must only register as many data members as it indicated that it wanted to add in its new data member variables. This does not check to make sure that there is not already a variable registered with that name.

Parameters
sLabelThe name of the new data member - keep it short.
iSpeciesSpecies to register the new variable for
iTypeTree type to register the new variable for
Returns
A code that will be used to access values of that type in the future for that species/type combo. This is faster than trying to do lookups by character string.
Exceptions
ILLEGAL_OPerror if there is no more space for new data members.

◆ RegisterChar()

short int clTreePopulation::RegisterChar ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Adds a char data member to the tree data structure.

A behavior must only register as many data members as it indicated that it wanted to add in its new data member variables. This does not check to make sure that there is not already a variable registered with that name.

Parameters
sLabelThe name of the new data member - keep it short.
iSpeciesSpecies to register the new variable for
iTypeTree type to register the new variable for
Returns
A code that will be used to access values of that type in the future for that species/type combo. This is faster than trying to do lookups by character string.
Exceptions
ILLEGAL_OPerror if there is no more space for new data members.

◆ RegisterDataMember()

short int clTreePopulation::RegisterDataMember ( std::string  sLabel,
int  iSpecies,
int  iType,
short int **  p_iNumTreeVals,
std::string ***  p_sLabels 
)
protected

Core function for registering new tree data members.

Parameters
sLabelName of the new data member.
iSpeciesSpecies for which to register the new data member
iTypeTree type (life history stage) for which to register the new data member
p_iNumTreeValsPointer to the correct mp_iNumTree[x]Vals array
p_sLabelsPointer to the correct mp_s[x]Labels array
Returns
Code that will be used to access values of that type in the future for that species/type combo. This is faster than trying to do lookups by character string.
Exceptions
BAD_DATAor ILLEGAL_OP error if the registration was unsuccessful.

◆ RegisterFloat()

short int clTreePopulation::RegisterFloat ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Adds a float data member to the tree data structure.

A behavior must only register as many data members as it indicated that it wanted to add in its new data member variables. This does not check to make sure that there is not already a variable registered with that name.

Parameters
sLabelThe name of the new data member - keep it short.
iSpeciesSpecies to register the new variable for
iTypeTree type to register the new variable for
Returns
A code that will be used to access values of that type in the future for that species/type combo. This is faster than trying to do lookups by character string.
Exceptions
ILLEGAL_OPerror if there is no more space for new data members.

◆ RegisterInt()

short int clTreePopulation::RegisterInt ( std::string  sLabel,
int  iSpecies,
int  iType 
)

Adds an integer data member to the tree data structure.

A behavior must only register as many data members as it indicated that it wanted to add in its new data member variables. This does not check to make sure that there is not already a variable registered with that name.

Parameters
sLabelThe name of the new data member - keep it short.
iSpeciesSpecies to register the new variable for
iTypeTree type to register the new variable for
Returns
A code that will be used to access values of that type in the future for that species/type combo. This is faster than trying to do lookups by character string.
Exceptions
ILLEGAL_OPerror if there is no more space for new data members.

◆ RemoveTreeFromHashTable()

void clTreePopulation::RemoveTreeFromHashTable ( clTree p_oByeTree)
protected

Removes a tree from the hash table.

The gap it left in the linked list is closed and the tallest/shortest markers are updated as necessary.

Parameters
p_oByeTreeTree to remove from hash table.

◆ SetupCalculations()

void clTreePopulation::SetupCalculations ( )
protected

Performs setup calculations.

This function creates the clAllometry object, and calculates m_fMinAdultHeight and m_fMaxSaplingHeight.

◆ SortHashTable()

void clTreePopulation::SortHashTable ( )

Sorts the hash table by height.

This does a complete sort of the entire hash table using the Insertion Sort algorithm, which is good for almost-sorted datasets, which the hash table probably will be. This function will be used to sort the hash table if a behavior has been updating trees and has let them get out of order.

◆ TimestepCleanup()

void clTreePopulation::TimestepCleanup ( )
protectedvirtual

Performs end-of-timestep cleanup tasks.

  • Deletes all open tree searches from the last timestep
  • Deletes all stumps.
  • Updates the ages of all snags in years.
  • Resets all crown radius and depth values to -1.

Reimplemented from clWorkerBase.

◆ TranslateSpeciesCodeToName()

std::string clTreePopulation::TranslateSpeciesCodeToName ( int  iSpecies)

Translates a species code into its name string.

Parameters
iSpeciesSpecies code to translate.
Returns
Name string of species, or empty string if the code isn't recognized.

◆ TranslateSpeciesNameToCode()

short int clTreePopulation::TranslateSpeciesNameToCode ( std::string  sSpeciesName)

Translates a species name string into its code.

Parameters
sSpeciesNameSpecies name to translate.
Returns
Code of the species, or -1 if the species isn't recognized.

◆ UpdateTree() [1/4]

void clTreePopulation::UpdateTree ( clTree p_oTree,
short int  iCode,
int  iValue 
)
protected

Updates an integer data member of a tree.

If a tree receives a request to be updated, it passes it off to the tree population using this function.

Parameters
p_oTreeThe tree to be updated.
iCodeThe data member code - as passed to the tree.
iValueThe new value - as passed to the tree.
Exceptions
modelErrif the code is invalid.

◆ UpdateTree() [2/4]

void clTreePopulation::UpdateTree ( clTree p_oTree,
short int  iCode,
float  fValue,
bool  bUpdateNow,
bool  bUpdateAllometry 
)
protected

Updates a float data member of a tree.

If a tree receives a request to be updated, it passes it off to the tree population using this function. The default is for this function to update the other parameters based on allometric relationships (for instance, if DBH is changed, height will automatically be updated too). If the update causes a tree move to a new life history stage, it will automatically be transitioned. So, if setting a value of either diam10 or height on a seedling causes it to be greater than the seedling height cutoff, the tree will become a sapling and all of its allometric parameters will be recalculated to match the value that was set.

You can override automatic allometry updating. If you do that, be aware that none of the other tree data members will be updated and you will need to do that yourself. (THERE IS ONE EXCEPTION. For saplings, DBH and diam10 are always kept in sync.) Be especially careful when there is a possibility of tree type transition. If the tree is a seedling and you set its height to a value greater than the height cutoff, it will transition, but its diam10 will not change. If the tree is a sapling and you set its DBH to be greater than the minimum adult DBH, it will transition. The setting of any other value will not cause transition. So, if you give a seedling a diam10 value that would, under automatic allometry updating, give it a height greater than the cutoff and cause it to become a sapling, the seedling will not become a sapling unless you explicitly set the height too.

Parameters
p_oTreeThe tree to be updated.
iCodeThe data member code - as passed to the tree.
fValueThe new value - as passed to the tree.
bUpdateNowWhether or not the tree's hash table needs to be updated right away. If not, the hash table will be updated all at once later.
bUpdateAllometryIf the change involves allometric changes, whether or not to automatically update the tree's other dimensions. For example, if this is set to false and you are updating a DBH value, tree height will not automatically be re-calculated.
Exceptions
modelErrif the code is invalid, or if an X or Y value is trying to be changed.

◆ UpdateTree() [3/4]

void clTreePopulation::UpdateTree ( clTree p_oTree,
short int  iCode,
std::string  sValue 
)
protected

Updates a char data member of a tree.

If a tree receives a request to be updated, it passes it off to the tree population using this function.

Parameters
p_oTreeThe tree to be updated.
iCodeThe data member code - as passed to the tree.
sValueThe new value - as passed to the tree.
Exceptions
modelErrif the code is invalid.

◆ UpdateTree() [4/4]

void clTreePopulation::UpdateTree ( clTree p_oTree,
short int  iCode,
bool  bValue 
)
protected

Updates a bool data member of a tree.

If a tree receives a request to be updated, it passes it off to the tree population using this function.

Parameters
p_oTreeThe tree to be updated.
iCodeThe data member code - as passed to the tree.
bValueThe new value - as passed to the tree.
Exceptions
modelErrif the code is invalid.

◆ UpdateTreeInHashTable()

void clTreePopulation::UpdateTreeInHashTable ( clTree p_oChangedTree)
inlineprotected

Updates a tree's position in the hash table.

p_oChangedTree Tree whose position is to be updated.

Friends And Related Function Documentation

◆ clAllometry

friend class clAllometry
friend

◆ clTree

friend class clTree
friend

◆ clTreeSearch

friend class clTreeSearch
friend

Member Data Documentation

◆ m_bDoUpdates

bool clTreePopulation::m_bDoUpdates
protected

Whether or not to sort the hash table when DoDataUpdates is called.

◆ m_bMakeSnag

bool clTreePopulation::m_bMakeSnag
protected

Whether a dead adult should be made into a snag.

◆ m_fMaxSaplingHeight

float clTreePopulation::m_fMaxSaplingHeight
protected

Maximum possible height a sapling can have, in meters.

In practice this number is actually a smidge taller than the tallest height.

◆ m_fMinAdultHeight

float clTreePopulation::m_fMinAdultHeight
protected

Shortest possible adult tree height, in meters.

◆ m_fNewSeedlingDiam10

double clTreePopulation::m_fNewSeedlingDiam10
protected

New diameter at 10 cm for seedlings.

Actual values are randomized around this value. From the parameter file.

◆ m_fPlotLengthX

float clTreePopulation::m_fPlotLengthX
protected

Plot length in X dimension, in meters.

◆ m_fPlotLengthY

float clTreePopulation::m_fPlotLengthY
protected

Plot length in Y dimension, in meters.

◆ m_iLengthGrids

int clTreePopulation::m_iLengthGrids
protected

Length of internal grid cells, in meters.

Make this always a power of 2!

◆ m_iNumHeightDivs

int clTreePopulation::m_iNumHeightDivs
protected

Number of height divisions in tree hash table.

◆ m_iNumSizeClasses

int clTreePopulation::m_iNumSizeClasses
protected

Number of tree size classes defined.

◆ m_iNumSpecies

int clTreePopulation::m_iNumSpecies
protected

Number of species.

From parameter file.

◆ m_iNumTypes

int clTreePopulation::m_iNumTypes
protected

Number of tree types (life history stages).

◆ m_iNumXCells

int clTreePopulation::m_iNumXCells
protected

Mumber of tree population internal grid cells in the X direction.

◆ m_iNumYCells

int clTreePopulation::m_iNumYCells
protected

Mumber of tree population internal grid cells in the Y direction.

◆ m_iSizeHeightDivs

int clTreePopulation::m_iSizeHeightDivs
protected

size of height divisions in tree hash table, in meters.

◆ mp_bMakeStump

bool* clTreePopulation::mp_bMakeStump
protected

Whether a harvested tree should be made into a stump, for each species.

◆ mp_fMaxSeedlingHeight

double* clTreePopulation::mp_fMaxSeedlingHeight
protected

Maximum possible seedling height, in meters.

◆ mp_fMinAdultDbh

double* clTreePopulation::mp_fMinAdultDbh
protected

Minimum adult DBH, in cm, for each species.

From parameter file.

◆ mp_fSizeClasses

float* clTreePopulation::mp_fSizeClasses
protected

Size classes for live trees.

Number of size classes is user-settable. The value in each bin of the array is the upper limit in cm of the dbh for that class. There can also be a size class each for seeds and seedlings.

◆ mp_iAgeCode

short int* clTreePopulation::mp_iAgeCode
protected

Codes for "Age" snag tree data member.

Array size is number of species.

◆ mp_iCrownDepthCode

short int** clTreePopulation::mp_iCrownDepthCode
protected

Codes for "Crown Depth" tree data member.

Array size is number of species by number of types.

◆ mp_iCrownRadCode

short int** clTreePopulation::mp_iCrownRadCode
protected

Codes for "Crown Radius" tree data member.

Array size is number of species by number of types.

◆ mp_iDbhCode

short int** clTreePopulation::mp_iDbhCode
protected

Codes for "DBH" tree data member.

Array size is number of species by number of types.

◆ mp_iDiam10Code

short int** clTreePopulation::mp_iDiam10Code
protected

Codes for "Diam10" tree data member.

Array size is number of species by number of types.

◆ mp_iHeightCode

short int** clTreePopulation::mp_iHeightCode
protected

Codes for "Height" tree data member.

Array size is number of species by number of types.

◆ mp_iNumTreeBoolVals

short int** clTreePopulation::mp_iNumTreeBoolVals
protected

Number of tree bool data members that have been defined for this run.

Array size is number of species by number of types.

◆ mp_iNumTreeFloatVals

short int** clTreePopulation::mp_iNumTreeFloatVals
protected

Number of tree float data members that have been defined for this run.

Array size is number of species by number of types.

◆ mp_iNumTreeIntVals

short int** clTreePopulation::mp_iNumTreeIntVals
protected

Number of tree integer data members that have been defined for this run.

Array size is number of species by number of types.

◆ mp_iNumTreeStringVals

short int** clTreePopulation::mp_iNumTreeStringVals
protected

Number of tree string data members that have been defined for this run.

Array size is number of species by number of types.

◆ mp_iWhyDeadCode

short int* clTreePopulation::mp_iWhyDeadCode
protected

Codes for "Why dead" snag tree data member.

Array size is number of species.

◆ mp_iXCode

short int** clTreePopulation::mp_iXCode
protected

Codes for "X" tree data member.

Array size is number of species by number of types.

◆ mp_iYCode

short int** clTreePopulation::mp_iYCode
protected

Codes for "Y" tree data member.

Array size is number of species by number of types.

◆ mp_oAllom

clAllometry* clTreePopulation::mp_oAllom
protected

Allometry object.

◆ mp_oGhosts

clGhostTreePopulation* clTreePopulation::mp_oGhosts
protected

Link to the ghost population.

◆ mp_openSearches

struct clTreePopulation::stcOpenSearches * clTreePopulation::mp_openSearches
protected

The linked list of open search requests.

The first record is always a dummy record.

◆ mp_oStumps

clTree* clTreePopulation::mp_oStumps
protected

Linked list of stumps.

Not sorted in any way.

◆ mp_oTreeShortest

clTree**** clTreePopulation::mp_oTreeShortest
protected

Hash table of shortest tree links.

Array size is number of X grid cells by number of Y grid cells by number of height divisions. For instance, [2][3] is the grid cell which runs from X = 16-23 m and Y = 24-31 m. The tree pointer starts at the shortest, and the tree's "taller" pointer can be used to run downwards through all the trees in the cell. Tree taller pointers run across height divisions.

◆ mp_oTreeTallest

clTree**** clTreePopulation::mp_oTreeTallest
protected

Hash table of tallest tree links.

Array size is number of X grid cells by number of Y grid cells by number of height divisions. For instance, [2][3] is the grid cell which runs from X = 16-23 m and Y = 24-31 m. The tree pointer starts at the tallest, and the tree's "shorter" pointer can be used to run downwards through all the trees in the cell. Tree shorter pointers run across height divisions.

◆ mp_sBoolLabels

std::string*** clTreePopulation::mp_sBoolLabels
protected

List of tree bool data member labels.

Array size is number of species by number of types by number of integer data members. The code for a data member equals the third array index.

◆ mp_sFloatLabels

std::string*** clTreePopulation::mp_sFloatLabels
protected

List of tree float data member labels.

Array size is number of species by number of types by number of integer data members. The code for a data member equals the third array index.

◆ mp_sIntLabels

std::string*** clTreePopulation::mp_sIntLabels
protected

List of tree integer data member labels.

Array size is number of species by number of types by number of integer data members. The code for a data member equals the third array index.

◆ mp_speciesCodes

speciesCodes* clTreePopulation::mp_speciesCodes
protected

List of species codes and names.

◆ mp_sStringLabels

std::string*** clTreePopulation::mp_sStringLabels
protected

List of tree string data member labels.

Array size is number of species by number of types by number of integer data members. The code for a data member equals the third array index.


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