clTestSnagDecomp Class Reference

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

#include <TestSnagDecomp.h>

List of all members.

Public Member Functions

void TestSnagDecomp ()
 Tests the snag decay class dynamics class.

Protected Member Functions

void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
char * WriteXMLFile1 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), run 1.
char * WriteXMLFile2 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), run 2.
char * WriteXMLErrorFile1 ()
 Writes a parameter file with the specifications given for TestSnagDecomp(), error condition 1.
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::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.

void clTestSnagDecomp::TestErrorProcessing ( clSimManager *  p_oSimManager  )  [protected]

Tests error processing.

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

char* clTestSnagDecomp::WriteXMLFile1 (  )  [protected]

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

Returns:
Filename written.

char* clTestSnagDecomp::WriteXMLFile2 (  )  [protected]

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

Returns:
Filename written.

char* clTestSnagDecomp::WriteXMLErrorFile1 (  )  [protected]

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

Returns:
Filename written.

char* clTestSnagDecomp::WriteXMLErrorFile2 (  )  [protected]

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

Returns:
Filename written.


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

Generated on Wed Oct 28 14:03:23 2009 for SORTIE C++ Test Documentation by  doxygen 1.5.6