|
enum
clHarvestInterface::member_type * | mp_iMemberType |
| Array for holding tree data member types.
|
|
std::string * | mp_sNewTreeDataMembers |
| Array of labels for any new tree data members that this interface is to create.
|
|
std::string * | mp_sFileColumns |
| Array of columns in the files.
|
|
std::string | m_sExecutable |
| Path to user executable.
|
|
std::string | m_sInputFile |
| Path and filename of the input file to the harvest executable that this behavior will prepare.
|
|
std::string | m_sTreesToCutFile |
| Path and filename of the file of the trees to cut that is created by the harvest executable.
|
|
std::string | m_sTreesToUpdateFile |
| Path and filename of the file of the trees to update that is created by the harvest executable - empty string if not needed.
|
|
std::string | m_sBatchFileIn |
| Path and filename of the batch parameters input file that this will read - empty string if not needed.
|
|
std::string | m_sBatchParamsOut |
| Path and filename of the parameters output file that this will write in the event of a batch - empty string if not needed.
|
|
std::string | m_sArguments |
| Argument string to pass to the user executable - empty string if not needed.
|
|
bool ** | mp_bAppliesToTrees |
| Which trees this behavior is applied to.
|
|
int * | mp_iColumnTranslation |
| Initial values for the new float data members (if any).
|
|
bool * | mp_bUserDefinedColumn |
| Which of the file columns are user-defined new tree data members.
|
|
int | m_iNextTimestepToHarvest |
| The next timestep a harvest will be performed.
|
|
int | m_iPeriod |
| How often, in timesteps, harvests occur.
|
|
int | m_iNumFileColumns |
| Number of columns in the text files.
|
|
int | m_iNumSpecies |
| Total number of species, for the destructor.
|
|
short int | m_iNumAllowedCutRanges |
| Number of cut ranges allowed in "Harvest Results" grid - this comes from the class clDisturbance.
|
|
deadCode | m_iReasonCode |
| Reason code to pass to the tree population when trees are killed.
|
|
short int | m_iHarvestTypeCode |
| Harvest Type data member code in "Harvest Results" grid.
|
|
short int ** | mp_iDenCutCodes |
| Cut Density data member codes in "Harvest Results" grid.
|
|
short int ** | mp_iBaCutCodes |
| Cut Basal Area data member codes in "Harvest Results" grid.
|
|
clGrid * | mp_oResultsGrid |
| Harvest results grid, with same format as in clDisturbance.
|
|
short int | m_iNumSpeciesTypeCombos |
| How many type/species combos a behavior will act on.
|
|
short int | m_iNumBehaviorSpecies |
| How many distinct species are in the combo list - important for filling species-specific values from parameter file.
|
|
short int * | mp_iWhatSpecies |
| List of distinct species - for filling species-specific values from parameter file.
|
|
stcSpeciesTypeCombo * | mp_whatSpeciesTypeCombos |
| Array of species/type combos that the behavior will act on.
|
|
short int | m_iNewTreeInts |
| The number of new tree integer data members this behavior wants to add.
|
|
short int | m_iNewTreeFloats |
| The number of new tree float data members this behavior wants to add.
|
|
short int | m_iNewTreeChars |
| The number of new tree character data members this behavior wants to add.
|
|
short int | m_iNewTreeBools |
| The number of new tree boolean data members this behavior wants to add.
|
|
short int | m_iBehaviorListNumber |
| The number of this behavior in the behavior list, to differentiate between possible multiple copies of this behavior.
|
|
float | m_fVersionNumber |
| Version number - this will be rounded to 2 digits after the decimal place.
|
|
std::string | m_sXMLRoot |
| XML root that encloses the parameters for this behavior.
|
|
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.
|
|
std::string | m_sNameString |
| If a behavior has registered a command line command with the sim manager, this allows it to be called.
|
|
clSimManager * | mp_oSimManager |
| Pointer to the simulation manager object.
|
|
int * | mp_iAllowedFileTypes |
| List of the input file types this object can handle.
|
|
int | m_iNumAllowedTypes |
| Number of input file types this object can handle.
|
|
Harvest Interface - Version 1.1.
This behavior serves as an interface between SORTIE and a user-written executable for harvesting. (Although code that did something besides harvesting is certainly possible for the creative programmer as well.)
This behavior executes on a user-defined cycle. When it executes, it gathers all eligible trees and writes them to a text file. It then calls the user executable. It expects the executable to create a file (with a pre-arranged name) with the list of trees to cut.
The user may also ask for new tree data members to be added on the executable's behalf. If this is the case, the user executable can also write a file of trees to to update with new values for those data members. The new data members (which are all floats), and their initial values, are passed in on the behavior's parameter file call string as follows: "HarvestInterface
(name1) (name2)" etc. The initial values will always be 0. (We cannot do otherwise - a SORTIE run is constantly creating new trees, but we don't know which ones they are; so this behavior will never know (outside of initial conditions) which trees are new and which have a legitimately set value of 0.)
The file SORTIE writes for the user executable is tab-delimited text and has the following format: Line 1, two columns: Current timestep, total number of timesteps Line 2, column names, 6+n columns: "X", "Y", "Species", "Type", "Diam", "Height", [any additional variables that the user wishes]. Subsequent lines, 6+n columns, one line per tree: X, Y, species number, type number, DBH/diam10, height, [any additional variables that the user wishes, including new variables they have defined]. The "Diam" value is diameter at 10 cm if the tree type is seedling, and DBH in all other cases.
The file format of the user response files is identical to that of the SORTIE file, with the same columns in the same order. Each timestep, all these files are overwritten. Any other files in the working directory are ignored. (Incidentally, the timestep line in the response file will be ignored by SORTIE, so technically it doesn't have to be anything in particular.)
The list of harvested trees will be used to update the "Harvest Results" grid. This grid is the same as that produced by the clDisturbance class; however, if clDisturbance is also trying to use this grid in the same run, they will not play nicely together and will probably overwrite each other's results (at best). For each harvested species, this grid contains members called "Cut Density_0_x" and "Cut Basal Area_0_x" where x is the species number. These are raw density/BA values for each grid cell (8 m x 8 m) and are not converted to per ha amounts. The grid also contains a data member called "Harvest Type" that equals -1 if there was no harvesting in a grid cell this timestep, or 0 (partial cut) if there were harvested trees.
The user executable runs once per timestep. It does not stay running. So it must do any necessary initialization and setup each time. The executable can be written in any language, and can do anything it wishes. The only two requirements is that it be a standalone executable, and that it produce the file of trees to harvest that SORTIE expects.
If the user executable wants input parameters through SORTIE, it can have this behavior pass them as a string argument when the executable is launched. If it uses a file for input parameters, and SORTIE is running in batch mode, the user can specify a file with parameters for each run, one set per line; this behavior will extract the line corresponding to the batch number and write it to a specified file before calling the user executable.
The name string for this behavior is "HarvestInterface"; the parameter file call string is as described above.
- Author
- Lora E. Murphy
Edit history:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)