Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/stockprey.cc
[mareframe] / trunk / gadget / stockprey.cc Repository:
ViewVC logotype

Annotation of /trunk/gadget/stockprey.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #include "stockprey.h"
2 :    
3 :     StockPrey::StockPrey(CommentStream& infile, const IntVector& Areas,
4 :     const char* givenname, int minage, int numage,
5 :     const TimeClass* const TimeInfo, Keeper* const keeper)
6 :     : Prey(infile, Areas, givenname, TimeInfo, keeper) {
7 :    
8 :     int i;
9 :     type = STOCKPREY;
10 :     IntVector lower(numage, 0);
11 :     IntVector agesize(numage, LgrpDiv->numLengthGroups());
12 :     preyAlkeys.resize(areas.Size(), minage, lower, agesize);
13 :     for (i = 0; i < preyAlkeys.Size(); i++)
14 :     preyAlkeys[i].setToZero();
15 :     }
16 :    
17 :     void StockPrey::Sum(const AgeBandMatrix& stockAlkeys, int area) {
18 :     int i, inarea = this->areaNum(area);
19 :     preyAlkeys[inarea].setToZero();
20 :     preyAlkeys[inarea].Add(stockAlkeys, *CI);
21 :     preyAlkeys[inarea].sumColumns(preynumber[inarea]);
22 :     total[inarea] = 0.0;
23 :     for (i = 0; i < preynumber.Ncol(inarea); i++) {
24 :     biomass[inarea][i] = preynumber[inarea][i].N * preynumber[inarea][i].W;
25 :     total[inarea] += biomass[inarea][i];
26 :     cons[inarea][i] = 0.0;
27 :     }
28 :     }
29 :    
30 :     void StockPrey::Print(ofstream& outfile) const {
31 :     int area;
32 :     Prey::Print(outfile);
33 :     outfile << "\n\tStock prey age length keys\n";
34 :     for (area = 0; area < areas.Size(); area++) {
35 :     outfile << "\tInternal area " << areas[area] << "\n\tNumber\n";
36 :     preyAlkeys[area].printNumbers(outfile);
37 :     outfile << "\tMean weight\n";
38 :     preyAlkeys[area].printWeights(outfile);
39 :     }
40 :     }

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge