SORTIE C++ Test Documentation
Public Member Functions | Protected Member Functions | List of all members
clTestNCIMort Class Reference

Tests the clNCIMort class. More...

#include <TestNCIMort.h>

Inheritance diagram for clTestNCIMort:

Public Member Functions

void TestNCIMort ()
 Tests the clNCIMort class.
 

Protected Member Functions

void TestNormalProcessing (clSimManager *p_oSimManager)
 Calls each of the test runs.
 
void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing for input files.
 
void TestRun1 (clSimManager *p_oSimManager)
 Performs a test run of NCI mortality - a Puerto-Rico-like situation.
 
void TestRun2 (clSimManager *p_oSimManager)
 Tests the mortality calculations at two timestep lengths in a BC-like situation.
 
void TestRun3 (clSimManager *p_oSimManager)
 Performs Test Run 3.
 
void TestRun4 (clSimManager *p_oSimManager)
 Performs Test Run 4.
 
void TestRun5 (clSimManager *p_oSimManager)
 Performs a test run of NCI mortality - a Puerto-Rico-like situation.
 
void TestRun6 (clSimManager *p_oSimManager)
 Performs a test run of NCI mortality - a Puerto-Rico-like situation.
 
const char * WriteXMLFile1 ()
 Writes a 1-year timestep file.
 
const char * WriteXMLFile2 ()
 Writes a 3-year timestep file.
 
const char * WriteXMLFile3 ()
 Writes a 1-year timestep file.
 
const char * WriteXMLFile4 ()
 Writes a 3-year timestep file.
 
const char * WriteXMLFile5 ()
 Writes a 1-year timestep file for Run 3.
 
const char * WriteXMLFile6 ()
 Writes a 3-year timestep file for Run 3.
 
const char * WriteXMLFile7 ()
 Writes a 1-year timestep file for Run 4.
 
const char * WriteXMLFile8 ()
 Writes a 3-year timestep file for Run 4.
 
const char * WriteXMLFile9 ()
 Writes a 1-year timestep file for Run 5.
 
const char * WriteXMLFile10 ()
 Writes a 3-year timestep file for Run 5.
 
const char * WriteXMLFile11 ()
 Writes a 1-year timestep file for Run 6.
 
const char * WriteXMLFile12 ()
 Writes a 3-year timestep file for Run 6.
 
const char * WriteXMLErrorFile1 ()
 Writes an error condition where max radius of neighbor effects is < 0.
 
const char * WriteXMLErrorFile2 ()
 Writes an error condition where max probability for survival for a species is not between 0 and 1.
 
const char * WriteXMLErrorFile3 ()
 Writes an error condition where Xb for a species = 0.
 
const char * WriteXMLErrorFile4 ()
 Writes an error condition where X0 for a species = 0.
 
const char * WriteXMLErrorFile5 ()
 Writes an error condition where med.
 
const char * WriteXMLErrorFile6 ()
 Writes an error condition where med.
 
const char * WriteXMLErrorFile7 ()
 Writes an error condition where full damage eta for a species < 0.
 
const char * WriteXMLErrorFile8 ()
 Writes an error condition where full damage eta for a species > 1.
 
const char * WriteXMLErrorFile9 ()
 Writes an error condition where med.
 
const char * WriteXMLErrorFile10 ()
 Writes an error condition where med.
 
const char * WriteXMLErrorFile11 ()
 Writes an error condition where full damage storm effect for a species < 0.
 
const char * WriteXMLErrorFile12 ()
 Writes an error condition where full damage storm effect for a species > 1.
 
const char * WriteXMLErrorFile13 ()
 Writes an error condition where shading is used but there is no light behavior.
 
void WritePlotAndTrees (std::fstream &oOut)
 Writes common portions of the test parameter files.
 
void WriteStormParameters (std::fstream &oOut)
 Writes storm parameters.
 
void WriteCommonErrorStuff (std::fstream &oOut)
 Writes common portions of the test error parameter files (tree pop, plot, etc).
 
void WriteRun1CommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files for Run 1.
 
