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

Tests the clStorm class. More...

#include <TestStorm.h>

Inheritance diagram for clTestStorm:

Public Member Functions

void TestStorm ()
 Does all the storm testing.
 

Protected Member Functions

void TestNormalDeterministic (clSimManager *p_oSimManager)
 Tests normal processing for a deterministic damage pattern.
 
void TestNormalMappedDeterministic (clSimManager *p_oSimManager)
 Tests normal processing for a deterministic mapped damage pattern.
 
void TestNormalStochastic (clSimManager *p_oSimManager)
 Tests normal processing for a stochastic damage pattern.
 
void TestNormalMappedStochastic (clSimManager *p_oSimManager)
 Tests normal processing for a stochastic mapped damage pattern.
 
void TestMultiYearTimesteps (clSimManager *p_oSimManager)
 Tests multi-year timestep testing.
 
void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
 
const char * WriteXMLFile1 ()
 Writes a parameter file with the specifications given for TestNormalDeterministic().
 
const char * WriteXMLFile2 ()
 Writes a parameter file with the specifications given for TestNormalMappedDeterministic().
 
const char * WriteXMLFile3 ()
 Writes a parameter file with the specifications given for TestNormalStochastic().
 
const char * WriteXMLFile4 ()
 Writes a parameter file with the specifications given for TestNormalMappedStochastic().
 
const char * WriteXMLFile5 ()
 Writes a parameter file with the specifications given for TestMultiYearTimesteps().
 
const char * WriteXMLErrorFile1 ()
 Writes a parameter file where there are grid maps for both "Storm Damage" and "Storm Susceptibility" and the grid cell resolutions don't match.
 
const char * WriteXMLErrorFile2 ()
 Writes a parameter file where the damage pattern is set to "mapped" but there is no "Storm Susceptibility" grid map in the parameter file.
 
const char * WriteXMLErrorFile3 ()
 Writes a parameter file where not all storm interval return values are greater than 0.
 
const char * WriteXMLErrorFile4 ()
 Writes a parameter file where the value for susceptibility pattern in the parameter file is not recognized.
 
const char * WriteXMLErrorFile5 ()
 Writes a parameter file where the damage pattern is "stochastic" and there is no value for probability distribution function.
 
const char * WriteXMLErrorFile6 ()
 Writes a parameter file where the damage pattern is "stochastic" and the value for probability distribution function is not recognized.
 
const char * WriteXMLErrorFile7 ()
 Writes a parameter file where the damage pattern is "stochastic", the probability distribution function is "normal" or "lognormal", and there is no value for standard deviation.
 
const char * WriteXMLErrorFile8 ()
 Writes a parameter file where the value for stochasticity is not recognized.
 
const char * WriteXMLErrorFile9 ()
 Writes a parameter file where a scheduled storm's minimum is greater than its maximum.
 
const char * WriteXMLErrorFile10 ()
 Writes a parameter file where a scheduled storm's minimum is not between 0 and 1.
 
const char * WriteXMLErrorFile11 ()
 Writes a parameter file where a scheduled storm's maximum is not between 0 and 1.
 
void WriteCommonStuff (std::fstream &oOut)
 Writes the portion of the parameter file common to all test files.
 

Detailed Description

Tests the clStorm class.

Member Function Documentation

void clTestStorm::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing.

Tests:

  • There are grid maps for both "Storm Damage" and "Storm Susceptibility" and the grid cell resolutions don't match.
  • The damage pattern is set to "mapped" but there is no "Storm Susceptibility" grid map in the parameter file.
  • The damage pattern is set to "mapped", there is a grid map for "Storm Susceptibility" in the parameter file, but not all values are between 0 and 1.
  • Not all storm interval return values are between 0 and 1.
  • The value for storm damage pattern in the parameter file is not recognized.
  • The damage pattern is "stochastic" and there is no value for probability distribution function.
  • The damage pattern is "stochastic" and the value for probability distribution function is not recognized.
  • The damage pattern is "stochastic", the probability distribution function is "normal" or "lognormal", and there is no value for standard deviation.
  • The damage pattern is "stochastic", the probability distribution function is "negative_binomial", and there is no value for the clumping parameter.
void clTestStorm::TestMultiYearTimesteps ( clSimManager *  p_oSimManager)
protected

Tests multi-year timestep testing.

WriteXMLFile5() does setup. Here's how it goes:

  • Timestep length is 2 years.
  • Default grid cell lengths.
  • Timestep 1: 2 storm of severity 0.2-0.3. All cell values between 0.4 and 0.6. Time since last storm = 0.
  • Timestep 2: No storms. All cell values = 0. Time since last storm = 2.
  • Timestep 3: 1 storm. Time since last storm = 0.
  • Timestep 4: No storms. All cell values = 0. Time since last hurricane = 2.
  • Timestep 5: No storms. All cell values = 0. Time since last hurricane = 4.
void clTestStorm::TestNormalDeterministic ( clSimManager *  p_oSimManager)
protected

Tests normal processing for a deterministic damage pattern.

