SORTIE Core C++ Documentation
|
Creates a tab-delimited text output file. More...
#include <OutputShort.h>
Classes | |
struct | stcCoords |
Structure for holding coordinates. More... | |
struct | stcSubplotInfo |
Data structure for saving subplot data. More... | |
Public Member Functions | |
clShortOutput (clSimManager *p_oSimManager) | |
Constructor. More... | |
~clShortOutput () | |
Destructor. More... | |
void | Action () |
Collects data and writes the output file. More... | |
Public Member Functions inherited from clBehaviorBase | |
virtual float | GetBehaviorVersion () |
Gets the behavior version number. More... | |
clBehaviorBase (clSimManager *p_oSimManager) | |
Constructor. More... | |
virtual | ~clBehaviorBase () |
Destructor. More... | |
virtual short int | ValidateVersionNumber (float fTestVersion) |
Makes sure that the version number of a file passed is between the minimum and current version numbers. More... | |
virtual void | RegisterTreeDataMembers () |
Registers tree data members. More... | |
virtual void | SetSpeciesTypeCombos (short int iNumCombos, stcSpeciesTypeCombo *p_whatCombos) |
Sets the species/type combos for a behavior. More... | |
virtual void | SetNameData (std::string sNameString) |
Sets the string for the parameter file behavior. More... | |
virtual short int | GetNewTreeInts () |
Gets the number of new tree integer data members this behavior wants to register. More... | |
virtual short int | GetNewTreeFloats () |
Gets the number of new tree float data members this behavior wants to register. More... | |
virtual short int | GetNewTreeChars () |
Gets the number of new tree character data members this behavior wants to register. More... | |
virtual short int | GetNewTreeBools () |
Gets the number of new tree bool data members this behavior wants to register. More... | |
virtual short int | GetNumSpeciesTypeCombos () |
Gets the number of species/type combos to which this behavior applies. More... | |
virtual short int | GetNumBehaviorSpecies () |
Gets the number of unique tree species to which this behavior applies. More... | |
struct stcSpeciesTypeCombo | GetSpeciesTypeCombo (short int iIndex) |
Gets one of this behavior's type/species combos. More... | |
virtual short int | GetBehaviorSpecies (short int iIndex) |
Gets one of the behavior's species. More... | |
short int | GetBehaviorListNumber () |
Gets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More... | |
void | SetBehaviorListNumber (short int iNumber) |
Sets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More... | |
std::string | FormatSpeciesTypeQueryString () |
Formats the string for species/types query. More... | |
virtual DOMElement * | GetParentParametersElement (xercesc::DOMDocument *p_oDoc) |
This will get the correct set of parameters for this behavior based on the behavior list position number. More... | |
Public Member Functions inherited from clWorkerBase | |
clWorkerBase (clSimManager *p_oSimManager) | |
Constructor. More... | |
virtual | ~clWorkerBase () |
Destructor. More... | |
std::string | GetName () |
Gets the object's namestring. More... | |
clSimManager * | GetSimManager () |
void | DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType) |
Triggers the setup process. More... | |
virtual void | TimestepCleanup () |
Performs any necessary cleanup operations at the end of a timestep. More... | |
virtual void | EndOfRunCleanup () |
Performs any necessary cleanup operations at the end of a run. More... | |
Protected Member Functions | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Reads the desired options out of the parameter file. More... | |
void | WriteFileHeader () |
Writes output file header. More... | |
void | ExtractLiveTreeInfo (xercesc::DOMDocument *p_oDoc) |
Extracts the output data relating to tree saving from the parameter file. More... | |
void | ExtractDeadTreeInfo (xercesc::DOMDocument *p_oDoc) |
Extracts the output data relating to tree saving from the parameter file. More... | |
void | ExtractSubplotInfo (xercesc::DOMDocument *p_oDoc) |
Extracts the subplot data from the parameter file. More... | |
bool | TestForSave (DOMElement *p_oParentElement, const char *cNodeName) |
Tests to see if a given node exists and has an attribute called "save" equal to true. More... | |
void | GetDeadTreeStats () |
For a time step, collects all basal area and density information for dead trees. More... | |
void | GetLiveTreeStats () |
For a time step, collects all basal area and density information for live trees. More... | |
void | DeclareDataArrays () |
Allocates memory for all of our arrays. More... | |
void | DeclareDataArraysForSubplots () |
Allocates memory for those arrays pertaining to subplots. More... | |
void | WriteTimestepData () |
Write the data for a single time step. More... | |
Protected Member Functions inherited from clWorkerBase | |
void | AssembleFileCode (int iFileType, int iFileVersion, char *cCode) |
Creates the proper identifying filecode for an XML file. More... | |
Protected Attributes | |
std::string | m_sFileName |
Output file name. More... | |
float ** | mp_fLiveRBA |
Array for one timestep's relative basal area - # types by # species. More... | |
float ** | mp_fLiveABA |
Array for one timestep's absolute basal area - # types by # species. More... | |
float ** | mp_fLiveRDN |
Array for one timestep's relative density - # types by # species. More... | |
float ** | mp_fLiveADN |
Array for one timestep's absolute density - # types by # species. More... | |
float *** | mp_fSubRBA |
Array for one timestep's relative basal area by subplot - # subplots by types by # speciesMore... | |
float *** | mp_fSubABA |
Array for one timestep's absolute basal area by subplot - # subplots by types by # speciesMore... | |
float *** | mp_fSubRDN |
Array for one timestep's relative density by subplot - # subplots by types by # speciesMore... | |
float *** | mp_fSubADN |
Array for one timestep's absolute density by subplot - # subplots by types by # speciesMore... | |
float *** | mp_fDeadABA |
Array for one timestep's dead absolute basal area - # types by # species by dead reason codesMore... | |
float *** | mp_fDeadADN |
Array for one timestep's dead absolute density - # types by # species by dead reason codesMore... | |
bool * | mp_bSaveLiveRBA |
Whether to save relative basal area. More... | |
bool * | mp_bSaveLiveABA |
Whether to save absolute basal area. More... | |
bool * | mp_bSaveLiveRDN |
Whether to save relative density. More... | |
bool * | mp_bSaveLiveADN |
Whether to save absolute density. More... | |
bool ** | mp_bSaveDeadABA |
Whether to save absolute basal area. More... | |
bool ** | mp_bSaveDeadADN |
Whether to save absolute density. More... | |
bool * | mp_bSaveAnyLive |
Shortcut flag for whether to save any information, by type. More... | |
bool * | mp_bSaveAnyLiveBA |
Shortcut flag for whether to save basal area information, by type. More... | |
bool | m_bUseLive |
Shortcut flag for whether any live trees are to be saved all. More... | |
bool | m_bUseDead |
Shortcut flag for whether any dead trees are to be saved all. More... | |
struct clShortOutput::stcSubplotInfo * | mp_subplots |
An array of stcSubplotInfos, one for each subplot to save. More... | |
short int | m_iNumSubplotsToSave |
Number of subplots we're saving data for. More... | |
short int | m_iNumXCells |
Number of plot cells in the X direction - for subplots. More... | |
short int | m_iNumYCells |
Number of plot cells in the Y direction - for subplots. More... | |
short int | m_iNumTypes |
Number of types. More... | |
short int | m_iNumSpecies |
Number of species. More... | |
float | m_fXCellLength |
Length of subplot cells in X direction - defaults to match tree population. More... | |
float | m_fYCellLength |
Length of subplot cells in Y direction - defaults to match tree population. More... | |
Protected Attributes inherited from clBehaviorBase | |
short int | m_iNumSpeciesTypeCombos |
How many type/species combos a behavior will act on. More... | |
short int | m_iNumBehaviorSpecies |
How many distinct species are in the combo list - important for filling species-specific values from parameter file. More... | |
short int * | mp_iWhatSpecies |
List of distinct species - for filling species-specific values from parameter file. More... | |
stcSpeciesTypeCombo * | mp_whatSpeciesTypeCombos |
Array of species/type combos that the behavior will act on. More... | |
short int | m_iNewTreeInts |
The number of new tree integer data members this behavior wants to add. More... | |
short int | m_iNewTreeFloats |
The number of new tree float data members this behavior wants to add. More... | |
short int | m_iNewTreeChars |
The number of new tree character data members this behavior wants to add. More... | |
short int | m_iNewTreeBools |
The number of new tree boolean data members this behavior wants to add. More... | |
short int | m_iBehaviorListNumber |
The number of this behavior in the behavior list, to differentiate between possible multiple copies of this behavior. More... | |
float | m_fVersionNumber |
Version number - this will be rounded to 2 digits after the decimal place. More... | |
std::string | m_sXMLRoot |
XML root that encloses the parameters for this behavior. More... | |
float | m_fMinimumVersionNumber |
Minimum version number - this behavior will run parameter data for a file marked between this number and the current version number, inclusive. More... | |
Protected Attributes inherited from clWorkerBase | |
std::string | m_sNameString |
If a behavior has registered a command line command with the sim manager, this allows it to be called. More... | |
clSimManager * | mp_oSimManager |
Pointer to the simulation manager object. More... | |
int * | mp_iAllowedFileTypes |
List of the input file types this object can handle. More... | |
int | m_iNumAllowedTypes |
Number of input file types this object can handle. More... | |
Creates a tab-delimited text output file.
It's a shortcut if a detailed output file isn't what you need. It supports subplots - as many as you want.
This will save absolute and relative basal area and density for snags, adults, and saplings, and absolute density for seedlings. This will also save absolute basal area and density for dead trees.
The namestring of this behavior, and the name which it is called in the behavior list of the parameter file, is "ShortOutput".
Copyright 2004 Charles D. Canham.
Edit history:
--------------—
April 28, 2004 - Submitted as beta (LEM)
June 24, 2004 - Added snag support (LEM)
October 25, 2005 - Changed the way we search for trees (LEM)
January 2, 2007 - Support for user-defined subplot resolution and made version 1.1 (LEM)
January 11, 2011 - Added dead trees (LEM)
October 4, 2011 - Added support for variable subplot cell size (LEM)
clShortOutput::clShortOutput | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clShortOutput::~clShortOutput | ( | ) |
Destructor.
|
virtual |
Collects data and writes the output file.
Reimplemented from clBehaviorBase.
|
protected |
Allocates memory for all of our arrays.
|
protected |
Allocates memory for those arrays pertaining to subplots.
This must occur after the information has been extracted from the parameter file because we need to know how many subplots there are.
|
protected |
Extracts the output data relating to tree saving from the parameter file.
p_oDoc | DOM tree of parsed input file. |
|
protected |
Extracts the output data relating to tree saving from the parameter file.
p_oDoc | DOM tree of parsed input file. |
|
protected |
Extracts the subplot data from the parameter file.
p_oDoc | DOM tree of parsed input file. |
|
protectedvirtual |
Reads the desired options out of the parameter file.
p_oDoc | DOM tree of the parsed input file. |
Implements clWorkerBase.
|
protected |
For a time step, collects all basal area and density information for dead trees.
|
protected |
For a time step, collects all basal area and density information for live trees.
|
protected |
Tests to see if a given node exists and has an attribute called "save" equal to true.
p_oParentElement | Pointer to the parent element of the node in question. |
cNodeName | Tag name of the node. |
|
protected |
Writes output file header.
|
protected |
Write the data for a single time step.
|
protected |
Shortcut flag for whether any dead trees are to be saved all.
|
protected |
Shortcut flag for whether any live trees are to be saved all.
|
protected |
Length of subplot cells in X direction - defaults to match tree population.
|
protected |
Length of subplot cells in Y direction - defaults to match tree population.
|
protected |
Number of species.
|
protected |
Number of subplots we're saving data for.
|
protected |
Number of types.
|
protected |
Number of plot cells in the X direction - for subplots.
|
protected |
Number of plot cells in the Y direction - for subplots.
|
protected |
Output file name.
If it already exists, new data is appended at the end
|
protected |
Shortcut flag for whether to save any information, by type.
|
protected |
Shortcut flag for whether to save basal area information, by type.
|
protected |
Whether to save absolute basal area.
Ignored for seedlings. Array size # types by # dead reason codes.
|
protected |
Whether to save absolute density.
Array size # types by # dead reason codes.
|
protected |
Whether to save absolute basal area.
Ignored for seedlings. Array size # types.
|
protected |
Whether to save absolute density.
Array size # types.
|
protected |
Whether to save relative basal area.
Ignored for seedlings. Array size # types.
|
protected |
Whether to save relative density.
Array size # types.
|
protected |
Array for one timestep's dead absolute basal area - # types by # species by
|
protected |
Array for one timestep's dead absolute density - # types by # species by
|
protected |
Array for one timestep's absolute basal area - # types by # species.
|
protected |
Array for one timestep's absolute density - # types by # species.
|
protected |
Array for one timestep's relative basal area - # types by # species.
|
protected |
Array for one timestep's relative density - # types by # species.
|
protected |
Array for one timestep's absolute basal area by subplot - # subplots by
|
protected |
Array for one timestep's absolute density by subplot - # subplots by
|
protected |
Array for one timestep's relative basal area by subplot - # subplots by
|
protected |
Array for one timestep's relative density by subplot - # subplots by
|
protected |
An array of stcSubplotInfos, one for each subplot to save.