javawrapper::LightBehaviors Class Reference

Manages data for the light behaviors. More...

Inheritance diagram for javawrapper::LightBehaviors:

javawrapper::BehaviorTypeBase javawrapper::WorkerBase List of all members.

Public Member Functions

 LightBehaviors (GUIManager oManager) throws ModelException
 Constructor.
void AddGLIPointsFile (String sFileName) throws ModelException
 Adds the points from a tab-delimited text GLI points file.
void DoSetup (TreePopulation oPop) throws ModelException
 Resets the points list.
boolean SetVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, java.util.Vector p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, Attributes oParentAttributes, Attributes[] p_oAttributes) throws ModelException
 Overridden to make sure that only light values that apply to light behaviors are set.
void WriteXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException
 Writes the settings in XML to a parameter file.
void ValidateData (TreePopulation oPop) throws ModelException
 Validates the data prior to its use in, for instance, a parameter file.
void ReadXMLParentTag (String sXMLTag, Attributes oAttributes) throws ModelException
 Accepts an XML parent tag (empty, no data) from the parser.
boolean SetSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException
 Makes sure values go to the correct behavior.
Behavior GetBehaviorByXMLTag (String sXMLTag)
 Traps for the behavior replacement of radial light with constant GLI.

Static Public Attributes

static final int MID_CROWN = 0
 Value for fisheye photo taken at mid-crown - MUST match the enum value from the C++ code.
static final int CROWN_TOP = 1
 Value for fisheye photo taken at crown top - MUST match the enum value from the C++ code.
static final int ALL_HEIGHT = 0
 Value for sail light shading neighbor crown depths being approximated as extending the full height of the tree - MUST match the enum value from the C++ code.
static final int FRAC_HEIGHT = 1
 Value for sail light shading neighbor crown depths having their normal depth - MUST match the enum value from the C++ code.

Protected Attributes

ModelVector mp_fLightTransmissionCoefficient
 Species-specific - light transmission coefficient.
ModelVector mp_fSnagClass1LightTransmissionCoefficient
 Species-specific - snag age class 1 light transmission coefficient.
ModelVector mp_fSnagClass2LightTransmissionCoefficient
 Species-specific - snag age class 2 light transmission coefficient.
ModelVector mp_fSnagClass3LightTransmissionCoefficient
 Species-specific - snag age class 3 light transmission coefficient.
ModelVector mp_iBasalAreaLightWhatType
 Basal area light - tree type: angiosperm (0) or conifer (1).
ModelFloat m_fBeamFractionOfGlobalRadiation
 Beam fraction of global radiation.
ModelFloat m_fClearSkyTransmissionCoefficient
 Clear sky transmission coefficient.
ModelFloat m_fGLIMinSunAngle
 Minimum sun angle in radians.
ModelFloat m_fQuadratMinSunAngle
 Minimum sun angle in radians for quadrat, if different from GLI.
ModelFloat m_fMapMinSunAngle
 Minimum sun angle in radians for GLI map, if different from others.
ModelFloat m_fPointsMinSunAngle
 Minimum sun angle in radians for GLI points, if different from others.
ModelFloat m_fQuadratLightHeight
 Height at which GLI is calculated in quadrats.
ModelFloat m_fMapLightHeight
 Height at which GLI is calculated for GLI Map Creator.
ModelFloat m_fSailLightMaxShadingRadius
 Maximum shading radius for sail light.
ModelFloat m_fSailLightMaskAngle
 Minimum sun angle in degrees.
ModelFloat m_fFilterLightTransmissionCoefficient
 Light transmission coefficient for the light filter.
ModelFloat m_fFilterHeight
 Height of light filter, in meters.
ModelFloat m_fStmLightMaxRadius
 Storm light - max radius of storm neighbors, in meters.
ModelFloat m_fStmLightSlope
 Storm light - slope of light function.
ModelFloat m_fStmLightIntercept
 Storm light - intercept of light function.
ModelFloat m_fStmLightMinCanopyTrees
 Storm light - minimum number of trees for full canopy.
ModelFloat m_fStmLightRandPar
 Storm light - standard deviation or clumping parameter.
ModelFloat m_fBasalAreaLightA
 Basal area light "a" parameter for calculating mean GLI from basal area.
ModelFloat m_fBasalAreaLightConiferB
 Basal area light conifer "b" parameter for calculating mean GLI from basal area.
ModelFloat m_fBasalAreaLightConiferC
 Basal area light conifer "c" parameter for calculating mean GLI from basal area.
ModelFloat m_fBasalAreaLightAngiospermB
 Basal area light angiosperm "b" parameter for calculating mean GLI from basal area.
ModelFloat m_fBasalAreaLightAngiospermC
 Basal area light angiosperm "c" parameter for calculating mean GLI from basal area.
ModelFloat m_fBasalAreaLightSigma
 Basal area light sigma parameter for lognormal PDF.
ModelFloat m_fBasalAreaLightMinDBH
 Basal area light minimum DBH (cm) for a tree counting towards the basal area.
ModelFloat m_fBasalAreaLightChangeThreshold
 Basal area light basal threshold, in square meters, for new trees in grid cell for recalculating GLI.
