-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpha_beta.hpp
65 lines (40 loc) · 1.53 KB
/
alpha_beta.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef ALPHA_BETA_HPP
#define ALPHA_BETA_HPP
#include "../ATL/ATL.hpp"
#include "../functional_analysis.hpp"
template<typename T>
class BevertonHoltAlphaBeta : public FunctionalAnalysis<T> {
public:
typedef typename FunctionalAnalysis<double>::Variable Variable;
//parameter set
Variable alpha;
Variable beta;
//fixed
Variable phi = 1.06;
Variable S = 7049.0;
BevertonHoltAlphaBeta(){
}
virtual void Initialize() {
this->name = "bh_alpha_beta_recruitment";
this->description = "Functional analysis of the alpha beta formulation for Beverton-Holt recruitment.";
this->alpha.SetName("alpha");
this->alpha.SetBounds(1.0, 10.0);
this->RegisterParameter(this->alpha, 0.01);
this->beta.SetName("beta");
this->beta.SetBounds(1.0, 10.0);
this->RegisterParameter(this->beta, 0.01);
this->phi.SetName("phi");
this->phi.SetBounds(0.5, 1.0);
this->RegisterParameter(this->phi, 0.1);
this->S.SetName("S");
this->S.SetBounds(6000.0, 10000.0);
this->RegisterParameter(this->S, 1000);
}
virtual Variable Evaluate() {
Variable h = (this->alpha*this->phi)/(4.0 + this->alpha*this->phi);
Variable R0 = (1.0/this->beta)*(this->alpha - (1.0/this->phi));
Variable R = (4.0*R0*h*this->S)/((1.0-h) * R0*this->phi + (5.0*h -1.0)*this->S);
return R;
}
};
#endif