Commit 11cbd429 authored by Lambert Patrick's avatar Lambert Patrick
Browse files

getter fiir both nutiren fluxes

parent 8fbafde8
......@@ -509,7 +509,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
targetedAgeForMaleSpawnerForFirstTime = 4.5;
//this.nutrientRoutine.getNutrientFluxesCollection().setBasinNames(this.getEnvironment().getRiverBasinNames());
this.nutrientRoutine.createNutrienFluxesCollection(this.getEnvironment().getRiverBasinNames());
this.nutrientRoutine.createNutrienFluxesCollections(this.getEnvironment().getRiverBasinNames());
}
......
......@@ -106,17 +106,15 @@ public class NutrientRoutine {
*/
private Map<DiadromousFish.Gender, Map<String,Double>> compoGametes;
// For juveniles - Based on Taverny (1991)
/**
* chemical composition of juveniles
* <key> chemical element
* <value> value
*/
private Map<String,Double> compoJuvenile;
private transient NutrientImportFluxesCollection nutrientImportFluxesCollection;
private transient NutrientExportFluxesCollection nutrientExportFluxesCollection;
public NutrientRoutine() {
......@@ -157,17 +155,27 @@ public class NutrientRoutine {
this.compoJuvenile = compoJuvenile;
this.nutrientImportFluxesCollection = new NutrientImportFluxesCollection();
this.nutrientExportFluxesCollection = new NutrientExportFluxesCollection();
}
public void createNutrienFluxesCollection(String[] basinNames) {
nutrientImportFluxesCollection = new NutrientImportFluxesCollection();
nutrientImportFluxesCollection.setBasinNames(basinNames);
public void createNutrienFluxesCollections(String[] basinNames) {
this.nutrientImportFluxesCollection = new NutrientImportFluxesCollection();
this.nutrientImportFluxesCollection.setBasinNames(basinNames);
this.nutrientExportFluxesCollection = new NutrientExportFluxesCollection();
this.nutrientExportFluxesCollection.setBasinNames(basinNames);
}
public NutrientImportFluxesCollection getNutrientFluxesCollection() {
public NutrientImportFluxesCollection getNutrientImportFluxesCollection() {
return nutrientImportFluxesCollection;
}
public NutrientExportFluxesCollection getNutrientExportFluxesCollection() {
return nutrientExportFluxesCollection;
}
/**
* compute the nutrient fluxes for a single fish (in the super individual)
......@@ -624,10 +632,11 @@ public class NutrientRoutine {
*/
//
private Map<Long, Map<String, Map<String, Double>>> exportFluxesCollection ;
private transient String[] basinNames;
NutrientExportFluxesCollection() {
exportFluxesCollection = new HashMap <Long, Map<String, Map<String, Double>>> ();
}
......
......@@ -268,11 +268,11 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
for (String nutrient: aFluxAfterSurvival.keySet()) {
//For all survival fish
group.getNutrientRoutine().getNutrientFluxesCollection().
group.getNutrientRoutine().getNutrientImportFluxesCollection().
put(Time.getYear(group.getPilot()), nutrient, fish.getBirthBasin().getName(), riverBasin.getName(), aFluxAfterSurvival.get(nutrient) * survivalAmount);
//For all dead fish
group.getNutrientRoutine().getNutrientFluxesCollection().
group.getNutrientRoutine().getNutrientImportFluxesCollection().
put(Time.getYear(group.getPilot()), nutrient, fish.getBirthBasin().getName(), riverBasin.getName(), aFluxForDeadFish.get(nutrient) * (fish.getAmount() - survivalAmount));
}
......@@ -299,7 +299,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
Map<String, Double> aFluxForDeadFish = group.getNutrientRoutine().computeNutrientsInputForDeathAfterSpawning(fish); //
for (String nutrient: aFluxForDeadFish.keySet()) {
group.getNutrientRoutine().getNutrientFluxesCollection().
group.getNutrientRoutine().getNutrientImportFluxesCollection().
put(Time.getYear(group.getPilot()), nutrient, fish.getBirthBasin().getName(), riverBasin.getName(), aFluxForDeadFish.get(nutrient) * (fish.getAmount() - survivalAmount));
}
biomass = group.getNutrientRoutine().getWeight(fish) * (fish.getAmount());
......
......@@ -115,7 +115,7 @@ public class Survive extends AquaNismsGroupProcess<DiadromousFish, DiadromousFis
Map<String, Double> aFluxForDeadFishBeforeSpawning = group.getNutrientRoutine().computeNutrientsInputForDeathBeforeSpawning(fish); //
for (String nutrient: aFluxForDeadFishBeforeSpawning.keySet()) {
group.getNutrientRoutine().getNutrientFluxesCollection().
group.getNutrientRoutine().getNutrientImportFluxesCollection().
put(Time.getYear(group.getPilot()), nutrient, fish.getBirthBasin().getName(), basin.getName(), aFluxForDeadFishBeforeSpawning.get(nutrient) * deathAmount);
}
......
......@@ -47,7 +47,7 @@ public class WriteImportNutrientFluxes extends AquaNismsGroupProcess<DiadromousF
bW.write("\n");
Map<Long, Map <String, Map<String, Map<String, Double>>>> fluxesCollection = group.getNutrientRoutine().getNutrientFluxesCollection().getImportFluxesCollection();
Map<Long, Map <String, Map<String, Map<String, Double>>>> fluxesCollection = group.getNutrientRoutine().getNutrientImportFluxesCollection().getImportFluxesCollection();
// to iterate on sorted years
List<Long> years = new ArrayList<Long>(fluxesCollection.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