1 : |
agomez |
1 |
#ifndef popinfo_h
|
2 : |
|
|
#define popinfo_h
|
3 : |
|
|
|
4 : |
|
|
#include "gadget.h" |
5 : |
|
|
|
6 : |
|
|
/**
|
7 : |
|
|
* \class PopInfo
|
8 : |
|
|
* \brief This is the class used to store information about the number, and mean weight, of a population cell of a stock
|
9 : |
|
|
*/
|
10 : |
|
|
class PopInfo {
|
11 : |
|
|
public:
|
12 : |
|
|
/**
|
13 : |
|
|
* \brief This is the PopInfo constructor
|
14 : |
|
|
*/
|
15 : |
|
|
PopInfo() { N = 0.0; W = 0.0; };
|
16 : |
|
|
/**
|
17 : |
|
|
* \brief This is the PopInfo destructor
|
18 : |
|
|
*/
|
19 : |
|
|
~PopInfo() {};
|
20 : |
|
|
/**
|
21 : |
|
|
* \brief This is the number of fish in the population cell
|
22 : |
|
|
*/
|
23 : |
|
|
double N;
|
24 : |
|
|
/**
|
25 : |
|
|
* \brief This is the mean weight of the fish in the population cell
|
26 : |
|
|
*/
|
27 : |
|
|
double W;
|
28 : |
|
|
/**
|
29 : |
|
|
* \brief This operator will subtract a number from the PopInfo
|
30 : |
|
|
* \param a is the number to subtract
|
31 : |
|
|
*/
|
32 : |
|
|
void operator -= (double a) { N -= a; };
|
33 : |
|
|
/**
|
34 : |
|
|
* \brief This operator will increase the PopInfo by a multiplicative constant
|
35 : |
|
|
* \param a is the multiplicative constant
|
36 : |
|
|
*/
|
37 : |
|
|
void operator *= (double a) { N *= a; };
|
38 : |
|
|
/**
|
39 : |
|
|
* \brief This function will set the PopInfo to zero
|
40 : |
|
|
*/
|
41 : |
|
|
void setToZero() { N = 0.0; W = 0.0; };
|
42 : |
|
|
/**
|
43 : |
|
|
* \brief This operator will set the PopInfo equal to an existing PopInfo
|
44 : |
|
|
* \param a is the PopInfo to copy
|
45 : |
|
|
*/
|
46 : |
|
|
PopInfo& operator = (const PopInfo& a);
|
47 : |
|
|
/**
|
48 : |
|
|
* \brief This operator will add an existing PopInfo to the current PopInfo
|
49 : |
|
|
* \param a is the PopInfo to add
|
50 : |
|
|
*/
|
51 : |
|
|
PopInfo& operator += (const PopInfo& a);
|
52 : |
|
|
/**
|
53 : |
|
|
* \brief This operator will multiply the PopInfo by a constant
|
54 : |
|
|
* \param a is the constant
|
55 : |
|
|
*/
|
56 : |
|
|
PopInfo operator * (double a);
|
57 : |
|
|
};
|
58 : |
|
|
|
59 : |
|
|
#endif
|