WriteXMLFile1() does setup. Here's how it goes:

  • "Storm Damage" Grid: 10 X 10 cells.
  • Storm return intervals:
    • 1 - 0
    • 2 - 1
    • 3 - 20
    • 4 - 1.00E+28
    • 5 - 13.2
    • 6 - 45
    • 7 - 50
    • 8 - 55
    • 9 - 60
    • 10 - 65
  • Pre-run: Make sure probabilities are calculated correctly. Time since last storm = 0.
  • Timestep 1: No storms. All cell values = 0. Time since last storm = 1.
  • Timestep 2: 1 storm of severity 0.4-0.5. All cell values between 0.4 and 0.5. Time since last storm = 0.
  • Timestep 3: 2 storms of severity 0.2-0.3 and 0.5-0.6. All cell values between 0.7 and 0.9. Time since last storm = 0.
  • Timestep 4: No storms. All cell values = 0. Time since last storm = 1.
  • Timestep 5: 2 storms of of severity 0.6-0.7 and 0.8-0.9. All cell values = 1. Time since last storm = 0.
  • Timesteps 6, 7, 8 No storms. All cell values 0. Time since last storm = 1, 2, 3.
Parameters
p_oSimManagerSim Manager object.
void clTestStorm::TestNormalMappedDeterministic ( clSimManager *  p_oSimManager)
protected

Tests normal processing for a deterministic mapped damage pattern.

WriteXMLFile2() does setup. Here's how it goes:

  • "Storm Damage" Grid: 5 X 3 cells. Susceptibility map values are X/10 + Y/100.
  • Timestep 1: 1 storm of severity 0.1-0.2. Cell values between (x/10 + y/100) * 0.1 and (x/10 + y/100) * 0.2.
  • Timestep 2: 3 storms of 0-0.1, 0.1-0.2, and 0.2-0.3. Cell values between (x/10 + y/100) * 0.3 and (x/10 + y/100) * 0.6.
  • Timestep 3: No storms. All cell values = 0.
  • Timestep 4: 2 storms of severity 0.6-0.7 and 0.9 - 1. All cell values between x/10 + y/100 * 1.5 and 1.
Parameters
p_oSimManagerSim Manager object.
void clTestStorm::TestNormalMappedStochastic ( clSimManager *  p_oSimManager)
protected

Tests normal processing for a stochastic mapped damage pattern.

WriteXMLFile4() does setup. Here's how it goes:

  • "Storm Damage" Grid: 5 X 3 cells. Susceptibility map values are X/10 + Y/100.
  • Timestep 1: 2 storms of severity 0.7-0.8 and 0.8-0.9. Cell values between (x/10+y/100)*1.5 and 1.
  • Timestep 2: 1 storm of severity 0.3-0.4. Cell values between (x/10+y/100)*0.3 and (x/10+y/100)*0.4.
  • Timestep 3: No storms. All cell values = 0.
void clTestStorm::TestNormalStochastic ( clSimManager *  p_oSimManager)
protected

Tests normal processing for a stochastic damage pattern.

WriteXMLFile3() does setup. Here's how it goes:

  • Grid resolution is 10X10.
  • Normal-distribute the results with a standard deviation of 0.1.
  • Storm damage indexes are the same as for TestNormalDeterministic().
  • Timestep 1: No storms. All cell values = 0.
  • Timestep 2: 2 storms of severity 0.6-0.7 and 0.8-0.9. Cell values have a mean of 1 and a max of 1.
  • Timestep 3: 1 storm of severity 0.4 - 0.5. Cell values have a mean of between 0.4 and 0.5.
Parameters
p_oSimManagerSim Manager object.
void clTestStorm::TestStorm ( )

Does all the storm testing.

void clTestStorm::WriteCommonStuff ( std::fstream &  oOut)
protected

Writes the portion of the parameter file common to all test files.

Parameters
oOutFile stream to write to.
const char* clTestStorm::WriteXMLErrorFile1 ( )
protected

Writes a parameter file where there are grid maps for both "Storm Damage" and "Storm Susceptibility" and the grid cell resolutions don't match.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile10 ( )
protected

Writes a parameter file where a scheduled storm's minimum is not between 0 and 1.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile11 ( )
protected

Writes a parameter file where a scheduled storm's maximum is not between 0 and 1.

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

Writes a parameter file where the damage pattern is set to "mapped" but there is no "Storm Susceptibility" grid map in the parameter file.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile3 ( )
protected

Writes a parameter file where not all storm interval return values are greater than 0.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile4 ( )
protected

Writes a parameter file where the value for susceptibility pattern in the parameter file is not recognized.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile5 ( )
protected

Writes a parameter file where the damage pattern is "stochastic" and there is no value for probability distribution function.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile6 ( )
protected

Writes a parameter file where the damage pattern is "stochastic" and the value for probability distribution function is not recognized.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile7 ( )
protected

Writes a parameter file where the damage pattern is "stochastic", the probability distribution function is "normal" or "lognormal", and there is no value for standard deviation.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile8 ( )
protected

Writes a parameter file where the value for stochasticity is not recognized.

Returns
Filename written.
const char* clTestStorm::WriteXMLErrorFile9 ( )
protected

Writes a parameter file where a scheduled storm's minimum is greater than its maximum.

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

Writes a parameter file with the specifications given for TestNormalDeterministic().

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

Writes a parameter file with the specifications given for TestNormalMappedDeterministic().

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

Writes a parameter file with the specifications given for TestNormalStochastic().

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

Writes a parameter file with the specifications given for TestNormalMappedStochastic().

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

Writes a parameter file with the specifications given for TestMultiYearTimesteps().

Returns
Filename written.

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