diff --git a/data/input/fishTryRealBV_CC.xml b/data/input/fishTryRealBV_CC.xml index e78b2efc6a9ffa1d6a9a18942c733a8ceb1c1036..f889704845a1af7ab5610e034efde506a2501ff3 100644 --- a/data/input/fishTryRealBV_CC.xml +++ b/data/input/fishTryRealBV_CC.xml @@ -83,13 +83,20 @@ <double>-11.285</double> </entry> <entry> -- <string>bLW</string> -- <double>2.9973</double> -- </entry> -- <entry> -- <string>aLW</string> -- <double>0.010383887012522573</double> -- </entry> + - + <string>bLW</string> + - + <double>2.9973</double> + - + </entry> + - + <entry> + - + <string>aLW</string> + - + <double>0.010383887012522573</double> + - + </entry> </hashtable> </entry> <entry> @@ -104,13 +111,20 @@ <double>-6.6234</double> </entry> <entry> -- <string>bLW</string> -- <double>2.9418</double> -- </entry> -- <entry> -- <string>aLW</string> -- <double>0.013199187556948952</double> -- </entry> + - + <string>bLW</string> + - + <double>2.9418</double> + - + </entry> + - + <entry> + - + <string>aLW</string> + - + <double>0.013199187556948952</double> + - + </entry> </hashtable> </entry> </fishFeaturesPostSpawning> @@ -279,7 +293,7 @@ <standardDeviationOfSpawnersLengthAtRepro>2.0</standardDeviationOfSpawnersLengthAtRepro> <weightOfDeathBasin>0.4</weightOfDeathBasin> </species.DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin> - + <species.Survive> <synchronisationMode>ASYNCHRONOUS</synchronisationMode> <tempMinMortGenInRiv>10.0</tempMinMortGenInRiv> @@ -290,13 +304,20 @@ <mortalityRateInSea>0.4</mortalityRateInSea> <mortalityRateInOffshore>0.4</mortalityRateInOffshore> </species.Survive> - + <species.ExportFluxes> <synchronisationMode>ASYNCHRONOUS</synchronisationMode> <exportSeason>SPRING</exportSeason> <fileNameOutput>EffectiveFluxes</fileNameOutput> </species.ExportFluxes> + <species.ExportBiomass> + <synchronisationMode>ASYNCHRONOUS</synchronisationMode> + <survivalRateAfterReproduction>0.1</survivalRateAfterReproduction> + <exportSeason>SPRING</exportSeason> + <fileNameOutput>BiomassFluxes</fileNameOutput> + </species.ExportBiomass> + <species.ReproduceAndSurviveAfterReproductionWithDiagnose> <synchronisationMode>ASYNCHRONOUS</synchronisationMode> <reproductionSeason>SPRING</reproductionSeason> diff --git a/src/main/java/environment/RiverBasin.java b/src/main/java/environment/RiverBasin.java index 6355d1e21ef758a5eb5afe63e88b62d626e49bec..f647f1a873bb57d3119201a57764235584f18320 100644 --- a/src/main/java/environment/RiverBasin.java +++ b/src/main/java/environment/RiverBasin.java @@ -66,12 +66,20 @@ public class RiverBasin extends Basin { public double getSpawnerNumber() { long nbSpawn = 0; for (DiadromousFishGroup group : this.getGroups()) { + nbSpawn += getSpawnerNumberPerGroup(group); + } + return nbSpawn; + } + + + public double getSpawnerNumberPerGroup(DiadromousFishGroup group) { + long nbSpawn = 0; + for (DiadromousFish fish : this.getFishs(group)) { if (fish.isMature()) { nbSpawn += fish.getAmount(); } } - } return nbSpawn; } diff --git a/src/main/java/species/ExportBiomass.java b/src/main/java/species/ExportBiomass.java index 1b2c8109dba346125f7d9cb4de8bc4f0a558fb91..e4899f82a0ae08f9e8ae64eb5709b42626f88627 100644 --- a/src/main/java/species/ExportBiomass.java +++ b/src/main/java/species/ExportBiomass.java @@ -37,7 +37,7 @@ public class ExportBiomass extends AquaNismsGroupProcess<DiadromousFish, Diadrom public static void main(String[] args) { System.out.println((new XStream(new DomDriver())) - .toXML(new ExportFluxes())); + .toXML(new ExportBiomass())); } /* (non-Javadoc) diff --git a/src/main/java/species/ExportFluxes.java b/src/main/java/species/ExportFluxes.java index fe767bc81fef2f7e565e500750064c6df138070d..623f5d3b0c61a660235e7821ddb3712e68ccb557 100644 --- a/src/main/java/species/ExportFluxes.java +++ b/src/main/java/species/ExportFluxes.java @@ -60,6 +60,7 @@ public class ExportFluxes extends AquaNismsGroupProcess<DiadromousFish, Diadromo for (String birthBasinName : group.getEnvironment().getRiverBasinNames()) { bW.write(sep + birthBasinName); // write each basin name in the file } + bW.write("\n"); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java b/src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java index 7b508000fbdfd7f8aac5507ce98ecc7d831df782..8e66f7eae13d271d7ba86fd498da6efb96a61ed8 100644 --- a/src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java +++ b/src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java @@ -98,6 +98,10 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG List<DiadromousFish> deadFish = new ArrayList<DiadromousFish>(); for(RiverBasin riverBasin : group.getEnvironment().getRiverBasins()){ + + // before the party !!!! + double fluxBefore =riverBasin.getSpawnerNumber(); + double b, c, alpha, beta, amountPerSuperIndividual , S95, S50 ; double numberOfFemaleGenitors = 0.; double numberOfAutochtones = 0.; @@ -402,16 +406,20 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG group.removeAquaNism(fish); } deadFish.clear(); - + + // ------------------------------------------------------- + // display information + // ----------------------------------------------------- if (displayFluxesOnConsole) + System.out.println(group.getPilot().getCurrentTime() + "; " + Time.getYear(group.getPilot()) + ";" + Time.getSeason(group.getPilot()) + ";IMPORT;" - + riverBasin.getName() + ";" + riverBasin.getSpawnerNumber() + "; " + totalInputFluxes); + + riverBasin.getName() + ";" + fluxBefore + ";" + riverBasin.getSpawnerNumberPerGroup(group)+ "; " + 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() + ";" + riverBasin.getSpawnerNumber() + ";" + "IMPORT"+ ";" + origin); + +";"+ riverBasin.getName() + ";" + fluxBefore + ";" + "IMPORT"+ ";" + origin); bW.write(";" + totalInputFluxes.get(origin).get("biomass")); for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) {