From ab9e1f6edefe264c39447b271e7a45b967c78e5c Mon Sep 17 00:00:00 2001 From: "patrick.lambert" <patrick.mh.lambert@inrae.fr> Date: Fri, 23 Apr 2021 08:56:39 +0200 Subject: [PATCH] correction for elegance --- .../java/species/ReproduceWithDiagnose.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/species/ReproduceWithDiagnose.java b/src/main/java/species/ReproduceWithDiagnose.java index e45c074..0eb64bb 100644 --- a/src/main/java/species/ReproduceWithDiagnose.java +++ b/src/main/java/species/ReproduceWithDiagnose.java @@ -25,7 +25,6 @@ import environment.Time.Season; import fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess; import fr.cemagref.simaqualife.kernel.util.TransientParameters.InitTransientParameters; import fr.cemagref.simaqualife.pilot.Pilot; -import miscellaneous.BinomialForSuperIndividualGen; import miscellaneous.Miscellaneous; import miscellaneous.Trio; import species.DiadromousFish.Gender; @@ -83,12 +82,12 @@ public class ReproduceWithDiagnose extends AquaNismsGroupProcess<DiadromousFish, private transient NormalGen genNormal; - /** - * the random numbers generator for binomial draws - * - * @unit -- - */ - private transient BinomialForSuperIndividualGen aleaGen; + // /** + // * the random numbers generator for binomial draws + // * + // * @unit -- + // */ + // private transient BinomialForSuperIndividualGen aleaGen; private transient MortalityFunction mortalityFunction; @@ -111,7 +110,7 @@ public class ReproduceWithDiagnose extends AquaNismsGroupProcess<DiadromousFish, super.initTransientParameters(pilot); genNormal = new NormalGen(pilot.getRandomStream(), new NormalDist(0., 1.)); - aleaGen = new BinomialForSuperIndividualGen(pilot.getRandomStream()); + // aleaGen = new BinomialForSuperIndividualGen(pilot.getRandomStream()); mortalityFunction = new MortalityFunction(); stockRecruitmentRelationship = new StockRecruitmentRelationship(); @@ -205,11 +204,11 @@ public class ReproduceWithDiagnose extends AquaNismsGroupProcess<DiadromousFish, amountPerSuperIndividual = alpha / maxNumberOfSuperIndividualPerReproduction; // Compute the Allee effect parameters S95 and S50 - if (Soffset >= 0.) {// Allee effect independant of catchment size (including + if (Soffset >= 0.) {// Allee effect independant of catchment size (including no Allee Effect) S95 = Soffset; S50 = Soffset; } else { - S95 = eta * riverBasin.getAccessibleSurface(); // corresponds to S* in the rougier publication + S95 = eta * riverBasin.getAccessibleSurface(); // corresponds to S* in the rougier etal 2015 S50 = S95 / ratioS95_S50; } // initilisation of the stock recruitment relationship @@ -535,7 +534,7 @@ class StockRecruitmentRelationship implements UnivariateFunction { // BH Stock-Recruitment relationship with logistic depensation double meanNumberOfRecruit = 0.; double effectiveStock = getEffectiveStock(stock); - if (stock > 0) + if (effectiveStock > 0) meanNumberOfRecruit = Math.round(alpha * effectiveStock) / (beta + effectiveStock); return meanNumberOfRecruit; } -- GitLab