Go to the documentation of this file. 1 #ifndef MOJA_MODULES_CBM_HELPER_H_
2 #define MOJA_MODULES_CBM_HELPER_H_
4 #include <boost/algorithm/string.hpp>
6 #include "moja/modules/cbm/_modules.cbm_exports.h"
17 static double calculateMerchFactor(
double volume,
double a,
double b);
19 static double calculateNonMerchFactor(
20 double merchStemwood,
double a_nonmerch,
21 double b_nonmerch,
double k_nonmerch);
23 static double calculateSaplingFactor(
double stemwood,
double k_sap,
24 double a_sap,
double b_sap);
26 static double modelTerm(
double vol,
double a1,
double a2,
double a3);
28 static bool runMoss(
int gcID, std::string mossLeadingSpecies, std::string speciesName);
35 return a * pow(volume, b);
42 double merchStemwood,
double a_nonmerch,
double b_nonmerch,
double k_nonmerch) {
44 if (merchStemwood > 0.0) {
45 return k_nonmerch + a_nonmerch * pow(merchStemwood, b_nonmerch);
48 return exp(a_nonmerch);
55 double stemwood,
double k_sap,
double a_sap,
double b_sap) {
58 return k_sap + a_sap * pow(stemwood, b_sap);
68 return exp(a1 + a2 * vol + a3 * log(vol + 5.0));
71 inline bool Helper::runMoss(
int gcID, std::string mossLeadingSpecies, std::string speciesName) {
72 boost::algorithm::to_lower(mossLeadingSpecies);
73 boost::algorithm::to_lower(speciesName);
75 return (gcID > 0 && boost::contains(speciesName, mossLeadingSpecies));
80 #endif // MOJA_MODULES_CBM_HELPER_H_
static bool runMoss(int gcID, std::string mossLeadingSpecies, std::string speciesName)
Definition: helper.h:71
Definition: ageclasshelper.cpp:12
static double modelTerm(double vol, double a1, double a2, double a3)
see equations 4,5,6,7 on page 8 of Boudewyn et al 2007
Definition: helper.h:67
static double calculateNonMerchFactor(double merchStemwood, double a_nonmerch, double b_nonmerch, double k_nonmerch)
see equation 2 on page 7 of Boudewyn et al 2007
Definition: helper.h:41
static double calculateMerchFactor(double volume, double a, double b)
see equation 1 on page 7 of Boudewyn et al 2007
Definition: helper.h:34
static double calculateSaplingFactor(double stemwood, double k_sap, double a_sap, double b_sap)
page 8 Boudewyn et al equation 3
Definition: helper.h:54
Definition: ageclasshelper.cpp:10