Commit 2e7be0f4 authored by Poulet Camille's avatar Poulet Camille
Browse files

Rename FishNutrient into NutrientRoutine

parent 19ad5295
......@@ -10,7 +10,7 @@
<linfVonBert>60.0</linfVonBert>
<dMaxDisp>300.0</dMaxDisp>
<lFirstMaturity>40.0</lFirstMaturity>
<fishNutrient>
<nutrientRoutine>
<nutrientsOfInterest>
<string>N</string>
<string>P</string>
......@@ -218,7 +218,7 @@
<double>0.02803</double>
</entry>
</compoJuvenile>
</fishNutrient>
</nutrientRoutine>
<fileNameInputForInitialObservation>data/input/reality/Obs1900.csv</fileNameInputForInitialObservation>
<centileForRange>0.95</centileForRange>
......
......@@ -62,7 +62,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
* Routine to compute nutrient fluxes operated by a single individual (TODO by a single super individual).
*
*/
private FishNutrient fishNutrient;
private NutrientRoutine nutrientRoutine;
public String fileNameInputForInitialObservation = "data/input/reality/Obs1900.csv";
......@@ -265,7 +265,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
diadromousFishGroup.fishNutrient = new FishNutrient(nutrientsOfInterest,aResidenceTime, anExcretionRate, aFeaturePreSpawning, aFeaturePostSpawning,
diadromousFishGroup.nutrientRoutine = new NutrientRoutine(nutrientsOfInterest,aResidenceTime, anExcretionRate, aFeaturePreSpawning, aFeaturePostSpawning,
aCompoCarcassPreSpawning, aCompoCarcassPostSpawning, aCompoGametes,
aJuvenileFeatures, aCompoJuveniles);
......@@ -507,9 +507,9 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
return lFirstMaturity;
}
public FishNutrient getFishNutrient() {
public NutrientRoutine getNutrientRoutine() {
return fishNutrient;
return nutrientRoutine;
}
public void setlFirstMaturity(double lFirstMaturity) {
......
......@@ -44,7 +44,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
List<DiadromousFish> fishes = basin.getFishs(group);
// ON r-initialise notre map pour chauqe bassin
for (String nutrient : group.getFishNutrient().getNutrientsOfInterest()) {
for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) {
totalOutputFluxes.put(nutrient, 0.);
}
totalOutputFluxes.put("biomass", 0.); //cration de la biomasse
......@@ -54,10 +54,10 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
destination = group.getEnvironment().getAssociatedSeaBasin(fish.getPosition());
fishesToMove.add(new Duo<DiadromousFish, Basin>(fish, destination)); //Mentionne la sortie d'un poisson de la boucle
double biomass = group.getFishNutrient().getWeight(fish) * fish.getAmount();
double biomass = group.getNutrientRoutine().getWeight(fish) * fish.getAmount();
if (fish.getStage()==Stage.IMMATURE) {
Map <String, Double> aFluxExportedByJuveniles= group.getFishNutrient().computeNutrientsExportForJuveniles(fish);
Map <String, Double> aFluxExportedByJuveniles= group.getNutrientRoutine().computeNutrientsExportForJuveniles(fish);
for (String nutrient: aFluxExportedByJuveniles.keySet()) {
totalOutputFluxes.put(nutrient,totalOutputFluxes.get(nutrient) + aFluxExportedByJuveniles.get(nutrient) * fish.getAmount());
}
......
......@@ -35,7 +35,7 @@ import com.thoughtworks.xstream.io.xml.DomDriver;
* @author camille.poulet
*
*/
public class FishNutrient {
public class NutrientRoutine {
private static enum SpawningPosition {PRE,POST}; // on crer un static pour rserver une mme classe mmoire pour toutes les instances
......@@ -122,7 +122,7 @@ public class FishNutrient {
* @param compoGametes
* @param compoJuvenile
*/
public FishNutrient(ArrayList<String> nutrientsOfInterest,
public NutrientRoutine(ArrayList<String> nutrientsOfInterest,
double residenceTime,
Map <String, Double> excretionRate,
......@@ -492,7 +492,7 @@ public class FishNutrient {
System.out.println("nutrientsOfInterest: " + nutrientsOfInterest);
FishNutrient fn = new FishNutrient(nutrientsOfInterest,aResidenceTime, anExcretionRate, aFeaturePreSpawning, aFeaturePostSpawning,
NutrientRoutine fn = new NutrientRoutine(nutrientsOfInterest,aResidenceTime, anExcretionRate, aFeaturePreSpawning, aFeaturePostSpawning,
aCompoCarcassPreSpawning, aCompoCarcassPostSpawning, aCompoGametes,
aJuvenileFeatures, aCompoJuveniles);
......
......@@ -111,7 +111,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
//Initiate the total fluxes for this basin
Map<String, Double> totalInputFluxes = new Hashtable<String, Double>(); //On crer la Map pour stocker les flux
for (String nutrient : group.getFishNutrient().getNutrientsOfInterest()) {
for (String nutrient : group.getNutrientRoutine().getNutrientsOfInterest()) {
totalInputFluxes.put(nutrient, 0.); // ON MET A JOUR NOTRE map
}
......@@ -193,10 +193,10 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
if (survivalAmount > 0) {// SUperindividu est encore vivant mais il perd des effectifs
//Export for fishes survived after spawning (survivalAmount) : excretion + gametes
Map <String, Double> aFluxAfterSurvival = group.getFishNutrient().computeNutrientsInputForSurvivalAfterSpawning(fish);
Map <String, Double> aFluxAfterSurvival = group.getNutrientRoutine().computeNutrientsInputForSurvivalAfterSpawning(fish);
//Export for fishes that dies after spawning (fish.getAmount - survivalAmount): excretion + gametes + carcasse
Map<String, Double> aFluxForDeadFish = group.getFishNutrient().computeNutrientsInputForDeathAfterSpawning(fish);
Map<String, Double> aFluxForDeadFish = group.getNutrientRoutine().computeNutrientsInputForDeathAfterSpawning(fish);
for (String nutrient: aFluxAfterSurvival.keySet()) {
//For survival fish
......@@ -207,7 +207,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
}
//compute biomass for dead fish
biomass = group.getFishNutrient().getWeight(fish) * (fish.getAmount() - survivalAmount);
biomass = group.getNutrientRoutine().getWeight(fish) * (fish.getAmount() - survivalAmount);
totalInputFluxes.put("biomass", totalInputFluxes.get("biomass") + biomass);
//update the amount of individual in the super-individual
......@@ -218,12 +218,12 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
deadFish.add(fish);
//Export for fished died before spawning (fish.getAmount): carcasses + excretion + gametes
Map<String, Double> aFlux = group.getFishNutrient().computeNutrientsInputForDeathAfterSpawning(fish); //
Map<String, Double> aFlux = group.getNutrientRoutine().computeNutrientsInputForDeathAfterSpawning(fish); //
for (String nutrient: aFlux.keySet()) {
totalInputFluxes.put(nutrient,totalInputFluxes.get(nutrient) + aFlux.get(nutrient) * fish.getAmount()); //Fish.getAmount - survivalAmount = total fishes died.
}
biomass = group.getFishNutrient().getWeight(fish) * (fish.getAmount());
biomass = group.getNutrientRoutine().getWeight(fish) * (fish.getAmount());
totalInputFluxes.put("biomass", totalInputFluxes.get("biomass") + biomass);
}
}
......
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