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

Add coloumnn abundance in csv file

parent 55e4f229
...@@ -307,13 +307,13 @@ ...@@ -307,13 +307,13 @@
<maxNumberOfSuperIndividualPerReproduction>50.0 <maxNumberOfSuperIndividualPerReproduction>50.0
</maxNumberOfSuperIndividualPerReproduction> </maxNumberOfSuperIndividualPerReproduction>
<withDiagnose>false</withDiagnose> <withDiagnose>false</withDiagnose>
<displayFluxesOnConsole>false</displayFluxesOnConsole> <displayFluxesOnConsole>true</displayFluxesOnConsole>
</species.ReproduceAndSurviveAfterReproductionWithDiagnose> </species.ReproduceAndSurviveAfterReproductionWithDiagnose>
<species.MigrateToSea> <species.MigrateToSea>
<seaMigrationSeason>SUMMER</seaMigrationSeason> <seaMigrationSeason>SUMMER</seaMigrationSeason>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode> <synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<displayFluxesOnConsole>false</displayFluxesOnConsole> <displayFluxesOnConsole>true</displayFluxesOnConsole>
</species.MigrateToSea> </species.MigrateToSea>
<environment.updateTemperatureInRealBasin> <environment.updateTemperatureInRealBasin>
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
<long>2000</long> <long>2000</long>
<long>2100</long> <long>2100</long>
</years> </years>
<fileNameOutput>fluxes</fileNameOutput> <fileNameOutput>JeuParam100_2100RCP85_A_essai</fileNameOutput>
</species.IdentifyPopulation> </species.IdentifyPopulation>
<species.TypeTrajectoryCV> <species.TypeTrajectoryCV>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode> <synchronisationMode>ASYNCHRONOUS</synchronisationMode>
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<long>2100</long> <long>2100</long>
</years> </years>
<fluxesSeason>SPRING</fluxesSeason> <fluxesSeason>SPRING</fluxesSeason>
<fileNameOutput>fluxes</fileNameOutput> <fileNameOutput>JeuParam100_20100RCP85_A_essai</fileNameOutput>
</species.IdentifyPopulation> </species.IdentifyPopulation>
<species.ExportRecruitment> <species.ExportRecruitment>
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<species.ExportPopulationStatus> <species.ExportPopulationStatus>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode> <synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<fileNameMortality>mortalty</fileNameMortality> <fileNameMortality>mortality</fileNameMortality>
<fileNameMortalityCrash>mortalityCrash</fileNameMortalityCrash> <fileNameMortalityCrash>mortalityCrash</fileNameMortalityCrash>
<fileNameStockTrap>stockTrap</fileNameStockTrap> <fileNameStockTrap>stockTrap</fileNameStockTrap>
<fileNamePopulationStatus>populationStatus</fileNamePopulationStatus> <fileNamePopulationStatus>populationStatus</fileNamePopulationStatus>
......
...@@ -409,10 +409,10 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe ...@@ -409,10 +409,10 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
new File(this.outputPath +fileNameFluxes).getParentFile().mkdirs(); new File(this.outputPath +fileNameFluxes).getParentFile().mkdirs();
try { try {
bWForFluxes = new BufferedWriter(new FileWriter(new File(this.outputPath+ bWForFluxes = new BufferedWriter(new FileWriter(new File(this.outputPath+
fileNameFluxes +this.getSimulationId()+ ".csv"))); fileNameFluxes +this.getSimulationId() + ".csv")));
bWForFluxes.write("timestep"+sep+"year"+sep+"season"+sep+"basin" bWForFluxes.write("timestep"+sep+"year"+sep+"season"+sep+"basin"
+sep+"fluxType"+sep+"origine"+sep+"biomass"); +sep+"abundance" + sep + "fluxType"+sep+"origine"+sep+"biomass");
for (String nutrient : nutrientRoutine.getNutrientsOfInterest()) { for (String nutrient : nutrientRoutine.getNutrientsOfInterest()) {
bWForFluxes.write(sep+nutrient); bWForFluxes.write(sep+nutrient);
} }
......
...@@ -84,7 +84,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo ...@@ -84,7 +84,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
try { try {
bW.write(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot()) bW.write(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot())
+";"+ basin.getName() + ";IMPORT; NONE"); +";"+ basin.getName() + ";" + basin.getJuvenileNumber() + ";EXPORT; NONE");
bW.write(";" + totalOutputFluxes.get("biomass")); bW.write(";" + totalOutputFluxes.get("biomass"));
for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) { for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) {
bW.write(";" + totalOutputFluxes.get(nutrient)); bW.write(";" + totalOutputFluxes.get(nutrient));
......
...@@ -356,8 +356,8 @@ public class NutrientRoutine { ...@@ -356,8 +356,8 @@ public class NutrientRoutine {
Map <String, Double> anExcretionRate = new Hashtable <String, Double>(); Map <String, Double> anExcretionRate = new Hashtable <String, Double>();
anExcretionRate.put("N", 24.71E-6); //values from Barber et al, Alosa sapidissima in ug/g wet mass/hour : convertit en g anExcretionRate.put("N", 24.71E-6); //values from Barber et al, Alewifes in ug/g wet mass/hour : convertit en g
anExcretionRate.put("P", 2.17E-6); //values from Barber et al, Alosa sapidissima in ug/g wet mass/hour: convertit en g anExcretionRate.put("P", 2.17E-6); //values from Barber et al, Alewifes in ug/g wet mass/hour: convertit en g
System.out.println("anExcretionRate: " + anExcretionRate.toString()); // System.out.println("anExcretionRate: " + anExcretionRate.toString()); //
...@@ -431,13 +431,13 @@ public class NutrientRoutine { ...@@ -431,13 +431,13 @@ public class NutrientRoutine {
// carcass composition for fish before spawning // carcass composition for fish before spawning
Map<Gender, Map<String, Double>> aCompoCarcassPreSpawning = new Hashtable<DiadromousFish.Gender,Map<String,Double>>(); Map<Gender, Map<String, Double>> aCompoCarcassPreSpawning = new Hashtable<DiadromousFish.Gender,Map<String,Double>>();
Map<String,Double> aCompo = new Hashtable<String,Double>(); Map<String,Double> aCompo = new Hashtable<String,Double>();
aCompo.put("N", 2.958 / 100.); //On remplit une collection avec un put. aCompo.put("N", 2.958 / 100.); //On remplit une collection avec un put. Values from Haskell (2018) Alosa sapidissima (%)
aCompo.put("P", 0.673 / 100.); aCompo.put("P", 0.673 / 100.); //Values from Haskell (2018) Alosa sapidissima (%)
aCompoCarcassPreSpawning.put(Gender.FEMALE,aCompo); aCompoCarcassPreSpawning.put(Gender.FEMALE,aCompo);
aCompo = new Hashtable<String,Double>(); aCompo = new Hashtable<String,Double>();
aCompo.put("N", 2.941 / 100.); aCompo.put("N", 2.941 / 100.); //Values from Haskell (2018) Alosa sapidissima (%)
aCompo.put("P", 0.666 / 100.); aCompo.put("P", 0.666 / 100.);// Values from Haskell (2018) Alosa sapidissima (%)
aCompoCarcassPreSpawning.put(Gender.MALE,aCompo); aCompoCarcassPreSpawning.put(Gender.MALE,aCompo);
System.out.println("aCompoCarcassPreSpawning: " + aCompoCarcassPreSpawning.toString()); // System.out.println("aCompoCarcassPreSpawning: " + aCompoCarcassPreSpawning.toString()); //
......
...@@ -169,6 +169,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG ...@@ -169,6 +169,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
// age of autochnonous spawnser // age of autochnonous spawnser
Map<Integer, Long> ageOfNativeSpawners = new TreeMap<Integer, Long>(); Map<Integer, Long> ageOfNativeSpawners = new TreeMap<Integer, Long>();
// compute the number of spawners and keep the origines of the spawners // compute the number of spawners and keep the origines of the spawners
for (DiadromousFish fish : fishInBasin){ for (DiadromousFish fish : fishInBasin){
...@@ -310,7 +311,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG ...@@ -310,7 +311,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
} }
} }
} }
System.out.println("\t"+message); //System.out.println("\t"+message);
} }
// -------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------
...@@ -401,18 +402,17 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG ...@@ -401,18 +402,17 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
} }
deadFish.clear(); deadFish.clear();
if (displayFluxesOnConsole) if (displayFluxesOnConsole)
System.out.println(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot()) + ";IMPORT;" System.out.println(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot()) + ";IMPORT;"
+ riverBasin.getName() + "; " + totalInputFluxes); + riverBasin.getName() + ";" + riverBasin.getSpawnerNumber() + "; " + totalInputFluxes);
BufferedWriter bW = group.getbWForFluxes(); BufferedWriter bW = group.getbWForFluxes();
if ( bW != null) { if ( bW != null) {
try { try {
for (fluxOrigin origin : totalInputFluxes.keySet()) { for (fluxOrigin origin : totalInputFluxes.keySet()) {
bW.write(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot()) bW.write(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot())
+";"+ riverBasin.getName() + ";IMPORT;"+origin); +";"+ riverBasin.getName() + ";" + riverBasin.getSpawnerNumber() + ";" + ";IMPORT;"+origin);
bW.write(";" + totalInputFluxes.get(origin).get("biomass")); bW.write(";" + totalInputFluxes.get(origin).get("biomass"));
for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) { for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) {
bW.write(";" + totalInputFluxes.get(origin).get(nutrient)); bW.write(";" + totalInputFluxes.get(origin).get(nutrient));
} }
...@@ -429,11 +429,13 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG ...@@ -429,11 +429,13 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
} }
// System.out.println("("+numberOfGenitors+")"); //System.out.println("("+numberOfGenitors+")");
//System.out.println(" BEFORE " +riverBasin.getSpawnerOrigins().keySet()); //System.out.println(" BEFORE " +riverBasin.getSpawnerOrigins().keySet());
riverBasin.getSpawnerOrigins().push(spawnerOriginsDuringReproduction); riverBasin.getSpawnerOrigins().push(spawnerOriginsDuringReproduction);
//System.out.println(" AFTER " +riverBasin.getSpawnerOrigins().keySet()); //System.out.println(" AFTER " +riverBasin.getSpawnerOrigins().keySet());
} }
// -------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------
// update the observers // update the observers
// -------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------
......
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