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

Add coloumnn abundance in csv file

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