clTestNciGrowth Class Reference

Tests the clNciGrowth class. More...

#include <TestNciGrowth.h>

List of all members.

Public Member Functions

void TestNciGrowth ()
 Tests the clNciGrowth class.
void TestAutoHeightVsDiamOnly (clSimManager *p_oSimManager)
 Tests to make sure that the two NCI growth behaviors, diam only and auto height, work correctly.
void TestRun1 (clSimManager *p_oSimManager)
 Performs a test run of NCI growth - a Puerto-Rico-like situation.
void TestRun2 (clSimManager *p_oSimManager)
 Tests the growth 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 growth - a Puerto-Rico-like situation.
void TestRun6 (clSimManager *p_oSimManager)
 Performs a test run of NCI growth with no crowding effect (also no shading or damage - size effect only).
void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing for input files.
void TestBoundaryProcessing (clSimManager *p_oSimManager)
 Tests boundary conditions for NCI growth.

Protected Member Functions

char * WriteXMLFile1 ()
 Writes a parameter file to direct testing.
char * WriteXMLFile2 ()
 Writes a 1-year timestep file.
char * WriteXMLFile3 ()
 Writes a 3-year timestep file.
char * WriteXMLFile4 ()
 Writes a 1-year timestep file.
char * WriteXMLFile5 ()
 Writes a 3-year timestep file.
char * WriteXMLFile6 ()
 Writes a 1-timestep file for Run 3.
char * WriteXMLFile7 ()
 Writes a 3-timestep file for Run 3.
char * WriteXMLFile8 ()
 Writes a 1-timestep file for Run 4.
char * WriteXMLFile9 ()
 Writes a 3-timestep file for Run 4.
char * WriteXMLFile10 ()
 Writes a 1-timestep file for Run 5.
char * WriteXMLFile11 ()
 Writes a 3-timestep file for Run 5.
char * WriteXMLFile12 ()
 Writes a 1-timestep file for Run 6.
char * WriteXMLFile13 ()
 Writes a 3-timestep file for Run 6.
char * WriteXMLErrorFile1 ()
 Writes an error condition where max radius of neighbor effects is < 0.
char * WriteXMLErrorFile2 ()
 Writes an error condition where max growth for a species is < 0.
char * WriteXMLErrorFile3 ()
 Writes an error condition where Xb for a species = 0.
char * WriteXMLErrorFile4 ()
 Writes an error condition where X0 for a species = 0.
char * WriteXMLErrorFile5 ()
 Writes an error condition where med.
char * WriteXMLErrorFile6 ()
 Writes an error condition where med.
char * WriteXMLErrorFile7 ()
 Writes an error condition where full damage eta for a species < 0.
char * WriteXMLErrorFile8 ()
 Writes an error condition where full damage eta for a species > 1.
char * WriteXMLErrorFile9 ()
 Writes an error condition where med.
char * WriteXMLErrorFile10 ()
 Writes an error condition where med.
char * WriteXMLErrorFile11 ()
 Writes an error condition where full damage storm effect for a species < 0.
char * WriteXMLErrorFile12 ()
 Writes an error condition where full damage storm effect for a species > 1.
char * WriteXMLErrorFile13 ()
 Writes an error condition where shading is used but there is no light behavior.
char * WriteXMLErrorFile14 ()
 Writes an error condition where a neighbor DBH is less than 0.
void WriteCommonStuff (std::fstream &oOut)
 Writes common portions of the test 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.
void WriteErrorFileCommonStuff (std::fstream &oOut)
 Writes common portions of the test error parameter files (tree pop, plot, etc).


Detailed Description

Tests the clNciGrowth class.

Member Function Documentation

void clTestNciGrowth::TestNciGrowth (  ) 

Tests the clNciGrowth class.

void clTestNciGrowth::TestAutoHeightVsDiamOnly ( clSimManager *  p_oSimManager  ) 

Tests to make sure that the two NCI growth behaviors, diam only and auto height, work correctly.

WriteXMLFile1() is used to do setup. Then, this will create two trees, one of each species. Species 1 and Species 2 are identical in every way. Species 1 is assigned NCI growth as a diameter-auto, and Species 2 is assigned NCI growth as diameter-only. The two trees are assigned identical diameters and heights (heights that do not match the diameters, allometrically-speaking). The same shade will be assigned to each (0.5). Growth will be allowed to occur, and then this makes sure that the new diameters are identical but the heights are not.

Parameters:
p_oSimManager Sim Manager object to do the runs.

void clTestNciGrowth::TestRun1 ( clSimManager *  p_oSimManager  ) 

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

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

There are 8 target trees whose values will be tested according to the testing spreadsheet prepared.

Parameters:
p_oSimManager Sim Manager object to do the runs.

void clTestNciGrowth::TestRun2 ( clSimManager *  p_oSimManager  ) 

Tests the growth 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. WriteXMLFile2() is used to do setup in the first case, for a 1 year timestep. Growth is checked for two target trees. Then WriteXMLFile3() does setup for a 3 year timestep and the growth is checked for the same two trees.

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.