ModelFloat m_fBasalAreaSearchRadius
 Basal area light search radius for neighbors.
ModelFloat m_fConstantGLIValue
 Constant GLI - constant GLI value.
ModelString m_sGLIPointsInFile = new ModelString("", "GLI Points Input File", "")
 GLI points creator - filename of points input file.
ModelString m_sGLIPointsOutFile = new ModelString("", "GLI Points Output File", "li_GLIPointsFilename")
 GLI points creator - filename of points output file.
ModelInt m_iStmLightMaxDmgTime
 Storm light - max time (years) for damaged trees to influence.
ModelInt m_iStmLightMaxSnagDmgTime
 Storm light - max time (years) for snags to influence.
ModelInt m_iNumGLIAziDiv
 Number of azimuth divisions in sky hemisphere for GLI light calculations.
ModelInt m_iNumGLIAltDiv
 Number of altitude divisions in sky hemisphere for GLI light calculations.
ModelInt m_iNumQuadratAziDiv
 Number of azimuth divisions for quadrat, if different from GLI.
ModelInt m_iNumMapAziDiv
 Number of azimuth divisions for GLI Map Creator, if different from GLI.
ModelInt m_iNumPointsAziDiv
 Number of azimuth divisions for GLI Points Creator, if different from GLI.
ModelInt m_iNumQuadratAltDiv
 Number of altitude divisions for quadrat, if different from GLI.
ModelInt m_iNumMapAltDiv
 Number of altitude divisions for GLI Map Creator, if different from GLI.
ModelInt m_iNumPointsAltDiv
 Number of altitude divisions for GLI Points Creator, if different from GLI.
ModelInt m_iJulianDayGrowthStarts
 Start of growing season as Julian day.
ModelInt m_iJulianDayGrowthEnds
 End of growing season as Julian day.
ModelInt m_iSnagAgeClass1
 Upper age limit of snag size class 1.
ModelInt m_iSnagAgeClass2
 Upper age limit of snag size class 2.
ModelEnum m_iHeightOfFishEyePhoto
 Height of fisheye photo - valid values are MID_CROWN and CROWN_TOP.
ModelEnum m_iCrownFractionOfHeight
 What fraction of the height of a shading neighbor its crown covers - valid values are ALL_HEIGHT or FRAC_HEIGHT.
Vector mp_oPoints = new Vector(0)
 Points objects, for GLI points.

Detailed Description

Manages data for the light behaviors.

Copyright: Copyright (c) 2003 Charles D. Canham

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
June 17, 2004: Added snag light extinction coefficients (LEM)
January 10, 2005: Added the GLI Light Map behavior (LEM)
February 8, 2005: Added the Gap Light behavior (LEM)
May 3, 2005: Added the Storm Light behavior (LEM)
December 8, 2005: Added the Density Light behavior (LEM)
March 3, 2006: Changed Density Light to Basal Area Light (LEM)
July 31, 2006: Added Constant GLI behavior (LEM)
September 11, 2006: Added the Average Light behavior (LEM)
October 31, 2006: Modified the Average Light behavior (LEM)
March 1, 2007: Added a new variable to Basal Area Light (LEM)


Constructor & Destructor Documentation

javawrapper::LightBehaviors::LightBehaviors ( GUIManager  oManager  )  throws ModelException [inline]

Constructor.

Parameters:
oManager GUIManager object.
Exceptions:
ModelException If something goes wrong in setup.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Function Documentation

void javawrapper::LightBehaviors::AddGLIPointsFile ( String  sFileName  )  throws ModelException [inline]

Adds the points from a tab-delimited text GLI points file.

Any existing points are overwritten.

Parameters:
sFileName File name of points file
Exceptions:
ModelException if:
  • A GLI coordinate is outside the plot
  • There's a negative GLI height

Edit history:
------------------
May 11, 2005: Created (LEM)

void javawrapper::LightBehaviors::DoSetup ( TreePopulation  oPop  )  throws ModelException [inline, virtual]

Resets the points list.

Parameters:
oPop Tree population
Exceptions:
ModelException Not thrown.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

Implements javawrapper::WorkerBase.

boolean javawrapper::LightBehaviors::SetVectorValueByXMLTag ( String  sXMLTag,
String  sXMLParentTag,
java.util.Vector  p_oData,
String[]  p_sChildXMLTags,
boolean[]  p_bAppliesTo,
Attributes  oParentAttributes,
Attributes[]  p_oAttributes 
) throws ModelException [inline]

Overridden to make sure that only light values that apply to light behaviors are set.

There are other behaviors with light values (like Puerto Rico establishment), and this will make sure that those parameters are not "stolen" by light.

Parameters:
sXMLTag Parent XML tag of data vector whose value is to be set.
sXMLParentTag The immediate parent tag that sXMLTag is within.
p_oData Vector of data values appropriate to the data type
p_sChildXMLTags The XML tags of the child elements
p_bAppliesTo Array of booleans saying which of the vector values should be set. This is important in the case of species-specifics - the vector index is the species number but not all species are set.
oParentAttributes Attributes of parent tag. May be useful when overridding this for unusual tags.
p_oAttributes Attributes passed from parser. This may be needed when overriding this function. Basic species-specific values are already handled by this function.
Returns:
true if the value was set successfully; false if the value could not be found. (This would not be an error, because I need a way to cycle through the objects until one of the objects comes up with a match.) If a match to a data object is made via XML tag, but the found object is not a ModelVector, this returns false.
Exceptions:
ModelException if the value could not be assigned to the data object.

