Author: echatellier Date: 2015-06-23 09:46:17 +0000 (Tue, 23 Jun 2015) New Revision: 365 Url: http://forge.codelutin.com/projects/isis-fish-data/repository/revisions/365 Log: Rename groupMin / groupMax Modified: branches/4.4.0-resultnames/scripts/SiMatrix.java Modified: branches/4.4.0-resultnames/scripts/SiMatrix.java =================================================================== --- branches/4.4.0-resultnames/scripts/SiMatrix.java 2015-06-18 18:18:30 UTC (rev 364) +++ branches/4.4.0-resultnames/scripts/SiMatrix.java 2015-06-23 09:46:17 UTC (rev 365) @@ -1168,7 +1168,7 @@ double Fgroup = 0; double Cgroup = 0; double Mgroup = 0; - double NgroupJan = 0; + double NgroupRef = 0; List<Population> populations = Collections.singletonList(pop); List<PopulationGroup> groups = pop.getPopulationGroup(); @@ -1215,13 +1215,18 @@ Mgroup = naturalDeathRatePop.getValue(group); //log.info("Mgroup= " + Mgroup + "Year=" + step.getYear()); - MatrixND abundancePopJan = resManager.getMatrix(new TimeStep(12*step.getYear()), pop, MatrixAbundance.NAME); // Le timestep 0 correspond a janvier de la premiere annee et les annees sont numerotees a partir de zero - abundancePopJan = abundancePopJan.sumOverDim(1); // somme sur Zone - abundancePopJan = abundancePopJan.reduce(); - NgroupJan = abundancePopJan.getValue(group); - //log.info("NgroupJan = " + NgroupJan + "Year=" + step.getYear()); + Month abundanceReferenceMonth = pop.getAbundanceReferenceMonth(); + if (abundanceReferenceMonth == null) { + abundanceReferenceMonth = Month.JANUARY; + } + TimeStep refStep = new TimeStep(12 * step.getYear() + abundanceReferenceMonth.getMonthNumber()); + MatrixND abundancePopRef = resManager.getMatrix(refStep, pop, MatrixAbundance.NAME); // Le timestep 0 correspond a janvier de la premiere annee et les annees sont numerotees a partir de zero + abundancePopRef = abundancePopRef.sumOverDim(1); // somme sur Zone + abundancePopRef = abundancePopRef.reduce(); + NgroupRef = abundancePopRef.getValue(group); + //log.info("NgroupRef = " + NgroupJan + "Year=" + step.getYear()); - ObjectiveFunction f = new ObjectiveFunctionBaranov(Cgroup, Mgroup, NgroupJan); + ObjectiveFunction f = new ObjectiveFunctionBaranov(Cgroup, Mgroup, NgroupRef); Fgroup = MinimisationUtil.fmin(0.0,2.0,1.0e-10, f); // step ?? //log.info("Fgroup = " + Fgroup); @@ -1253,8 +1258,8 @@ List<PopulationGroup> groups = pop.getPopulationGroup(); - int groupMin = pop.getGroupMin(); - int groupMax = pop.getGroupMax(); + int groupMin = pop.getFbarGroupMin(); + int groupMax = pop.getFbarGroupMax(); int Nbre = (int)groupMax - (int)groupMin + 1; //log.info("Nbre = " + Nbre);
participants (1)
-
echatellier@users.forge.codelutin.com