Parameters:
p_oSimManager Sim Manager object to do the runs.

void clTestNciGrowth::TestRun3 ( clSimManager *  p_oSimManager  ) 

Performs Test Run 3.

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

WriteXMLFile6() is used to do setup for the first run, for a 1 year timestep. Growth is checked for five target trees. Then WriteXMLFile7() does setup for a 3 year timestep and the growth is checked for the same five trees.

void clTestNciGrowth::TestRun4 ( clSimManager *  p_oSimManager  ) 

Performs Test Run 4.

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

WriteXMLFile8() is used to do setup for the first run, for a 1 year timestep. Growth is checked for five target trees. Then WriteXMLFile9() does setup for a 3 year timestep and the growth is checked for the same five trees.

void clTestNciGrowth::TestRun5 ( clSimManager *  p_oSimManager  ) 

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

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

Parameters:
p_oSimManager Sim Manager object to do the runs.

void clTestNciGrowth::TestRun6 ( clSimManager *  p_oSimManager  ) 

Performs a test run of NCI growth with no crowding effect (also no shading or damage - size effect only).

WriteXMLFile12() performs setup for a 1-year timestep; then WriteXMLFile13() performs setup for an otherwise identical 3-year timestep.

Parameters:
p_oSimManager Sim Manager object to do the runs.

void clTestNciGrowth::TestErrorProcessing ( clSimManager *  p_oSimManager  ) 

Tests error processing for input files.

Tests:

  • Max. radius of neighbor effects must be > 0
  • MaxGrowth for each species must be > 0
  • X0 (Size effect mode) for each species must be > 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 clTestNciGrowth::TestBoundaryProcessing ( clSimManager *  p_oSimManager  ) 

Tests boundary conditions for NCI growth.

Condition: The case in which two trees are at 0 distance. In this test, we don't really care what the outcome is, we just want to make sure that there isn't a divide-by-zero condition. WriteXMLFile4() is used to do setup. Then some trees are created, two of which have the exact same coordinates.

char* clTestNciGrowth::WriteXMLFile1 (  )  [protected]

Writes a parameter file to direct testing.

This contains two species, identical in all ways except Species 1 is assigned NCI growth as a diameter-auto, and Species 2 is assigned NCI growth as diameter-only.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile2 (  )  [protected]

Writes a 1-year timestep file.

This contains 3 species. NCI growth (auto-height) is assigned to adults of Species 1.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile3 (  )  [protected]

Writes a 3-year timestep file.

This contains 3 species. NCI growth (auto-height) is assigned to adults of Species 1.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile4 (  )  [protected]

Writes a 1-year timestep file.

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile5 (  )  [protected]

Writes a 3-year timestep file.

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile6 (  )  [protected]

Writes a 1-timestep file for Run 3.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile7 (  )  [protected]

Writes a 3-timestep file for Run 3.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile8 (  )  [protected]

Writes a 1-timestep file for Run 4.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile9 (  )  [protected]

Writes a 3-timestep file for Run 4.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile10 (  )  [protected]

Writes a 1-timestep file for Run 5.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile11 (  )  [protected]

Writes a 3-timestep file for Run 5.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile12 (  )  [protected]

Writes a 1-timestep file for Run 6.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLFile13 (  )  [protected]

Writes a 3-timestep file for Run 6.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile1 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile2 (  )  [protected]

Writes an error condition where max growth for a species is < 0.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile3 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile4 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile5 (  )  [protected]

Writes an error condition where med.

damage eta for a species < 0.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile6 (  )  [protected]

Writes an error condition where med.

damage eta for a species > 1.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile7 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile8 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile9 (  )  [protected]

Writes an error condition where med.

damage storm effect for a species < 0.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile10 (  )  [protected]

Writes an error condition where med.

damage storm effect for a species > 1.

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile11 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile12 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile13 (  )  [protected]

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

Returns:
Filename written.

char* clTestNciGrowth::WriteXMLErrorFile14 (  )  [protected]

Writes an error condition where a neighbor DBH is less than 0.

Returns:
Filename written.

void clTestNciGrowth::WriteCommonStuff ( std::fstream &  oOut  )  [protected]

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

Picks up right after the number of years per timestep and ends at the closing tree tag.

Parameters:
oOut File stream to write to.

void clTestNciGrowth::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:
oOut File stream to write to.

void clTestNciGrowth::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:
oOut File stream to write to.

void clTestNciGrowth::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:
oOut File stream to write to.

void clTestNciGrowth::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:
oOut File stream to write to.

void clTestNciGrowth::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:
oOut File stream to write to.

void clTestNciGrowth::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:
oOut File stream to write to.

void clTestNciGrowth::WriteErrorFileCommonStuff ( std::fstream &  oOut  )  [protected]

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

Starts at the beginning of the file and ends at the closing tree tag.

Parameters:
oOut File stream to write to.


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

Generated on Tue Apr 19 14:06:01 2011 for SORTIE C++ Test Documentation by  doxygen 1.5.6