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

This class tests substrate. More...

#include <TestSubstrate.h>

Inheritance diagram for clTestSubstrate:

Public Member Functions

void TestSubstrate ()
 Groups the other substrate tests.
 

Protected Member Functions

void TestTreeFall (clSimManager *p_oSimManager)
 Tests tree fall.
 
void TestSubstrateGridSetup (clSimManager *p_oSimManager)
 Tests aspects of substrate grid setup.
 
void TestHarvestSubstrate (clSimManager *p_oSimManager)
 Verifies that harvest substrate is calculated correctly.
 
void TestSubstrateRun1 (clSimManager *p_oSimManager)
 Substrate normal processing run 1.
 
void TestSubstrateRun2 (clSimManager *p_oSimManager)
 Substrate normal processing, run 2.
 
void TestSubstrateRun3 (clSimManager *p_oSimManager)
 Substrate normal processing run 3.
 
void TestSubstrateRun4 (clSimManager *p_oSimManager)
 Substrate normal processing run 4.
 
void VerifyRun1TS1Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS2Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 2 of TestSubstrateRun1().
 
void VerifyRun1TS3Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 3 of TestSubstrateRun1().
 
void VerifyRun1TS4Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 4 of TestSubstrateRun1().
 
void VerifyRun1TS1Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS2Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 2 of TestSubstrateRun1().
 
void VerifyRun1TS3Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 3 of TestSubstrateRun1().
 
void VerifyRun1TS4Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 4 of TestSubstrateRun1().
 
void VerifyRun1TS1Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS2Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 2 of TestSubstrateRun1().
 
void VerifyRun1TS3Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 3 of TestSubstrateRun1().
 
void VerifyRun1TS4Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 4 of TestSubstrateRun1().
 
void VerifyRun1TS1SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS2SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS3SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS4SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().
 
void VerifyRun2TS1Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 1 of TestSubstrateRun2().
 
void VerifyRun2TS2Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 2 of TestSubstrateRun2().
 
void VerifyRun2TS3Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 3 of TestSubstrateRun2().
 
void VerifyRun2TS4Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 4 of TestSubstrateRun2().
 
void VerifyRun2TS1Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 1 of TestSubstrateRun2().
 
void VerifyRun2TS2Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 2 of TestSubstrateRun2().
 
void VerifyRun2TS3Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 3 of TestSubstrateRun2().
 
void VerifyRun2TS4Cohorts (clGrid *p_oSubstrateGrid)
 Verifies the cohort structure for timestep 4 of TestSubstrateRun2().
 
void VerifyRun2TS1Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 1 of TestSubstrateRun2().
 
void VerifyRun2TS2Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 2 of TestSubstrateRun2().
 
void VerifyRun2TS3Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 3 of TestSubstrateRun2().
 
void VerifyRun2TS4Tipup (clGrid *p_oCalcsGrid)
 Verifies new tipup for timestep 4 of TestSubstrateRun2().
 
void VerifyRun2TS1SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().
 
void VerifyRun2TS2SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().
 
void VerifyRun2TS3SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().
 
void VerifyRun2TS4SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().
 
void VerifyRun4TS1Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 1 of TestSubstrateRun4().
 
void VerifyRun4TS2Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 2 of TestSubstrateRun4().
 
void VerifyRun4TS3Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 3 of TestSubstrateRun4().
 
void VerifyRun4TS4Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 4 of TestSubstrateRun4().
 
void VerifyRun4TS1SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().
 
void VerifyRun4TS2SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().
 
void VerifyRun4TS3SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().
 
void VerifyRun4TS4SubstrateArrays (clGrid *p_oCalcsGrid)
 Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().
 
const char * WriteXMLFile1 ()
 Writes a parameter file for harvest and mortality testing.
 
const char * WriteXMLFile2 ()
 Writes a file for testing normal processing run 1.
 
const char * WriteXMLFile3 ()
 Writes a file for testing normal processing run 3.
 
const char * WriteXMLFile4 ()
 Writes a parameter file for testing tree tipup.
 
const char * WriteXMLFile5 ()
 Writes a parameter file for testing tree fall.
 
const char * WriteXMLFile6 ()
 Writes a file for testing normal processing run 4.
 
void WriteCommonTreeStuff (std::fstream &oOut)
 Writes tree species information for runs of 1 species.
 

Detailed Description

This class tests substrate.

Member Function Documentation

void clTestSubstrate::TestHarvestSubstrate ( clSimManager *  p_oSimManager)
protected

Verifies that harvest substrate is calculated correctly.

WriteXMLFile1() produces all cut types in various grid cells; in those cells, the substrate proportions should match the harvest conditions, and there should be only one cohort with the harvest's conditions.

void clTestSubstrate::TestSubstrate ( )

Groups the other substrate tests.

void clTestSubstrate::TestSubstrateGridSetup ( clSimManager *  p_oSimManager)
protected

Tests aspects of substrate grid setup.

This will enter three parameter files:

  1. With harvest
  2. With no harvest and Substrate and substratecalcs grid maps
  3. With neither

In the first case, grid cell resolution should match harvest; in the second, it should be what was specified in the map; in the third, it should match the plot. This will also make sure that initial conditions have been correctly populated.

