[mareframe] Annotation of /trunk/gadget/lengthprey.cc
Annotation of /trunk/gadget/lengthprey.cc
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
1 : |
agomez |
1 |
#include "lengthprey.h" |
2 : |
|
|
|
3 : |
|
|
LengthPrey::LengthPrey(CommentStream& infile, const char* givenname,
|
4 : |
|
|
const IntVector& Areas, const TimeClass* const TimeInfo, Keeper* const keeper)
|
5 : |
|
|
: Prey(infile, givenname, Areas, TimeInfo, keeper) {
|
6 : |
|
|
|
7 : |
|
|
type = LENGTHPREY;
|
8 : |
|
|
}
|
9 : |
|
|
|
10 : |
|
|
/* Sum number in Prey length groups. Prey length division is not
|
11 : |
|
|
* allowed to be finer than stock length division. */
|
12 : |
|
|
void LengthPrey::Sum(const PopInfoVector& NumberInArea, int area) {
|
13 : |
|
|
int i, inarea = this->areaNum(area);
|
14 : |
|
|
preynumber[inarea].Sum(&NumberInArea, *CI);
|
15 : |
|
|
total[inarea] = 0.0;
|
16 : |
|
|
for (i = 0; i < preynumber.Ncol(inarea); i++) {
|
17 : |
|
|
biomass[inarea][i] = preynumber[inarea][i].N * preynumber[inarea][i].W;
|
18 : |
|
|
total[inarea] += biomass[inarea][i];
|
19 : |
|
|
cons[inarea][i] = 0.0;
|
20 : |
|
|
}
|
21 : |
|
|
}
|
|