Author: echatellier Date: 2015-10-22 13:45:06 +0200 (Thu, 22 Oct 2015) New Revision: 377 Url: http://forge.codelutin.com/projects/isis-fish-data/repository/revisions/377 Log: fixes #7666: Ajouter l'?\195?\169quation de mortalit?\195?\169 par p?\195?\170che Other Modified: trunk/pom.xml trunk/scripts/SiMatrix.java trunk/scripts/SiMatrixEffortByCell.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2015-10-15 08:50:55 UTC (rev 376) +++ trunk/pom.xml 2015-10-22 11:45:06 UTC (rev 377) @@ -36,7 +36,7 @@ <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> - <version>3.2</version> + <version>3.3</version> <configuration> <source>1.7</source> <target>1.7</target> @@ -49,7 +49,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> - <version>1.3.2</version> + <version>1.4.0</version> <executions> <execution> <goals> Modified: trunk/scripts/SiMatrix.java =================================================================== --- trunk/scripts/SiMatrix.java 2015-10-15 08:50:55 UTC (rev 376) +++ trunk/scripts/SiMatrix.java 2015-10-22 11:45:06 UTC (rev 377) @@ -236,6 +236,21 @@ return result; } + /** + * Since 4.4, FishingMortalityOtherFleets must be added everewhere NaturalDeathRate was + * used. + * + * @param step current step + * @param group group + * @param zone zone + * @return + */ + public double getTotalDeathRate(TimeStep step, PopulationGroup group, Zone zone) { + double n = group.getNaturalDeathRate(zone); + double o = group.getFishingMortalityOtherFleets(zone); + return n + o; + } + /////////////////////////////////////////////////////////////////////////// // // Toutes les methodes suivantes ne sont utiles que pour @@ -442,7 +457,7 @@ */ private double totalCatchRate(TimeStep step, PopulationGroup group, Zone zone, double totalFishingMortality) throws TopiaException { - double M = group.getNaturalDeathRate(zone) / Month.NUMBER_OF_MONTH; + double M = getTotalDeathRate(step, group, zone) / Month.NUMBER_OF_MONTH; if (M == 0) { // normalement il devrait y avoir de la mortalite naturelle if (log.isWarnEnabled()) { @@ -935,7 +950,7 @@ PopulationGroup group = groups.get(g); for (int z = 0; z < zones.size(); z++) { Zone zone = zones.get(z); - double M = group.getNaturalDeathRate(zone) + double M = getTotalDeathRate(step, group, zone) / (double) Month.NUMBER_OF_MONTH; double value = (double) Math.exp(-M); @@ -962,7 +977,7 @@ IsisFishException { double F = totalFishingMortality(step, matrixFishingMortality) .getValue(group, zone); //totalFishingMortality(step, group, zone); // rem perf: totalFishingMortality a deja ete calcule - double M = group.getNaturalDeathRate(zone) + double M = getTotalDeathRate(step, group, zone) / (double) Month.NUMBER_OF_MONTH; double result = Math.exp(-(F + M)); Modified: trunk/scripts/SiMatrixEffortByCell.java =================================================================== --- trunk/scripts/SiMatrixEffortByCell.java 2015-10-15 08:50:55 UTC (rev 376) +++ trunk/scripts/SiMatrixEffortByCell.java 2015-10-22 11:45:06 UTC (rev 377) @@ -256,7 +256,7 @@ double F = totalFishingMortalityPerCell(step, matrixFishingMortalityPerCell).getValue(group, zone, cell); //totalFishingMortality(step, group, zone); // rem perf: totalFishingMortality a deja ete calcule - double M = group.getNaturalDeathRate(zone) + double M = getTotalDeathRate(step, group, zone) / (double) Month.NUMBER_OF_MONTH; double result = (double) Math.exp(-(F + M)); @@ -499,7 +499,7 @@ private double totalCatchRatePerCell(TimeStep step, PopulationGroup group, Zone zone, double totalFishingMortalityPerCell) throws TopiaException { - double M = group.getNaturalDeathRate(zone) / Month.NUMBER_OF_MONTH; + double M = getTotalDeathRate(step, group, zone) / Month.NUMBER_OF_MONTH; if (M == 0) { // normalement il devrait y avoir de la mortalite naturelle if (log.isWarnEnabled()) {