clAverageLight Class Reference

Average Light - Version 1.0. More...

#include <AverageLight.h>

Inheritance diagram for clAverageLight:

clLightBase clBehaviorBase clWorkerBase List of all members.

Public Member Functions

 clAverageLight (clSimManager *p_oSimManager)
 Constructor.
void DoShellSetup (xercesc::DOMDocument *p_oDoc)
 Does setup for this behavior.
void TimestepCleanup ()
 Sets the "average calculated" flag back to false.
float CalcLightValue (clTree *p_oTree, clTreePopulation *p_oPop)
 Gets the light value for a particular tree.

Protected Member Functions

void CalculateAverage (clTreePopulation *p_oPop)
 Calculates the average light value each timestep.

Protected Attributes

clGridBasemp_oGLIMapGrid
 Grid object which holds the GLI light values to average.
clGridBasemp_oAvgLightGrid
 Grid object which holds the averaged light values.
short int m_iMapLightCode
 Return code for the "GLI" data member of the "GLI Map" grid.
short int m_iAvgLightCode
 Return code for the "GLI" data member of the "Average Light" grid.
bool m_bAvgCalculated
 Whether or not the average GLI value has been calculated this timestep.

Detailed Description

Average Light - Version 1.0.

This behavior averages light values taken over a finer scale to a coarser resolution. It gets the light levels for averaging from the GLI Map Creator's grid (class clGLIMap). This grid is called "GLI Map".

The Average Light behavior also has a grid, called "Average Light". The user sets the grid resolution on this grid to control the area over which light is averaged, up to the whole plot.

If the grid cell area of Average Light is not an exact multiple of the GLI Map grid cell area, then the averaging will be over all the cells touched by the Average Light grid, with no weighting for partial cells (see the clGridBase::GetAverageFloatValue method).

The namestring for this behavior is "averagelightshell"; the parameter file call string is "Average Light".

Copyright 2006 Charles D. Canham.

Author:
Lora E. Murphy

Edit history:
-----------------
September 6, 2006 - Created (LEM)
October 26, 2006 - Updated to do averaging over different resolutions instead of just the whole plot (LEM)


Constructor & Destructor Documentation

clAverageLight::clAverageLight ( clSimManager p_oSimManager  ) 

Constructor.

Sets the namestring.

Parameters:
p_oSimManager Sim Manager object.


Member Function Documentation

void clAverageLight::DoShellSetup ( xercesc::DOMDocument *  p_oDoc  )  [virtual]

Does setup for this behavior.

This grabs a pointer to the "GLI Map" grid and either grabs the "Average Light" grid or sets it up if it doesn't exist yet.

Parameters:
p_oDoc DOM tree of parsed input file.
Exceptions:
modelErr if the "GLI Map" grid is not present.

Reimplemented from clLightBase.

float clAverageLight::CalcLightValue ( clTree p_oTree,
clTreePopulation p_oPop 
) [virtual]

Gets the light value for a particular tree.

First, it checks to see if the average has been calculated this timestep. If not, then CalculateAverage() is called. Then the average value is returned.

Parameters:
p_oTree Tree for which to get light.
p_oPop Tree population.
Returns:
Average GLI value.

Implements clLightBase.

void clAverageLight::CalculateAverage ( clTreePopulation p_oPop  )  [protected]

Calculates the average light value each timestep.

For each cell in the "Average Light" grid, it calculates an average of the grid cells in "GLI Map" that fall within its values using clGridBase::GetAverageFloatValue. At the end, this sets m_bAvgCalculated to true.

Parameters:
p_oPop Tree population object


Member Data Documentation

clGridBase* clAverageLight::mp_oGLIMapGrid [protected]

Grid object which holds the GLI light values to average.

This grid is not created by this class, but by the clGLIMap class.

clGridBase* clAverageLight::mp_oAvgLightGrid [protected]

Grid object which holds the averaged light values.

This grid is created by this class. Its name is "Average Light" and it has one float data member, "GLI".

short int clAverageLight::m_iMapLightCode [protected]

Return code for the "GLI" data member of the "GLI Map" grid.

short int clAverageLight::m_iAvgLightCode [protected]

Return code for the "GLI" data member of the "Average Light" grid.

bool clAverageLight::m_bAvgCalculated [protected]

Whether or not the average GLI value has been calculated this timestep.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:30:42 2007 for SORTIE Core C++ Documentation by  doxygen 1.5.2