Commit f846ba58 authored by Poulet Camille's avatar Poulet Camille
Browse files

Compute Nutrient Fluxes in each watershed for population

parent beb94e50
......@@ -269,11 +269,6 @@
<mortalityRateInOffshore>0.4</mortalityRateInOffshore>
</species.Survive>
<species.ExportLenghtAgeDistribution>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<exportSeason>SPRING</exportSeason>
<fileNameOutput>lengthAgeDistribution</fileNameOutput>
</species.ExportLenghtAgeDistribution>
<species.ReproduceAndSurviveAfterReproductionWithDiagnose>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
......
......@@ -308,6 +308,12 @@ public class FishNutrient {
return getWeight (fish, SpawningPosition.PRE);
}
public ArrayList<String> getNutrientsOfInterest() {
return nutrientsOfInterest;
}
/**
* @param args
*/
......
......@@ -3,6 +3,7 @@ package species;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
......@@ -107,6 +108,15 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
List<DiadromousFish> fishInBasin = riverBasin.getFishs(group);
if (fishInBasin != null){
Map<String, Double> totalFluxes = new Hashtable<String, Double>(); //On crer la Map pour stocker les flux
for (String nutrient : group.getFishNutrient().getNutrientsOfInterest()) {
totalFluxes.put(nutrient, 0.); // ON MET A JOUR NOTRE map
}
// --------------------------------------------------------------------------------------------------
// definition of the stock recruiment relationship
......@@ -341,14 +351,27 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
// --------------------------------------------------------------------------------------------------
for (DiadromousFish fish : deadFish){
group.getFishNutrient().computeNutrientsInputForDeathAfterSpawning(fish); //
Map<String, Double> aFlux = group.getFishNutrient().computeNutrientsInputForDeathAfterSpawning(fish); //
for (String nutrient: aFlux.keySet()) {
totalFluxes.put(nutrient,totalFluxes.get(nutrient) + aFlux.get(nutrient) * fish.getAmount());
}
group.removeAquaNism(fish);
}
deadFish.clear();
System.out.println(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot()) + ";"
+ riverBasin.getName() + "; " + totalFluxes);
}
else {
riverBasin.setYearOfLastNulRep(Time.getYear(group.getPilot()));
}
// System.out.println("("+numberOfGenitors+")");
//System.out.println(" BEFORE " +riverBasin.getSpawnerOrigins().keySet());
......
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