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

Tests the clResourceMortality class. More...

#include <TestResourceMortality.h>

Inheritance diagram for clTestResourceMortality:

Public Member Functions

void TestResourceMortality ()
 Tests the growth-and-resource mortality class.
 

Protected Member Functions

const char * WriteXMLFile1 ()
 Writes a parameter file with the specifications given for TestMortality(), run 1.
 
const char * WriteXMLFile2 ()
 Writes a parameter file with the specifications given for TestMortality(), run 2.
 

Detailed Description

Tests the clResourceMortality class.

Author
Lora E. Murphy

Member Function Documentation

void clTestResourceMortality::TestResourceMortality ( )

Tests the growth-and-resource mortality class.

First run: WriteXMLFile1() creates the parameter file. The file has the following characteristics:

  • Timestep length of 1 year.
  • 3 species: Species 1, Species 2, Species 3 (Species 2 isn't used).
  • Growth and resource mortality applied to saplings and adults of both species.
  • The resource grid has specified values for 4 cells.

The function does the following:

  1. 1000 trees are created of each species for both saplings and adults.
    • Saplings of species 1 all get a value of 0 in their "lgm" data member and 0 for their resource level.
    • Saplings of Species 3 all get a value of 0 in their "lgm" data member and 1.2 for their resource level.
    • Adults of Species 1 all get a value of 4 in their "lgm" data member and 0 for their resource level.
    • Adults of Species 3 all get a value of 25.1 in their "lgm" data member and 0.01 for their resource level.
  2. The model is run for 1 timestep.
  3. The remaining trees of each tree type and species are counted.
  4. The counts are compared to expected results, give or take 5% (or greater tolerance at lower numbers).

Second run: WriteXMLFile2() creates the parameter file. The file has the following characteristics:

  • Timestep length of 5 years.
  • 3 species: Species 1, Species 2, Species 3 (Species 2 isn't used).
  • Growth and resource mortality applied to saplings and adults of both species.
  • The resource grid has specified values for 4 cells.

The function does the following:

  1. 1000 trees are created of each species for both saplings and adults.
    • Saplings of species 1 all get a value of 0 in their "lgm" data member and 0 for their resource level.
    • Saplings of Species 3 all get a value of 0 in their "lgm" data member and 1.2 for their resource level.
    • Adults of Species 1 all get a value of 4 in their "lgm" data member and 0 for their resource level.
    • Adults of Species 3 all get a value of 25.1 in their "lgm" data member and 0.01 for their resource level.
  2. The model is run for 1 timestep.
  3. The remaining trees of each tree type and species are counted.
  4. The counts are compared to expected results, give or take 5% (or greater tolerance at lower numbers).
const char* clTestResourceMortality::WriteXMLFile1 ( )
protected

Writes a parameter file with the specifications given for TestMortality(), run 1.

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

Writes a parameter file with the specifications given for TestMortality(), run 2.

Returns
Filename written.

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