void WriteRun2CommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files for Run 2.
 
void WriteRun3CommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files for Run 3.
 
void WriteRun4CommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files for Run 4.
 
void WriteRun5CommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files for Run 5.
 
void WriteRun6CommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files for Run 6.
 

Detailed Description

Tests the clNCIMort class.

Member Function Documentation

void clTestNCIMort::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing for input files.

Tests:

  • Max. radius of neighbor effects must be > 0
  • Max probability of survival for each species must be 0-1
  • X0 (Size effect mode) for each species must not = 0
  • Xb (Size effect variance) for each species must not = 0
  • Eta for each species for each damage category beyond undamaged must be between 0 and 1
  • Storm Effect parameters for each species for each damage category beyond undamaged must be between 0 and 1

WriteXMLErrorFileX (where X = 1-12) is written and checked to make sure that each produces an error.

void clTestNCIMort::TestNCIMort ( )

Tests the clNCIMort class.

void clTestNCIMort::TestNormalProcessing ( clSimManager *  p_oSimManager)
protected

Calls each of the test runs.

Parameters
p_oSimManagerSim Manager object to do the runs.
void clTestNCIMort::TestRun1 ( clSimManager *  p_oSimManager)
protected

Performs a test run of NCI mortality - a Puerto-Rico-like situation.

This run has no shading effect and uses damage effect. WriteXMLFile1() performs setup for a 1-year timestep; then WriteXMLFile2() performs setup for an otherwise identical 3-year timestep.

There are 8 target trees, for which 1000 copies of each will be created. Then the remainder left after a timestep will be checked against the testing spreadsheet expected results.

Parameters
p_oSimManagerSim Manager object to do the runs.
void clTestNCIMort::TestRun2 ( clSimManager *  p_oSimManager)
protected

Tests the mortality calculations at two timestep lengths in a BC-like situation.

It uses no storm damage and simplified crowding - no size sensitivity to NCI (g = 0, d = 1). It does use Shading. WriteXMLFile3() is used to do setup in the first case, for a 1 year timestep. Mortality is checked for two target trees. Then WriteXMLFile4() does setup for a 3 year timestep.

The first target tree is too far away from the other trees to be affected. It has the lowest possible value of shade and a zero NCI. The second target tree is surrounded by 4 trees affecting shade and NCI and two which do not. 1000 copies of each are created. Then the remainder left after a timestep will be checked against the testing spreadsheet expected results.

Parameters
p_oSimManagerSim Manager object to do the runs.
void clTestNCIMort::TestRun3 ( clSimManager *  p_oSimManager)
protected

Performs Test Run 3.

This run has no storm damage, has variability in functions between species, has neighbors below the minimum neighbor DBH, and doesn't use the DBH divisor.

WriteXMLFile5() is used to do setup for the first run, for a 1 year timestep. 1000 copies are created for each of 5 target trees and the number left checked after 1 timestep. Then WriteXMLFile6() does setup for a 3 year timestep and the process is repeated.

void clTestNCIMort::TestRun4 ( clSimManager *  p_oSimManager)
protected

Performs Test Run 4.

This run tests variability in light behavior requirements, but is otherwise almost exactly like TestRun3.

WriteXMLFile7() is used to do setup for the first run, for a 1 year timestep. 1000 copies are created for each of 5 target trees and the number left checked after 1 timestep. Then WriteXMLFile8() does setup for a 3 year timestep and the process is repeated.

void clTestNCIMort::TestRun5 ( clSimManager *  p_oSimManager)
protected

Performs a test run of NCI mortality - a Puerto-Rico-like situation.

This run has no shading effect and uses damage effect. The damage applier is not applied to all species. WriteXMLFile9() performs setup for a 1-year timestep; then WriteXMLFile10() performs setup for an otherwise identical 3-year timestep.

There are 8 target trees, for which 1000 copies of each will be created. Then the remainder left after a timestep will be checked against the testing spreadsheet expected results.

