Commit a02df59d authored by Lambert Patrick's avatar Lambert Patrick
Browse files

avoid double call to getKopt

parent 06687919
...@@ -120,20 +120,18 @@ public class Grow extends AquaNismsGroupProcess<DiadromousFish, DiadromousFishGr ...@@ -120,20 +120,18 @@ public class Grow extends AquaNismsGroupProcess<DiadromousFish, DiadromousFishGr
* @param fish * @param fish
* @param group * @param group
* @return the Brody coeff from Diadromousgroup if exists or from this grow process * @return the Brody coeff from Diadromousgroup if exists or from this grow process
* depends of the fish gender .In case of undifferentiaced fish, the mean for male and female is considered
*/ */
public double getKOpt(DiadromousFish fish, DiadromousFishGroup group) { public double getKOpt(DiadromousFish fish, DiadromousFishGroup group) {
double kOpt = 0.; double kOpt = group.getKOpt(fish);
if (Double.isNaN(group.getKOpt(fish))){ if (Double.isNaN(kOpt)){ // no definition for the group
if (fish.getGender() == Gender.FEMALE) if (fish.getGender() == Gender.FEMALE)
kOpt = kOptForFemale; kOpt = kOptForFemale;
else if (fish.getGender() == Gender.MALE) else if (fish.getGender() == Gender.MALE)
kOpt = kOptForMale; kOpt = kOptForMale;
else else
kOpt= (kOptForFemale + kOptForMale) / 2.; kOpt= (kOptForFemale + kOptForMale) / 2.;
} }
else
kOpt = group.getKOpt(fish);
return kOpt; return kOpt;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment