Commit 8d4b11a3 authored by Poulet Camille's avatar Poulet Camille
Browse files

Try_Export_Abundance

parent c26977cb
......@@ -199,7 +199,7 @@
<yearOfTheUpdate>0</yearOfTheUpdate>
<basinsToUpdateFile>data/input/reality/basinsToUpdate.csv</basinsToUpdateFile>
<outputPath>data/output/</outputPath>
<minYearToWrite>1840</minYearToWrite>
<minYearToWrite>1900</minYearToWrite>
<fileNameFluxes>nutrientFluxes</fileNameFluxes>
<lengthAtHatching>2.0</lengthAtHatching>
<linfVonBertForFemale>70.0</linfVonBertForFemale>
......@@ -280,7 +280,7 @@
<exportSeason>SPRING</exportSeason>
<fileNameOutput>effectiveBiomassFluxesBeforeReproduction</fileNameOutput>
</species.WriteEffectiveAndBiomassFluxes>
<species.ReproduceAndSurviveAfterReproductionWithDiagnose>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<reproductionSeason>SPRING</reproductionSeason>
......
......@@ -466,7 +466,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
fileNameFluxes +this.getSimulationId() + ".csv")));
bWForFluxes.write("timestep"+sep+"year"+sep+"season"+sep+"basin"
+sep+"abundance" + sep + "fluxType"+ sep + "origin" +sep+"biomass");
+sep+"abundance" + sep + "fluxType"+ sep + "origin" +sep+"abundanceExp"+sep+ "biomass");
for (String nutrient : nutrientRoutine.getNutrientsOfInterest()) {
bWForFluxes.write(sep+nutrient);
}
......
......@@ -40,6 +40,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
//On cr�er la Map pour stocker les flux d'export
Map<String, Double> totalOutputFluxes = new Hashtable<String, Double>();
List<Duo<DiadromousFish,Basin>> fishesToMove = new ArrayList<Duo<DiadromousFish,Basin>>();
for (RiverBasin basin : group.getEnvironment().getRiverBasins()) {
......@@ -52,12 +53,14 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
totalOutputFluxes.put(nutrient, 0.);
}
totalOutputFluxes.put("biomass", 0.); //cr�ation de la biomasse
totalOutputFluxes.put("abundanceExp", 0.);
if (fishes!=null) {
for (DiadromousFish fish : fishes) {
destination = group.getEnvironment().getAssociatedSeaBasin(fish.getPosition());
fishesToMove.add(new Duo<DiadromousFish, Basin>(fish, destination)); //Mentionne la sortie d'un poisson de la boucle
double abundanceExp = fish.getAmount();
double biomass = group.getNutrientRoutine().getWeight(fish) * fish.getAmount();
if (fish.getStage()==Stage.IMMATURE) {
......@@ -69,6 +72,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
}
totalOutputFluxes.put("biomass", totalOutputFluxes.get("biomass") + biomass);
totalOutputFluxes.put("abundanceExp", totalOutputFluxes.get("abundanceExp")+ abundanceExp);
}
}
}
......@@ -88,7 +92,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
bW.write(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot())
+";"+ basin.getName() + ";" + basin.getJuvenileNumber() + ";EXPORT; NONE");
bW.write(";" + totalOutputFluxes.get("biomass"));
bW.write(";" + totalOutputFluxes.get("abundanceExp") + ";" + totalOutputFluxes.get("biomass"));
for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) {
bW.write(";" + totalOutputFluxes.get(nutrient));
}
......@@ -101,4 +105,5 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
}
}
}
}
\ No newline at end of file
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