Parameters
p_oSimManagerSim Manager object to do the runs.
void clTestNCIMort::TestRun6 ( clSimManager *  p_oSimManager)
protected

Performs a test run of NCI mortality - a Puerto-Rico-like situation.

This run has no shading effect and uses damage effect. The damage applier is not applied to all species. WriteXMLFile9() performs setup for a 1-year timestep; then WriteXMLFile10() performs setup for an otherwise identical 3-year timestep.

There are 8 target trees, for which 1000 copies of each will be created. Then the remainder left after a timestep will be checked against the testing spreadsheet expected results.

Parameters
p_oSimManagerSim Manager object to do the runs.
void clTestNCIMort::WriteCommonErrorStuff ( std::fstream &  oOut)
protected

Writes common portions of the test error parameter files (tree pop, plot, etc).

Parameters
oOutFile stream to write to.
void clTestNCIMort::WritePlotAndTrees ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files.

Ends with "</allometry>".

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteRun1CommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files for Run 1.

Picks up at the behavior list through the end of the file.

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteRun2CommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files for Run 2.

Picks up at the behavior list through the end of the file.

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteRun3CommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files for Run 3.

Picks up at the behavior list through the end of the file.

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteRun4CommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files for Run 4.

Picks up at the behavior list through the end of the file.

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteRun5CommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files for Run 5.

Picks up at the behavior list through the end of the file.

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteRun6CommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files for Run 6.

Picks up at the behavior list through the end of the file.

Parameters
oOutFile stream to write to.
void clTestNCIMort::WriteStormParameters ( std::fstream &  oOut)
protected

Writes storm parameters.

Everything from "<storm>" to "</storm>".

const char* clTestNCIMort::WriteXMLErrorFile1 ( )
protected

Writes an error condition where max radius of neighbor effects is < 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile10 ( )
protected

Writes an error condition where med.

damage storm effect for a species > 1.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile11 ( )
protected

Writes an error condition where full damage storm effect for a species < 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile12 ( )
protected

Writes an error condition where full damage storm effect for a species > 1.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile13 ( )
protected

Writes an error condition where shading is used but there is no light behavior.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile2 ( )
protected

Writes an error condition where max probability for survival for a species is not between 0 and 1.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile3 ( )
protected

Writes an error condition where Xb for a species = 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile4 ( )
protected

Writes an error condition where X0 for a species = 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile5 ( )
protected

Writes an error condition where med.

damage eta for a species < 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile6 ( )
protected

Writes an error condition where med.

damage eta for a species > 1.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile7 ( )
protected

Writes an error condition where full damage eta for a species < 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile8 ( )
protected

Writes an error condition where full damage eta for a species > 1.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLErrorFile9 ( )
protected

Writes an error condition where med.

damage storm effect for a species < 0.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile1 ( )
protected

Writes a 1-year timestep file.

This contains 4 species, one unused (species 3; this helps catch array-index problems). NCI mortality is assigned to all saplings and adults.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile10 ( )
protected

Writes a 3-year timestep file for Run 5.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile11 ( )
protected

Writes a 1-year timestep file for Run 6.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile12 ( )
protected

Writes a 3-year timestep file for Run 6.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile2 ( )
protected

Writes a 3-year timestep file.

This contains 4 species, one unused (species 3; this helps catch array-index problems). NCI mortality is assigned to all saplings and adults.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile3 ( )
protected

Writes a 1-year timestep file.

NCI mortality is assigned to species 1 adults.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile4 ( )
protected

Writes a 3-year timestep file.

NCI mortality is assigned to species 1 adults.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile5 ( )
protected

Writes a 1-year timestep file for Run 3.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile6 ( )
protected

Writes a 3-year timestep file for Run 3.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile7 ( )
protected

Writes a 1-year timestep file for Run 4.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile8 ( )
protected

Writes a 3-year timestep file for Run 4.

Returns
Filename written.
const char* clTestNCIMort::WriteXMLFile9 ( )
protected

Writes a 1-year timestep file for Run 5.

Returns
Filename written.

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