SORTIE C++ Test Documentation
Public Member Functions | Private Member Functions | List of all members
clTestMastingSpatialDisperse Class Reference

This class tests the masting spatial dispersal behavior (clMastingSpatialDisperse). More...

#include <TestMastingSpatialDisperse.h>

Inheritance diagram for clTestMastingSpatialDisperse:

Public Member Functions

void TestMastingSpatialDisperse ()
 Groups all tests into one.
 

Private Member Functions

void NormalProcessingRun1 (clSimManager *p_oSimManager)
 Tests first normal processing run.
 
void NormalProcessingRun2 (clSimManager *p_oSimManager)
 Tests second normal processing run.
 
void NormalProcessingRun3 (clSimManager *p_oSimManager)
 Tests third normal processing run.
 
void NormalProcessingRun4 (clSimManager *p_oSimManager)
 Tests fourth normal processing run.
 
void NormalProcessingRun5 (clSimManager *p_oSimManager)
 Tests fifth normal processing run.
 
void CheckMastingSetup (clSimManager *p_oSimManager)
 Tests masting CDF setup.
 
void TestErrorProcessing (clSimManager *p_oSimManager)
 Makes sure errors are correctly caught on setup.
 
const char * WriteXMLFile1 ()
 Writes a parameter file for normal processing run 1.
 
const char * WriteXMLFile2 ()
 Writes a parameter file for normal processing run 2.
 
const char * WriteXMLFile3 ()
 Writes a parameter file for normal processing run 3.
 
const char * WriteXMLFile4 ()
 Writes a parameter file for normal processing run 4.
 
const char * WriteXMLFile5 (int iRandomSeed)
 Writes a parameter file for normal processing run 5.
 
const char * WriteXMLCheckFile1 ()
 Writes a file to test masting CDF setup.
 
const char * WriteXMLCheckFile2 ()
 Writes a file to test masting CDF setup.
 
const char * WriteXMLErrorFile1 ()
 Writes a file where the masting "a" parameter is zero.
 
const char * WriteXMLErrorFile2 ()
 Writes a file where the masting fraction participating is not between 0 and 1.
 
const char * WriteXMLErrorFile3 ()
 Writes a file where the non-masting fraction participating is not between 0 and 1.
 
const char * WriteXMLErrorFile4 ()
 Writes a file where the masting beta is greater than 25.
 
const char * WriteXMLErrorFile5 ()
 Writes a file where the non-masting beta is greater than 25.
 
const char * WriteXMLErrorFile6 ()
 Writes a file where the masting theta is greater than 50.
 
const char * WriteXMLErrorFile7 ()
 Writes a file where the non-masting theta is greater than 50.
 
void WriteTrees (std::fstream &oOut)
 Writes tree stuff.
 
void WriteAllometry (std::fstream &oOut)
 Writes allometry stuff.
 

Detailed Description

This class tests the masting spatial dispersal behavior (clMastingSpatialDisperse).

Member Function Documentation

void clTestMastingSpatialDisperse::CheckMastingSetup ( clSimManager *  p_oSimManager)
private

Tests masting CDF setup.

This uses WriteXMLCheckFile1() and WriteXMLCheckFile2() for setup. The first gives a CDF where the max time until mast is before the end of the run. The second gives a CDF where the max time until mast is the length of the run.

void clTestMastingSpatialDisperse::NormalProcessingRun1 ( clSimManager *  p_oSimManager)
private

Tests first normal processing run.

WriteXMLFile1() does setup. Three trees are created for the plot. The file is run for one timestep and the seedlings are counted. A certain number of each species is expected. This tests masting and mast grouping.

Parameters
p_oSimManagerSim manager object.
void clTestMastingSpatialDisperse::NormalProcessingRun2 ( clSimManager *  p_oSimManager)
private

Tests second normal processing run.

WriteXMLFile2() does setup. This is the same as run 1 except it's three years per timestep.

Parameters
p_oSimManagerSim manager object.
void clTestMastingSpatialDisperse::NormalProcessingRun3 ( clSimManager *  p_oSimManager)
private

Tests third normal processing run.

WriteXMLFile3() does setup. This tests fraction participating. It is just like run 1 except 100 trees are created for each species and the final seedling counts should reflect the number of parents that participated.

Parameters
p_oSimManagerSim manager object.
void clTestMastingSpatialDisperse::NormalProcessingRun4 ( clSimManager *  p_oSimManager)
private

Tests fourth normal processing run.

WriteXMLFile4() does setup. This tests STR draws per species vs. draws per tree. Four trees are used, 2 of each of 2 species. Species 1 is a draw per species, Species 2 is draw per tree. The two trees of species 1 should produce the same number of seedlings, and the two trees of species 2 should produce different seedlings.

Parameters
p_oSimManagerSim manager object.
void clTestMastingSpatialDisperse::NormalProcessingRun5 ( clSimManager *  p_oSimManager)
private

Tests fifth normal processing run.

WriteXMLFile5() does setup. This tests normal draws. 100 runs are done, and the mean and std deviation of the number of seedlings is calculated to see if it matches the requested.

Parameters
p_oSimManagerSim manager object.
void clTestMastingSpatialDisperse::TestErrorProcessing ( clSimManager *  p_oSimManager)
private

Makes sure errors are correctly caught on setup.

All the error parameter files are fed in to make sure the errors are trapped.

Parameters
p_oSimManagerSim manager object.
void clTestMastingSpatialDisperse::TestMastingSpatialDisperse ( )

Groups all tests into one.

void clTestMastingSpatialDisperse::WriteAllometry ( std::fstream &  oOut)
private

Writes allometry stuff.

Parameters
oOutFile stream to write to.
void clTestMastingSpatialDisperse::WriteTrees ( std::fstream &  oOut)
private

Writes tree stuff.

Parameters
oOutFile stream to write to.
const char* clTestMastingSpatialDisperse::WriteXMLCheckFile1 ( )
private

Writes a file to test masting CDF setup.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLCheckFile2 ( )
private

Writes a file to test masting CDF setup.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile1 ( )
private

Writes a file where the masting "a" parameter is zero.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile2 ( )
private

Writes a file where the masting fraction participating is not between 0 and 1.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile3 ( )
private

Writes a file where the non-masting fraction participating is not between 0 and 1.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile4 ( )
private

Writes a file where the masting beta is greater than 25.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile5 ( )
private

Writes a file where the non-masting beta is greater than 25.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile6 ( )
private

Writes a file where the masting theta is greater than 50.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLErrorFile7 ( )
private

Writes a file where the non-masting theta is greater than 50.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLFile1 ( )
private

Writes a parameter file for normal processing run 1.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLFile2 ( )
private

Writes a parameter file for normal processing run 2.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLFile3 ( )
private

Writes a parameter file for normal processing run 3.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLFile4 ( )
private

Writes a parameter file for normal processing run 4.

Returns
Filename written.
const char* clTestMastingSpatialDisperse::WriteXMLFile5 ( int  iRandomSeed)
private

Writes a parameter file for normal processing run 5.

Parameters
iRandomSeedRandom seed.
Returns
Filename written.

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