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

Tests the clExpResourceMortality class. More...

#include <TestExpResourceMortality.h>

Inheritance diagram for clTestExpResourceMortality:

Public Member Functions

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

Protected Member Functions

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

Detailed Description

Tests the clExpResourceMortality class.

Author
Lora E. Murphy

Member Function Documentation

void clTestExpResourceMortality::TestExpResourceMortality ( )

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.
  • 4 species: Species 1, Species 2, Species 3, Species 4 (Species 2 isn't used).
  • Growth and resource mortality applied to saplings of species 1 and 3, and adults of species 1 and 4.
  • The resource grid has specified values for 5 cells.

The function does the following:

  1. Grid 1: Resource = 0, 1000 saplings of species 1 all with a value of 0 in their "Growth" data member; 1000 each of saplings and adults of species 2.
  2. Grid 2: Resource = 0.5, 1000 adults of Species 1 all with a value of 0 in their "Growth" data member.
  3. Grid 3: Resource = 0, 1000 saplings of Species 3 all with a value of 4 in their "Growth" data member.
  4. Grid 4: Resource = 1, 1000 saplings of Species 1 all with a value of 0 in their "Growth" data member.
  5. Grid 5: Resource = 0.6, 1000 adults of Species 4 all with a value of 25.1 in their "Growth" data member.
  6. Grid 6: Resource = 3, 1000 saplings of Species 4 all with a value of 10 in their "Growth" data member.
  7. Grid 7: Resource = 5, 1000 adults of Species 3 all with a value of 14 in their "Growth" data member.
  8. The model is run for 1 timestep.
  9. The remaining trees of each tree type and species are counted.
  10. The counts are compared to expected results, give or take 5% (or greater tolerance at lower numbers).

Second run: WriteXMLFile2() creates the parameter file. Everything is exactly as it is in the first run except the timestep length is 3 years.

const char* clTestExpResourceMortality::WriteXMLFile1 ( )
protected

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

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

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

Returns
Filename written.

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