diff --git a/src/main/java/species/NutrientRoutine.java b/src/main/java/species/NutrientRoutine.java index 964b504eb1dc5e0158547b3de5c8f04dcc08c9e8..598a6d68bbc7ba611a9294fc405070b58c82206d 100644 --- a/src/main/java/species/NutrientRoutine.java +++ b/src/main/java/species/NutrientRoutine.java @@ -114,9 +114,9 @@ public class NutrientRoutine { public NutrientRoutine() { - + } - + /** * Constructor based on the 5 Map of fish composition * @param fishFeaturesPreSpawning @@ -287,7 +287,7 @@ public class NutrientRoutine { public double getWeight (DiadromousFish fish, SpawningPosition spawningPosition) { double weight = 0.; - if (fish.getStage()==Stage.IMMATURE) + if (fish.getStage()==Stage.IMMATURE) weight = juvenileFeatures.get("aLW") * Math.pow(fish.getLength(),juvenileFeatures.get("bLW")); else //Stage.MATURE if (spawningPosition == SpawningPosition.PRE) @@ -312,14 +312,14 @@ public class NutrientRoutine { public double getGonadWeight (DiadromousFish fish, SpawningPosition spawningPosition) { double gonadWeight = 0.; - if (fish.getStage()==Stage.MATURE); - if (spawningPosition == SpawningPosition.PRE) - gonadWeight = Math.exp(fishFeaturesPreSpawning.get(fish.getGender()).get("aLW_Gonad") - + fishFeaturesPreSpawning.get(fish.getGender()).get("bLW_Gonad") * Math.log(fish.getLength())); - else - gonadWeight = Math.exp(fishFeaturesPostSpawning.get(fish.getGender()).get("aLW_Gonad") - + fishFeaturesPostSpawning.get(fish.getGender()).get("bLW_Gonad") * Math.log(fish.getLength())); - + if (fish.getStage()==Stage.MATURE) { + if (spawningPosition == SpawningPosition.PRE) + gonadWeight = Math.exp(fishFeaturesPreSpawning.get(fish.getGender()).get("aLW_Gonad") + + fishFeaturesPreSpawning.get(fish.getGender()).get("bLW_Gonad") * Math.log(fish.getLength())); + else + gonadWeight = Math.exp(fishFeaturesPostSpawning.get(fish.getGender()).get("aLW_Gonad") + + fishFeaturesPostSpawning.get(fish.getGender()).get("bLW_Gonad") * Math.log(fish.getLength())); + } return gonadWeight; }