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
* @param fish
* @param group
* @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) {
double kOpt = 0.;
if (Double.isNaN(group.getKOpt(fish))){
double kOpt = group.getKOpt(fish);
if (Double.isNaN(kOpt)){ // no definition for the group
if (fish.getGender() == Gender.FEMALE)
kOpt = kOptForFemale;
else if (fish.getGender() == Gender.MALE)
kOpt = kOptForMale;
kOpt= (kOptForFemale + kOptForMale) / 2.;
kOpt = group.getKOpt(fish);
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