SORTIE Core C++ Documentation
|
Merchantable Timber Value Calculator Version 1.0. More...
#include <MerchValueCalculator.h>
Public Member Functions | |
clMerchValueCalculator (clSimManager *p_oSimManager) | |
Constructor. More... | |
~clMerchValueCalculator () | |
Destructor. More... | |
void | Action () |
Makes value calculations. More... | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Does setup for this behavior. More... | |
void | RegisterTreeDataMembers () |
Registers the "Merch Val" float data member. 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 | 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 | |
float | GetTreeValue (const float &fDBH, const int &iSpecies) |
Gets the value for a tree. More... | |
int | GetNumLogs (const float &fDBH, const int &iSpecies) |
Gets the number of logs in the merchantable bole height of a tree. More... | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc, clTreePopulation *p_oPop) |
Reads values from the parameter file. More... | |
void | FormatQueryString (clTreePopulation *p_oPop) |
Formats the string in m_cQuery. More... | |
void | PopulateTables () |
Populates the taper and form class board feet tables. More... | |
void | SetupGrid () |
Sets up the "Merchantable Timber Value" grid. 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 | |
clGrid * | mp_oValueGrid |
Grid holding total values for each species. More... | |
double * | mp_fVal |
Value per thousand board feet of merchantable timber, in whatever currency the user prefers. More... | |
double * | mp_fFormClass |
Form classes. More... | |
double ** | mp_fTaperTable |
Taper table. More... | |
float ** | mp_fFormClass78Table |
Table of board feet for form class 78. More... | |
float ** | mp_fFormClass79Table |
Table of board feet for form class 79. More... | |
float ** | mp_fFormClass80Table |
Table of board feet for form class 80. More... | |
float ** | mp_fFormClass81Table |
Table of board feet for form class 81. More... | |
float ** | mp_fFormClass84Table |
Table of board feet for form class 84. More... | |
float ** | mp_fFormClass85Table |
Table of board feet for form class 85. More... | |
char * | m_cQuery |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume. More... | |
short int ** | mp_iMerchValCodes |
Holds data member codes for "Merch Val" float data member. More... | |
short int * | mp_iValueCodes |
Holds data member codes for the "value_x" float data members of the "Merchantable Timber Value" grid. More... | |
short int | m_iMaxLogs |
The maximum number of logs a tree can have. More... | |
short int | m_iDBHIncs |
Number of DBH increments in the taper table. More... | |
short int | m_iFormDBHIncs |
Number of DBH increments in the form class board feet tables. More... | |
short int | m_iNumTotalSpecies |
Total number of species. 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... | |
Merchantable Timber Value Calculator Version 1.0.
This class calculates merchantable tree timber value according to a US Forest Service equation. The value is stored in an float tree data member that this behavior adds, as a value in an unspecified currency (user's choice). This also creates a grid object with species total values.
The value is price per thousand board feet of timber. The amount of timber in a tree is based on the size of the tree and the number of 16-foot logs that can be extracted from a tree.
The number of 16-foot logs a tree can provide is based on the bole length. The base of the bole is the top of the cut stump (whatever that is; it's ignored by this behavior); the top of the bole is the merchantable height. This behavior defines the merchantable height as the height at which the trunk diameter inside the bark tapers to 60% of DBH.
There's no simple equation to determine how many 16 foot logs fit into the length of the bole. This behavior uses a table along with trial-and-error to fit as many 16-foot logs as possible in before the 60% taper occurs. The amount of taper at the top of the first 16-foot log is established by the form classes and is a fixed percentage entered by the user as a parameter.
All trees above the minimum DBH are assumed to have at least 1 16-foot log. The amount of taper at the top of this first log is subtracted from the DBH, to see how much taper is left before the 60% merchantable-height taper is reached. The table below, adapted from Messavage and Girard, is contained in the code. It represents the amount of taper at the top of the last log in a tree containing different numbers of logs.
DBH (in) | 2-log | 3-log | 4-log | 5-log | 6-log |
---|---|---|---|---|---|
10 | 1.4 | 2.6 | – | – | – |
12 | 1.6 | 2.8 | 4.4 | – | – |
14 | 1.7 | 3 | 4.7 | – | – |
16 | 1.9 | 3.2 | 4.9 | – | – |
18 | 2 | 3.4 | 5.2 | – | – |
20 | 2.1 | 3.6 | 5.6 | 7.8 | – |
22 | 2.2 | 3.8 | 5.9 | 8 | – |
24 | 2.3 | 4 | 6.3 | 8.4 | – |
26 | 2.4 | 4.2 | 6.5 | 8.7 | – |
28 | 2.5 | 4.4 | 6.8 | 9 | 12 |
30 | 2.6 | 4.6 | 7.2 | 9.4 | 12.1 |
32 | 2.7 | 4.7 | 7.3 | 9.9 | 12.3 |
34 | 2.8 | 4.8 | 7.6 | 10.2 | 12.6 |
36 | 2.8 | 4.9 | 7.8 | 10.4 | 13 |
38 | 2.9 | 4.9 | 7.9 | 10.5 | 13.4 |
40 | 2.9 | 5 | 8 | 10.9 | 13.9 |
Consider a maple tree with a 20-inch DBH. The user enters its form class as 79%. We calculate the merchantable height to be that height at which the tree diameter inside the bark is 20 * 0.6 = 12 inches. The diameter at the top of the first 16-foot log = 20 * 0.79 = 15.8 inches.
The diameter at merchantable height is 12 inches; at the top of the first log it is 15.8 inches. This means there is 3.8 inches of taper available left. The next job is to use the lookup table to determine how many logs will fit into this amount of taper.
Our DBH is 20 inches, which has an entry for itself in the lookup table. If our DBH was not an even multiple of 2 inches, we would round down to the next lowest multiple of 2. Any tree larger than 40 inches of DBH will use the 40-inch entry. Trees must have a DBH of at least 10 inches to get a volume.
We begin by assuming that our tree is a 2-log tree. The amount of taper to the top of the second log in the table is given as 2.1. This means our diameter at the top of the second log is 15.8 - 2.1 = 13.7 inches. This is greater than 12 inches; so we will go back and try to fit three logs in.
For a 3-log tree of 20 inches, the taper at the top of the third log is 3.6 inches. The diameter at the top of this log is 15.8 - 3.6 = 12.2. This is still greater than 12, so we will try to fit in four logs.
The diameter at the top of the fourth log of a 4-log tree of 20 inches DBH is 15.8 - 1.4 - 1.8 - 2.4, or 10.2. This is less than 12. Thus, 4 logs don't fit. Our tree thus provides 3 16-foot logs.
Once we know the number of 16-foot logs, then we can use another set of tables to find out how many board-feet of timber those logs provide. The table used is based on form class (again, from Messavage and Girard). The timber is assumed to be 0.25" in width.
VOLUME (BOARD FEET) BY NUMBER OF USABLE 16 FOOT LOGS
Form Class 78:
DBH (inches) | 1 log | 2 logs | 3 logs | 4 logs | 5 logs | 6 logs |
---|---|---|---|---|---|---|
10 | 36 | 59 | 73 | – | – | – |
11 | 46 | 76 | 96 | – | – | – |
12 | 56 | 92 | 120 | 137 | – | – |
13 | 67 | 112 | 147 | 168 | – | – |
14 | 78 | 132 | 174 | 200 | – | – |
15 | 92 | 156 | 208 | 242 | – | – |
16 | 106 | 180 | 241 | 285 | – | – |
17 | 121 | 206 | 278 | 330 | – | – |
18 | 136 | 233 | 314 | 374 | – | – |
19 | 154 | 264 | 358 | 427 | – | – |
20 | 171 | 296 | 401 | 480 | 542 | – |
21 | 191 | 332 | 450 | 542 | 616 | – |
22 | 211 | 368 | 500 | 603 | 691 | – |
23 | 231 | 404 | 552 | 663 | 714 | – |
24 | 251 | 441 | 605 | 723 | 782 | – |
25 | 275 | 484 | 665 | 800 | 865 | – |
26 | 299 | 528 | 725 | 877 | 1,021 | – |
27 | 323 | 572 | 788 | 952 | 1,111 | – |
28 | 347 | 616 | 850 | 1,027 | 1,201 | 1,358 |
29 | 375 | 667 | 920 | 1,112 | 1,308 | 1,488 |
30 | 403 | 718 | 991 | 1,198 | 1,415 | 1,619 |
31 | 432 | 772 | 1,070 | 1,299 | 1,526 | 1,754 |
32 | 462 | 826 | 1,149 | 1,400 | 1,637 | 1,888 |
33 | 492 | 880 | 1,226 | 1,495 | 1,750 | 2,026 |
34 | 521 | 934 | 1,304 | 1,590 | 1,864 | 2,163 |
35 | 555 | 998 | 1,394 | 1,702 | 2,000 | 2,312 |
36 | 589 | 1,063 | 1,485 | 1,814 | 2,135 | 2,461 |
37 | 622 | 1,124 | 1,578 | 1,926 | 2,272 | 2,616 |
38 | 656 | 1,186 | 1,670 | 2,038 | 2,410 | 2,771 |
39 | 694 | 1,258 | 1,769 | 2,166 | 2,552 | 2,937 |
40 | 731 | 1,329 | 1,868 | 2,294 | 2,693 | 3,103 |
Form Class 79:
DBH (inches) | 1 log | 2 logs | 3 logs | 4 logs | 5 logs | 6 logs |
---|---|---|---|---|---|---|
10 | 38 | 61 | 77 | – | – | – |
11 | 48 | 78 | 100 | – | – | – |
12 | 58 | 96 | 124 | 141 | – | – |
13 | 70 | 117 | 153 | 176 | – | – |
14 | 82 | 138 | 182 | 211 | – | – |
15 | 95 | 160 | 214 | 252 | – | – |
16 | 108 | 183 | 246 | 292 | – | – |
17 | 124 | 212 | 286 | 340 | – | – |
18 | 140 | 240 | 325 | 388 | – | – |
19 | 158 | 272 | 370 | 442 | – | – |
20 | 176 | 305 | 414 | 496 | 561 | – |
21 | 196 | 342 | 464 | 558 | 636 | – |
22 | 216 | 378 | 514 | 621 | 710 | – |
23 | 238 | 418 | 571 | 687 | 792 | – |
24 | 260 | 458 | 628 | 753 | 875 | – |
25 | 282 | 499 | 685 | 826 | 960 | – |
26 | 305 | 540 | 742 | 899 | 1,046 | – |
27 | 331 | 588 | 810 | 980 | 1,144 | – |
28 | 357 | 635 | 877 | 1,061 | 1,242 | 1,404 |
29 | 385 | 686 | 948 | 1,148 | 1,350 | 1,537 |
30 | 413 | 737 | 1,020 | 1,235 | 1,458 | 1,670 |
31 | 444 | 792 | 1,100 | 1,338 | 1,572 | 1,808 |
32 | 474 | 848 | 1,181 | 1,440 | 1,685 | 1,945 |
33 | 506 | 907 | 1,265 | 1,544 | 1,808 | 2,094 |
34 | 538 | 966 | 1,349 | 1,647 | 1,932 | 2,244 |
35 | 570 | 1,026 | 1,435 | 1,754 | 2,000 | 2,384 |
36 | 602 | 1,087 | 1,521 | 1,860 | 2,189 | 2,525 |
37 | 638 | 1,154 | 1,620 | 1,980 | 2,338 | 2,694 |
38 | 674 | 1,220 | 1,720 | 2,101 | 2,488 | 2,862 |
39 | 712 | 1,292 | 1,822 | 2,232 | 2,632 | 3,031 |
40 | 750 | 1,365 | 1,923 | 2,362 | 2,775 | 3,200 |
Form Class 80:
DBH (inches) | 1 log | 2 logs | 3 logs | 4 logs | 5 logs | 6 logs |
---|---|---|---|---|---|---|
10 | 39 | 63 | 80 | – | – | – |
11 | 49 | 80 | 104 | – | – | – |
12 | 59 | 98 | 127 | 146 | – | – |
13 | 71 | 120 | 156 | 181 | – | – |
14 | 83 | 141 | 186 | 216 | – | – |
15 | 98 | 166 | 221 | 260 | – | – |
16 | 112 | 190 | 256 | 305 | – | – |
17 | 128 | 219 | 296 | 354 | – | – |
18 | 144 | 248 | 336 | 402 | – | – |
19 | 162 | 281 | 382 | 457 | – | – |
20 | 181 | 314 | 427 | 512 | 580 | – |
21 | 201 | 350 | 478 | 575 | 656 | – |
22 | 221 | 387 | 528 | 638 | 732 | – |
23 | 244 | 428 | 586 | 706 | 816 | – |
24 | 266 | 469 | 644 | 773 | 899 | – |
25 | 290 | 514 | 706 | 852 | 992 | – |
26 | 315 | 558 | 767 | 931 | 1,086 | – |
27 | 341 | 606 | 836 | 1,014 | 1,185 | – |
28 | 367 | 654 | 904 | 1,096 | 1,284 | 1,453 |
29 | 396 | 706 | 977 | 1,184 | 1,394 | 1,588 |
30 | 424 | 758 | 1,050 | 1,272 | 1,503 | 1,723 |
31 | 454 | 814 | 1,132 | 1,376 | 1,618 | 1,862 |
32 | 485 | 870 | 1,213 | 1,480 | 1,733 | 2,001 |
33 | 518 | 930 | 1,298 | 1,586 | 1,858 | 2,152 |
34 | 550 | 989 | 1,383 | 1,691 | 1,984 | 2,304 |
35 | 585 | 1,055 | 1,477 | 1,806 | 2,124 | 2,458 |
36 | 620 | 1,121 | 1,571 | 1,922 | 2,264 | 2,612 |
37 | 656 | 1,188 | 1,672 | 2,044 | 2,416 | 2,783 |
38 | 693 | 1,256 | 1,772 | 2,167 | 2,568 | 2,954 |
39 | 732 | 1,330 | 1,874 | 2,300 | 2,714 | 3,127 |
40 | 770 | 1,403 | 1,977 | 2,432 | 2,860 | 3,300 |
Form Class 81:
DBH (inches) | 1 log | 2 logs | 3 logs | 4 logs | 5 logs | 6 logs |
---|---|---|---|---|---|---|
10 | 40 | 65 | 82 | – | – | – |
11 | 50 | 82 | 106 | – | – | – |
12 | 60 | 100 | 130 | 150 | – | – |
13 | 72 | 122 | 160 | 186 | – | – |
14 | 85 | 144 | 190 | 221 | – | – |
15 | 100 | 170 | 228 | 268 | – | – |
16 | 115 | 197 | 265 | 316 | – | – |
17 | 132 | 226 | 306 | 366 | – | – |
18 | 148 | 256 | 346 | 415 | – | – |
19 | 166 | 290 | 392 | 471 | – | – |
20 | 185 | 323 | 439 | 527 | 598 | – |
21 | 206 | 360 | 492 | 592 | 676 | – |
22 | 227 | 398 | 544 | 656 | 754 | – |
23 | 250 | 439 | 602 | 724 | 838 | – |
24 | 272 | 480 | 659 | 791 | 923 | – |
25 | 298 | 528 | 726 | 877 | 1,024 | – |
26 | 324 | 575 | 793 | 963 | 1,124 | – |
27 | 351 | 624 | 863 | 1,047 | 1,226 | – |
28 | 378 | 674 | 933 | 1,131 | 1,327 | 1,502 |
29 | 406 | 726 | 1,006 | 1,220 | 1,438 | 1,640 |
30 | 435 | 779 | 1,080 | 1,310 | 1,549 | 1,777 |
31 | 466 | 836 | 1,162 | 1,416 | 1,666 | 1,918 |
32 | 497 | 892 | 1,245 | 1,522 | 1,784 | 2,059 |
33 | 530 | 953 | 1,332 | 1,628 | 1,910 | 2,214 |
34 | 563 | 1,014 | 1,419 | 1,734 | 2,037 | 2,368 |
35 | 600 | 1,084 | 1,518 | 1,859 | 2,188 | 2,534 |
36 | 637 | 1,154 | 1,618 | 1,984 | 2,338 | 2,700 |
37 | 674 | 1,223 | 1,721 | 2,109 | 2,494 | 2,874 |
38 | 712 | 1,292 | 1,824 | 2,234 | 2,649 | 3,049 |
39 | 751 | 1,366 | 1,928 | 2,368 | 2,796 | 3,224 |
40 | 790 | 1,441 | 2,032 | 2,502 | 2,944 | 3,399 |
Form Class 84:
DBH (inches) | 1 log | 2 logs | 3 logs | 4 logs | 5 logs | 6 logs |
---|---|---|---|---|---|---|
10 | 43 | 71 | 91 | – | – | – |
11 | 54 | 91 | 118 | – | – | – |
12 | 66 | 111 | 145 | 168 | – | – |
13 | 80 | 135 | 178 | 208 | – | – |
14 | 93 | 159 | 212 | 248 | – | – |
15 | 108 | 185 | 249 | 295 | – | – |
16 | 123 | 211 | 286 | 342 | – | – |
17 | 142 | 244 | 332 | 398 | – | – |
18 | 160 | 277 | 377 | 453 | – | – |
19 | 180 | 314 | 428 | 524 | – | – |
20 | 200 | 351 | 479 | 576 | 657 | – |
21 | 223 | 392 | 537 | 649 | 744 | – |
22 | 246 | 434 | 595 | 722 | 830 | – |
23 | 271 | 480 | 660 | 798 | 925 | – |
24 | 296 | 525 | 724 | 873 | 1,020 | – |
25 | 322 | 572 | 790 | 958 | 1,118 | – |
26 | 347 | 619 | 855 | 1,042 | 1,217 | – |
27 | 376 | 673 | 932 | 1,136 | 1,331 | – |
28 | 406 | 727 | 1,010 | 1,230 | 1,445 | 1,636 |
29 | 438 | 786 | 1,092 | 1,330 | 1,569 | 1,790 |
30 | 470 | 844 | 1,173 | 1,429 | 1,693 | 1,943 |
31 | 504 | 907 | 1,265 | 1,546 | 1,823 | 2,101 |
32 | 538 | 970 | 1,357 | 1,664 | 1,953 | 2,259 |
33 | 574 | 1,037 | 1,453 | 1,782 | 2,096 | 2,431 |
34 | 611 | 1,104 | 1,549 | 1,901 | 2,240 | 2,603 |
35 | 647 | 1,173 | 1,648 | 2,023 | 2,387 | 2,766 |
36 | 683 | 1,242 | 1,746 | 2,145 | 2,534 | 2,929 |
37 | 724 | 1,318 | 1,859 | 2,284 | 2,706 | 3,123 |
38 | 765 | 1,393 | 1,972 | 2,422 | 2,877 | 3,317 |
39 | 808 | 1,476 | 2,088 | 2,570 | 3,042 | 3,512 |
40 | 851 | 1,558 | 2,203 | 2,719 | 3,208 | 3,706 |
Form Class 85:
DBH (inches) | 1 log | 2 logs | 3 logs | 4 logs | 5 logs | 6 logs |
---|---|---|---|---|---|---|
10 | 45 | 74 | 94 | – | – | – |
11 | 56 | 94 | 122 | – | – | – |
12 | 68 | 114 | 150 | 173 | – | – |
13 | 82 | 138 | 184 | 214 | – | – |
14 | 95 | 163 | 217 | 254 | – | – |
15 | 111 | 191 | 257 | 304 | – | – |
16 | 127 | 219 | 297 | 355 | – | – |
17 | 146 | 252 | 342 | 412 | – | – |
18 | 164 | 285 | 388 | 468 | – | – |
19 | 184 | 322 | 440 | 531 | – | – |
20 | 205 | 360 | 492 | 594 | 678 | – |
21 | 228 | 402 | 550 | 667 | 765 | – |
22 | 251 | 444 | 609 | 740 | 852 | – |
23 | 276 | 490 | 675 | 818 | 950 | – |
24 | 302 | 537 | 741 | 895 | 1,047 | – |
25 | 330 | 588 | 812 | 986 | 1,153 | – |
26 | 357 | 638 | 882 | 1,076 | 1,259 | – |
27 | 387 | 693 | 961 | 1,172 | 1,374 | – |
28 | 417 | 745 | 1,040 | 1,267 | 1,490 | 1,689 |
29 | 448 | 807 | 1,122 | 1,368 | 1,616 | 1,844 |
30 | 481 | 866 | 1,205 | 1,469 | 1,741 | 1,999 |
31 | 516 | 930 | 1,298 | 1,588 | 1,874 | 2,160 |
32 | 550 | 993 | 1,391 | 1,706 | 2,006 | 2,321 |
33 | 587 | 1,061 | 1,488 | 1,827 | 2,150 | 2,495 |
34 | 624 | 1,129 | 1,586 | 1,948 | 2,294 | 2,669 |
35 | 663 | 1,204 | 1,692 | 2,080 | 2,454 | 2,846 |
36 | 702 | 1,278 | 1,797 | 2,212 | 2,614 | 3,022 |
37 | 744 | 1,355 | 1,912 | 2,352 | 2,788 | 3,219 |
38 | 785 | 1,432 | 2,027 | 2,493 | 2,962 | 3,416 |
39 | 828 | 1,515 | 2,144 | 2,644 | 3,130 | 3,614 |
40 | 872 | 1,598 | 2,260 | 2,795 | 3,298 | 3,813 |
This behavior adds an float data member called "Merch Val" to trees that holds the value of the tree's timber.
This class's namestring and parameter call string are both "MerchValueCalculator".
This behavior may not be applied to seedlings.
Edit history:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)
clMerchValueCalculator::clMerchValueCalculator | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | clSimManager object. |
clMerchValueCalculator::~clMerchValueCalculator | ( | ) |
Destructor.
Deletes arrays.
|
virtual |
Makes value calculations.
First, the values in the "Merchantable Timber Value" grid are cleared. Then a query is sent to the tree population to get all trees to which this behavior is applied. For each, the value is calculated by GetTreeValue(). This value is placed in the "Merch Val" float tree data member. The species totals are put in the "Merchantable Timber Value" grid.
Reimplemented from clBehaviorBase.
|
protected |
Formats the string in m_cQuery.
This value will be used in Action() to pass to clTreePopulation::Find() in order to get the trees to act on.
p_oPop | Tree population object. |
|
virtual |
Does setup for this behavior.
Calls:
p_oDoc | DOM tree of parsed input file. |
Implements clWorkerBase.
|
protected |
Gets the number of logs in the merchantable bole height of a tree.
This function calculates the number of logs in a tree. It calculates the taper to the top of the first log using the form class for the species. After determining how much taper is left, it uses the taper table to determine how many logs to add. It determines the DBH increment index by rounding down to the nearest even number and subtracting 10 (with a max index of 15). Then, for that index, it moves from 0 to m_iMaxLogs across the table until it finds the greatest entry that is less than or equal to the remaining taper. That array index is equal to the number of logs to add to the first one. The maximum value is 6.
This function does not weed out trees with a DBH of less than 10 inches.
fDBH | SORTIE's DBH value, in in |
iSpecies | Tree's species. |
|
protected |
Reads values from the parameter file.
p_oDoc | DOM tree of parsed input file. |
p_oPop | Tree population object. |
modelErr | if a form class value is not equal to 78, 79, 80, 81, 84, or 85. |
|
protected |
Gets the value for a tree.
First, GetNumLogs() is called to find out how many 16-foot logs the tree has. Then this uses the form class table for the tree's species to determine the number of board feet in the tree. It determines the first array index by rounding down to the nearest integer and subtracting 10 (with a max index of 30). The second index is equal to the number of logs minus 1. This pair of indexes gets us the volume in board feet of the tree from the form class table. This volume is multiplied by the value for the species and returned.
If the dbh is less than the minimum, the value is 0.
fDBH | SORTIE's DBH value, in in |
iSpecies | Tree's species. |
|
protected |
Populates the taper and form class board feet tables.
The table arrays are declared and the values populated according to the values in the documentation above.
|
virtual |
Registers the "Merch Val" float data member.
The return codes are captured in the mp_iVolumeCodes array.
modelErr | if this behavior is being applied to any tree type except saplings, adults, and snags. |
Reimplemented from clBehaviorBase.
|
protected |
Sets up the "Merchantable Timber Value" grid.
This ignores any maps.
|
protected |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume.
This will instigate a species/type search for all the species and types to which this behavior applies.
|
protected |
Number of DBH increments in the taper table.
Equal to 16 (DBH in 2-in increments from 10 to 40 inches).
|
protected |
Number of DBH increments in the form class board feet tables.
Equal to 31 (DBH in 1-in increments from 10 to 40 inches).
|
protected |
The maximum number of logs a tree can have.
Equal to 6.
|
protected |
Total number of species.
For the destructor.
|
protected |
Form classes.
This is the proportion of DBH that the diameter is at the top of the first log. This is entered by the user as a percentage between 60 and 100 but to save math we convert to a proportion and subtract it from 1 so it's the inverse. Array size is # behavior species.
|
protected |
Table of board feet for form class 78.
This is the volume, in board feet, for trees having 1 to 6 logs. First array index is m_iFormDBHIncs; second index is m_iMaxLogs.
|
protected |
Table of board feet for form class 79.
This is the volume, in board feet, for trees having 1 to 6 logs. First array index is m_iFormDBHIncs; second index is m_iMaxLogs.
|
protected |
Table of board feet for form class 80.
This is the volume, in board feet, for trees having 1 to 6 logs. First array index is m_iFormDBHIncs; second index is m_iMaxLogs.
|
protected |
Table of board feet for form class 81.
This is the volume, in board feet, for trees having 1 to 6 logs. First array index is m_iFormDBHIncs; second index is m_iMaxLogs.
|
protected |
Table of board feet for form class 84.
This is the volume, in board feet, for trees having 1 to 6 logs. First array index is m_iFormDBHIncs; second index is m_iMaxLogs.
|
protected |
Table of board feet for form class 85.
This is the volume, in board feet, for trees having 1 to 6 logs. First array index is m_iFormDBHIncs; second index is m_iMaxLogs.
|
protected |
Taper table.
This is the amount by which diameter is reduced, in inches, at the top of the last log in a 2-, 3-, 4-, 5-, or 6-log tree. First array index is 16 (m_iDBHIncs, DBH in 2-in increments from 10 to 40 inches); second index is 6 (m_iMaxLogs).
|
protected |
Value per thousand board feet of merchantable timber, in whatever currency the user prefers.
During parameter file reading this will be divided by 1000 to be value per foot of timber. Array size is # total species.
|
protected |
Holds data member codes for "Merch Val" float data member.
First array index is total # species, second is number types (3 - sapling, adult, snag)
|
protected |
Holds data member codes for the "value_x" float data members of the "Merchantable Timber Value" grid.
Array size is total # species.
|
protected |
Grid holding total values for each species.
The grid name is "Merchantable Timber Value". The grid contains only 1 grid cell. It has X float data members, where X = the total number of species. The data member names are "value_x", where "x" is the species number.