1 : |
agomez |
1 |
#ifndef stockvariable_h
|
2 : |
|
|
#define stockvariable_h
|
3 : |
|
|
|
4 : |
|
|
#include "formulavector.h" |
5 : |
|
|
#include "areatime.h" |
6 : |
|
|
#include "commentstream.h" |
7 : |
|
|
#include "charptrvector.h" |
8 : |
|
|
#include "stockptrvector.h" |
9 : |
|
|
|
10 : |
|
|
/**
|
11 : |
|
|
* \class StockVariable
|
12 : |
|
|
* \brief This is the class used to calculate the value of the stock-dependent variables used in the model simulation
|
13 : |
|
|
*/
|
14 : |
|
|
class StockVariable {
|
15 : |
|
|
public:
|
16 : |
|
|
/**
|
17 : |
|
|
* \brief This is the default StockVariable constructor
|
18 : |
|
|
*/
|
19 : |
|
|
StockVariable() { value = 0.0; };
|
20 : |
|
|
/**
|
21 : |
|
|
* \brief This is the default StockVariable destructor
|
22 : |
|
|
*/
|
23 : |
|
|
~StockVariable();
|
24 : |
|
|
/**
|
25 : |
|
|
* \brief This function will read StockVariable data from file
|
26 : |
|
|
* \param infile is the CommentStream to read the data from
|
27 : |
|
|
*/
|
28 : |
|
|
void read(CommentStream& infile);
|
29 : |
|
|
/**
|
30 : |
|
|
* \brief This function will return the value of the StockVariable
|
31 : |
|
|
* \return the value of the StockVariable
|
32 : |
|
|
*/
|
33 : |
|
|
double getValue() const { return value; };
|
34 : |
|
|
/**
|
35 : |
|
|
* \brief This function will swap the StockVariable value for a new value
|
36 : |
|
|
* \param newSV is the new StockVariable value
|
37 : |
|
|
*/
|
38 : |
|
|
void Interchange(StockVariable& newSV) const;
|
39 : |
|
|
/**
|
40 : |
|
|
* \brief This function will update the StockVariable value
|
41 : |
|
|
*/
|
42 : |
|
|
void Update();
|
43 : |
|
|
/**
|
44 : |
|
|
* \brief This function will delete a StockVariable value
|
45 : |
|
|
*/
|
46 : |
|
|
void Delete() const;
|
47 : |
|
|
private:
|
48 : |
|
|
/**
|
49 : |
|
|
* \brief This is the value of the StockVariable
|
50 : |
|
|
*/
|
51 : |
|
|
double value;
|
52 : |
|
|
/**
|
53 : |
|
|
* \brief This is the flag to denote whether the stock calculations should be based on the biomass of the stocks, or the population number
|
54 : |
|
|
* \note The default value is 1, which calculates the value based on the biomass
|
55 : |
|
|
*/
|
56 : |
|
|
int biomass;
|
57 : |
|
|
/**
|
58 : |
|
|
* \brief This is the CharPtrVector of the names of the stocks that will be used to calculate the StockVariable value
|
59 : |
|
|
*/
|
60 : |
|
|
CharPtrVector stocknames;
|
61 : |
|
|
/**
|
62 : |
|
|
* \brief This is the StockPtrVector of the stocks that will be used to calculate the StockVariable value
|
63 : |
|
|
*/
|
64 : |
|
|
StockPtrVector stocks;
|
65 : |
|
|
};
|
66 : |
|
|
|
67 : |
|
|
#endif
|