Edit history:
------------------
January 7, 2005: Created (LEM)

void javawrapper::LightBehaviors::WriteXML ( BufferedWriter  jOut,
TreePopulation  oPop 
) throws ModelException [inline]

Writes the settings in XML to a parameter file.

Overridden because light is special.

Parameters:
jOut File to write to.
oPop Tree population.
Exceptions:
ModelException If the file is bad.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
January 10, 2005: Added GLI map settings (LEM)
May 11, 2005: Added special stuff for GLI points (LEM)

Reimplemented from javawrapper::BehaviorTypeBase.

void javawrapper::LightBehaviors::ValidateData ( TreePopulation  oPop  )  throws ModelException [inline, virtual]

Validates the data prior to its use in, for instance, a parameter file.

Parameters:
oPop TreePopulation object
Exceptions:
ModelException in any of the following cases:
  • If GLI,quadrat light, or map creator is used, and any of the following are not greater than zero:
    • m_iNumGLIAltDiv
    • m_iNumGLIAziDiv
    • m_iNumQuadratAltDiv
    • m_iNumQuadratAziDiv
    • m_iNumMapAltDiv
    • m_iNumMapAziDiv
    • m_fGLIMinSunAngle
    • m_fQuadratMinSunAngle
    • m_fMapMinSunAngle
  • m_fClearSkyTransmissionCoefficient is 0.
  • mp_fLightTransmissionCoefficient for any species is not between 0 and 1.
  • If m_fBeamFractionOfGlobalRadiation is not a valid proportion.
  • If either m_iJulianDayGrowthStarts or m_iJulianDayGrowthEnds is not between 1 and 365 (inclusive).
  • If quadrat light is used and m_fQuadratLightHeight is negative.
  • If GLI map is used and m_fMapLightHeight is negative.
  • If the number of years per timestep is not an integer value.
  • If sail light is used, and m_fSailLightMaxShadingRadius is not greater than zero.
  • If light filter is enabled, and either the filter height or the filter light transmission coefficient is negative, or the filter height is zero.
  • If the run has snags in it and the values for the snag light transmission coefficients aren't proportions, or the snag age classes aren't positive numbers.
  • If Storm Light is enabled:
  • Max years to affect light cannot be a negative number.
  • Min canopy trees cannot be a negative number.
  • If GLI points is enabled, points must be furnished in a file (or in a previously loaded XML file) and must be valid
  • If Basal Area Light is enabled:
  • The value for either c cannot equal 0.
  • The basal area change threshold cannot be less than 0.
  • The minimum DBH cannot be less than 0.
  • Grid cell lengths of "Basal Area Light" must divide evenly by the plot lengths.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
January 10, 2005: Added GLI Map Creator parameters (LEM)
December 8, 2005: Added Density Light parameters (LEM)
September 11, 2006: Average light validation (LEM)

Implements javawrapper::WorkerBase.

void javawrapper::LightBehaviors::ReadXMLParentTag ( String  sXMLTag,
Attributes  oAttributes 
) throws ModelException [inline]

Accepts an XML parent tag (empty, no data) from the parser.

This function watches for tag li_GLIPoint.

Parameters:
sXMLTag The XML tag.
oAttributes The attributes of this object.
Exceptions:
ModelException if data is missing or invalid.

Edit history:
------------------
May 11, 2005: Submitted in beta version (LEM)

Reimplemented from javawrapper::WorkerBase.

boolean javawrapper::LightBehaviors::SetSingleValueByXMLTag ( String  sXMLTag,
String  sXMLParentTag,
Attributes  oAttributes,
Object  oData 
) throws ModelException [inline]

Makes sure values go to the correct behavior.

We override this function because some values (number of azimuth angles, number of altitude angles, and minimum sun angle) can apply to any of three behaviors, so we want to make sure they are assigned to the correct one.

Parameters:
sXMLTag XML tag of object to assign.
sXMLParentTag The immediate parent tag that sXMLTag is within.
oAttributes Ignored.
oData Data to assign.
Returns:
true if assigned, or false if not.
Exceptions:
ModelException not thrown here.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
May 11, 2005: Added GLI points stuff (LEM)

Reimplemented from javawrapper::WorkerBase.

Behavior javawrapper::LightBehaviors::GetBehaviorByXMLTag ( String  sXMLTag  )  [inline]

Traps for the behavior replacement of radial light with constant GLI.

This could be removed by 6.10 or so.

Parameters:
sXMLTag String The XML tag for which to find a behavior.
Returns:
Behavior Behavior for the XML tag, or NULL if none of the behaviors has that tag.

Reimplemented from javawrapper::BehaviorTypeBase.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:34:54 2007 for SORTIE Java Interface by  doxygen 1.5.2