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

Tests the SnagDecomp class descended from clBehaviorBase. More...

#include <TestSnagDecomp.h>

Inheritance diagram for clTestSnagDecomp:

Public Member Functions

void TestSnagDecomp ()
 Tests the Snag Decay Class Dynamics class.
 

Protected Member Functions

void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
 
const char * WriteXMLFile1 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), run 1.
 
const char * WriteXMLFile2 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), run 2.
 
const char * WriteXMLErrorFile1 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), error condition 1.
 
const char * WriteXMLErrorFile2 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), error condition 2.
 

Detailed Description

Tests the SnagDecomp class descended from clBehaviorBase.

Author
Mark Vanderwel

Member Function Documentation

void clTestSnagDecomp::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing.

This uses WriteXMLErrorFileX() to introduce errors and makes sure that they are caught.

void clTestSnagDecomp::TestSnagDecomp ( )

Tests the Snag Decay Class Dynamics class.

WriteXMLFile1() and WriteXMLFile2() create separate parameter file. The files have the following common characteristics:

  • Timestep length of 5 years.
  • 1 species used: ACSA

WriteXMLFile1() tests the snag fall function under harvesting, as follows:

  • 22500 live trees and 5600 decay class 1 snags are created.
  • The model is run for 1 timestep.
  • 5 m2/ha is cut roughly evenly across grid cells. The dead tree remover behavior is not invoked so they do not become snags.
  • The number of snags in each decay class is counted and compared to expected results. Individual decay classes are +/- 10%, and total snags are +/- 2%.

WriteXMLFile2() tests the tree fall function, as follows:

  • 11200 live trees are created.
  • The model is run for 1 timestep.
  • 100% mortality kills all these trees.
  • The number of snags in each decay class is counted and compared to expected results. Individual decay classes are +/- 10%, and total snags are +/- 2%.

Error condition 1: WriteXMLErrorFile1() creates the paramter file. The behavior finds a negative parameter value and correctly throws an error.

Error condition 2: WriteXMLErrorFile2() creates the parameter file. The behaviour finds that the sum of transition probabilities does not add up to 1 and correctly throws an error.

const char* clTestSnagDecomp::WriteXMLErrorFile1 ( )
protected

Writes a parameter file with the specifications given for TestSnagDecomp(), error condition 1.

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

Writes a parameter file with the specifications given for TestSnagDecomp(), error condition 2.

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

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

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

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

Returns
Filename written.

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