void clTestSubstrate::TestSubstrateRun1 ( clSimManager *  p_oSimManager)
protected

Substrate normal processing run 1.

Verifies substrate calculations. This run has no harvest and non-directional tree fall. This function tests that new fresh log area and new tip-up area are added correctly when trees die, that cohorts are managed correctly, and that the final substrate numbers are calculated correctly. WriteXMLFile2() is used to set up with tip-up probabilities of 1. This executes the timesteps and provides mortality (killing known trees at certain times), and then verifies grid values.

void clTestSubstrate::TestSubstrateRun2 ( clSimManager *  p_oSimManager)
protected

Substrate normal processing, run 2.

This run has harvest and has non- directional tree fall. This tests that new fresh log area and new tip-up area are added correctly when trees die, that cohorts are managed correctly, and that the final substrate numbers are calculated correctly. WriteXMLFile1() is used to set up with tip-up probabilities of 1. This also has harvests occuring in three grid cells so harvest cohorts can be tested. This executes the timesteps and provides mortality (killing known trees at certain times), and then verifies grid values.

void clTestSubstrate::TestSubstrateRun3 ( clSimManager *  p_oSimManager)
protected

Substrate normal processing run 3.

Verifies substrate calculations. This run has no harvest and directional tree fall. This function tests that new fresh log area and new tip-up area are added correctly when trees die, that cohorts are managed correctly, and that the final substrate numbers are calculated correctly. WriteXMLFile3() is used to set up with tip-up probabilities of 1. This executes the timesteps and provides mortality (killing known trees at certain times), and then verifies grid values.

void clTestSubstrate::TestSubstrateRun4 ( clSimManager *  p_oSimManager)
protected

Substrate normal processing run 4.

Verifies substrate calculations with a multi-year timestep. This run has no harvest and non-directional tree fall. WriteXMLFile6() is used to set up with tip-up probabilities of 1. This executes the timesteps and provides mortality (killing known trees at certain times), and then verifies grid values.

void clTestSubstrate::TestTreeFall ( clSimManager *  p_oSimManager)
protected

Tests tree fall.

This makes sure that fallen trees are removed, and standing trees have the opportunity to become snags; and that all snags fall. This uses WriteXMLFile5() to do setup. It has three species. For live trees: for species 1, 20% of dead trees fall; for species 2, 50%; and for species 3, 0%. There is a behavior which is applied to snags, to ensure standing dead trees produce snags. 1000 trees and 1000 snags are created for each species, and all are set to dead. Then one timestep is run, and the snags counted to make sure there is the proper proportion of each. Then another timestep is run to make sure the snags created from dead adults aren't "disappeared". This process is repeated for WriteXMLFile4(), but this time we're concentrating on tipup area. In this case, the whole plot is divided into six grid cells. In each one go either 1000 live trees or 1000 snags of a species. We check to make sure the right amount of organic matter is in both.

void clTestSubstrate::VerifyRun1TS1Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS1Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS1SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS1Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS2Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 2 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS2Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 2 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS2SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS2Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 2 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS3Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 3 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS3Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 3 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS3SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS3Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 3 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS4Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 4 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS4Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 4 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS4SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun1TS4Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 4 of TestSubstrateRun1().

void clTestSubstrate::VerifyRun2TS1Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS1Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS1SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS1Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS2Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 2 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS2Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 2 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS2SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS2Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 2 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS3Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 3 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS3Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 3 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS3SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS3Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 3 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS4Cohorts ( clGrid *  p_oSubstrateGrid)
protected

Verifies the cohort structure for timestep 4 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS4Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 4 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS4SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun2TS4Tipup ( clGrid *  p_oCalcsGrid)
protected

Verifies new tipup for timestep 4 of TestSubstrateRun2().

void clTestSubstrate::VerifyRun4TS1Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 1 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS1SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS2Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 2 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS2SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS3Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 3 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS3SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS4Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 4 of TestSubstrateRun4().

void clTestSubstrate::VerifyRun4TS4SubstrateArrays ( clGrid *  p_oCalcsGrid)
protected

Verifies the fresh and decayed logs arrays for timestep 1 of TestSubstrateRun4().

void clTestSubstrate::WriteCommonTreeStuff ( std::fstream &  oOut)
protected

Writes tree species information for runs of 1 species.

Starts with <trees> and ends with </allometry>.

const char* clTestSubstrate::WriteXMLFile1 ( )
protected

Writes a parameter file for harvest and mortality testing.

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

Writes a file for testing normal processing run 1.

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

Writes a file for testing normal processing run 3.

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

Writes a parameter file for testing tree tipup.

There are three species. There is a behavior which is applied to snags. The timestep length is 1 year. The substrate grid cell size is set to 45 X 45 meters.

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

Writes a parameter file for testing tree fall.

There are three species. For species 1, 20% of dead trees fall; for species 2, 50%; and for species 3, 0%. There is a behavior which is applied to snags. The timestep length is 1 year.

In order to test grid stuff, this also has no harvest defined but has Substrate and substratecalcs grid maps.

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

Writes a file for testing normal processing run 4.

Returns
Filename written.

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