Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SimAquaLife
GR3D
Commits
2e7be0f4
Commit
2e7be0f4
authored
Jul 15, 2019
by
Poulet Camille
Browse files
Rename FishNutrient into NutrientRoutine
parent
19ad5295
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
data/input/fishTryRealBV_CC.xml
View file @
2e7be0f4
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<linfVonBert>
60.0
</linfVonBert>
<linfVonBert>
60.0
</linfVonBert>
<dMaxDisp>
300.0
</dMaxDisp>
<dMaxDisp>
300.0
</dMaxDisp>
<lFirstMaturity>
40.0
</lFirstMaturity>
<lFirstMaturity>
40.0
</lFirstMaturity>
<
fishN
utrient>
<
n
utrient
Routine
>
<nutrientsOfInterest>
<nutrientsOfInterest>
<string>
N
</string>
<string>
N
</string>
<string>
P
</string>
<string>
P
</string>
...
@@ -218,7 +218,7 @@
...
@@ -218,7 +218,7 @@
<double>
0.02803
</double>
<double>
0.02803
</double>
</entry>
</entry>
</compoJuvenile>
</compoJuvenile>
</
fishN
utrient>
</
n
utrient
Routine
>
<fileNameInputForInitialObservation>
data/input/reality/Obs1900.csv
</fileNameInputForInitialObservation>
<fileNameInputForInitialObservation>
data/input/reality/Obs1900.csv
</fileNameInputForInitialObservation>
<centileForRange>
0.95
</centileForRange>
<centileForRange>
0.95
</centileForRange>
...
...
src/main/java/species/DiadromousFishGroup.java
View file @
2e7be0f4
...
@@ -62,7 +62,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
...
@@ -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).
* Routine to compute nutrient fluxes operated by a single individual (TODO by a single super individual).
*
*
*/
*/
private
Fish
Nutrient
fishNutrient
;
private
Nutrient
Routine
nutrientRoutine
;
public
String
fileNameInputForInitialObservation
=
"data/input/reality/Obs1900.csv"
;
public
String
fileNameInputForInitialObservation
=
"data/input/reality/Obs1900.csv"
;
...
@@ -265,7 +265,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
...
@@ -265,7 +265,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
diadromousFishGroup
.
fishN
utrient
=
new
Fish
Nutrient
(
nutrientsOfInterest
,
aResidenceTime
,
anExcretionRate
,
aFeaturePreSpawning
,
aFeaturePostSpawning
,
diadromousFishGroup
.
n
utrient
Routine
=
new
Nutrient
Routine
(
nutrientsOfInterest
,
aResidenceTime
,
anExcretionRate
,
aFeaturePreSpawning
,
aFeaturePostSpawning
,
aCompoCarcassPreSpawning
,
aCompoCarcassPostSpawning
,
aCompoGametes
,
aCompoCarcassPreSpawning
,
aCompoCarcassPostSpawning
,
aCompoGametes
,
aJuvenileFeatures
,
aCompoJuveniles
);
aJuvenileFeatures
,
aCompoJuveniles
);
...
@@ -507,9 +507,9 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
...
@@ -507,9 +507,9 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
return
lFirstMaturity
;
return
lFirstMaturity
;
}
}
public
Fish
Nutrient
get
Fish
Nutrient
()
{
public
Nutrient
Routine
getNutrient
Routine
()
{
return
fishN
utrient
;
return
n
utrient
Routine
;
}
}
public
void
setlFirstMaturity
(
double
lFirstMaturity
)
{
public
void
setlFirstMaturity
(
double
lFirstMaturity
)
{
...
...
src/main/java/species/MigrateToSea.java
View file @
2e7be0f4
...
@@ -44,7 +44,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
...
@@ -44,7 +44,7 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
List
<
DiadromousFish
>
fishes
=
basin
.
getFishs
(
group
);
List
<
DiadromousFish
>
fishes
=
basin
.
getFishs
(
group
);
// ON r-initialise notre map pour chauqe bassin
// ON r-initialise notre map pour chauqe bassin
for
(
String
nutrient
:
group
.
get
Fish
Nutrient
().
getNutrientsOfInterest
())
{
for
(
String
nutrient
:
group
.
getNutrient
Routine
().
getNutrientsOfInterest
())
{
totalOutputFluxes
.
put
(
nutrient
,
0
.);
totalOutputFluxes
.
put
(
nutrient
,
0
.);
}
}
totalOutputFluxes
.
put
(
"biomass"
,
0
.);
//cration de la biomasse
totalOutputFluxes
.
put
(
"biomass"
,
0
.);
//cration de la biomasse
...
@@ -54,10 +54,10 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
...
@@ -54,10 +54,10 @@ public class MigrateToSea extends AquaNismsGroupProcess<DiadromousFish, Diadromo
destination
=
group
.
getEnvironment
().
getAssociatedSeaBasin
(
fish
.
getPosition
());
destination
=
group
.
getEnvironment
().
getAssociatedSeaBasin
(
fish
.
getPosition
());
fishesToMove
.
add
(
new
Duo
<
DiadromousFish
,
Basin
>(
fish
,
destination
));
//Mentionne la sortie d'un poisson de la boucle
fishesToMove
.
add
(
new
Duo
<
DiadromousFish
,
Basin
>(
fish
,
destination
));
//Mentionne la sortie d'un poisson de la boucle
double
biomass
=
group
.
get
Fish
Nutrient
().
getWeight
(
fish
)
*
fish
.
getAmount
();
double
biomass
=
group
.
getNutrient
Routine
().
getWeight
(
fish
)
*
fish
.
getAmount
();
if
(
fish
.
getStage
()==
Stage
.
IMMATURE
)
{
if
(
fish
.
getStage
()==
Stage
.
IMMATURE
)
{
Map
<
String
,
Double
>
aFluxExportedByJuveniles
=
group
.
get
Fish
Nutrient
().
computeNutrientsExportForJuveniles
(
fish
);
Map
<
String
,
Double
>
aFluxExportedByJuveniles
=
group
.
getNutrient
Routine
().
computeNutrientsExportForJuveniles
(
fish
);
for
(
String
nutrient:
aFluxExportedByJuveniles
.
keySet
())
{
for
(
String
nutrient:
aFluxExportedByJuveniles
.
keySet
())
{
totalOutputFluxes
.
put
(
nutrient
,
totalOutputFluxes
.
get
(
nutrient
)
+
aFluxExportedByJuveniles
.
get
(
nutrient
)
*
fish
.
getAmount
());
totalOutputFluxes
.
put
(
nutrient
,
totalOutputFluxes
.
get
(
nutrient
)
+
aFluxExportedByJuveniles
.
get
(
nutrient
)
*
fish
.
getAmount
());
}
}
...
...
src/main/java/species/
Fish
Nutrient.java
→
src/main/java/species/Nutrient
Routine
.java
View file @
2e7be0f4
This diff is collapsed.
Click to expand it.
src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java
View file @
2e7be0f4
...
@@ -111,7 +111,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
...
@@ -111,7 +111,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
//Initiate the total fluxes for this basin
//Initiate the total fluxes for this basin
Map
<
String
,
Double
>
totalInputFluxes
=
new
Hashtable
<
String
,
Double
>();
//On crer la Map pour stocker les flux
Map
<
String
,
Double
>
totalInputFluxes
=
new
Hashtable
<
String
,
Double
>();
//On crer la Map pour stocker les flux
for
(
String
nutrient
:
group
.
get
Fish
Nutrient
().
getNutrientsOfInterest
())
{
for
(
String
nutrient
:
group
.
getNutrient
Routine
().
getNutrientsOfInterest
())
{
totalInputFluxes
.
put
(
nutrient
,
0
.);
// ON MET A JOUR NOTRE map
totalInputFluxes
.
put
(
nutrient
,
0
.);
// ON MET A JOUR NOTRE map
}
}
...
@@ -193,10 +193,10 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
...
@@ -193,10 +193,10 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
if
(
survivalAmount
>
0
)
{
// SUperindividu est encore vivant mais il perd des effectifs
if
(
survivalAmount
>
0
)
{
// SUperindividu est encore vivant mais il perd des effectifs
//Export for fishes survived after spawning (survivalAmount) : excretion + gametes
//Export for fishes survived after spawning (survivalAmount) : excretion + gametes
Map
<
String
,
Double
>
aFluxAfterSurvival
=
group
.
get
Fish
Nutrient
().
computeNutrientsInputForSurvivalAfterSpawning
(
fish
);
Map
<
String
,
Double
>
aFluxAfterSurvival
=
group
.
getNutrient
Routine
().
computeNutrientsInputForSurvivalAfterSpawning
(
fish
);
//Export for fishes that dies after spawning (fish.getAmount - survivalAmount): excretion + gametes + carcasse
//Export for fishes that dies after spawning (fish.getAmount - survivalAmount): excretion + gametes + carcasse
Map
<
String
,
Double
>
aFluxForDeadFish
=
group
.
get
Fish
Nutrient
().
computeNutrientsInputForDeathAfterSpawning
(
fish
);
Map
<
String
,
Double
>
aFluxForDeadFish
=
group
.
getNutrient
Routine
().
computeNutrientsInputForDeathAfterSpawning
(
fish
);
for
(
String
nutrient:
aFluxAfterSurvival
.
keySet
())
{
for
(
String
nutrient:
aFluxAfterSurvival
.
keySet
())
{
//For survival fish
//For survival fish
...
@@ -207,7 +207,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
...
@@ -207,7 +207,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
}
}
//compute biomass for dead fish
//compute biomass for dead fish
biomass
=
group
.
get
Fish
Nutrient
().
getWeight
(
fish
)
*
(
fish
.
getAmount
()
-
survivalAmount
);
biomass
=
group
.
getNutrient
Routine
().
getWeight
(
fish
)
*
(
fish
.
getAmount
()
-
survivalAmount
);
totalInputFluxes
.
put
(
"biomass"
,
totalInputFluxes
.
get
(
"biomass"
)
+
biomass
);
totalInputFluxes
.
put
(
"biomass"
,
totalInputFluxes
.
get
(
"biomass"
)
+
biomass
);
//update the amount of individual in the super-individual
//update the amount of individual in the super-individual
...
@@ -218,12 +218,12 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
...
@@ -218,12 +218,12 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
deadFish
.
add
(
fish
);
deadFish
.
add
(
fish
);
//Export for fished died before spawning (fish.getAmount): carcasses + excretion + gametes
//Export for fished died before spawning (fish.getAmount): carcasses + excretion + gametes
Map
<
String
,
Double
>
aFlux
=
group
.
get
Fish
Nutrient
().
computeNutrientsInputForDeathAfterSpawning
(
fish
);
//
Map
<
String
,
Double
>
aFlux
=
group
.
getNutrient
Routine
().
computeNutrientsInputForDeathAfterSpawning
(
fish
);
//
for
(
String
nutrient:
aFlux
.
keySet
())
{
for
(
String
nutrient:
aFlux
.
keySet
())
{
totalInputFluxes
.
put
(
nutrient
,
totalInputFluxes
.
get
(
nutrient
)
+
aFlux
.
get
(
nutrient
)
*
fish
.
getAmount
());
//Fish.getAmount - survivalAmount = total fishes died.
totalInputFluxes
.
put
(
nutrient
,
totalInputFluxes
.
get
(
nutrient
)
+
aFlux
.
get
(
nutrient
)
*
fish
.
getAmount
());
//Fish.getAmount - survivalAmount = total fishes died.
}
}
biomass
=
group
.
get
Fish
Nutrient
().
getWeight
(
fish
)
*
(
fish
.
getAmount
());
biomass
=
group
.
getNutrient
Routine
().
getWeight
(
fish
)
*
(
fish
.
getAmount
());
totalInputFluxes
.
put
(
"biomass"
,
totalInputFluxes
.
get
(
"biomass"
)
+
biomass
);
totalInputFluxes
.
put
(
"biomass"
,
totalInputFluxes
.
get
(
"biomass"
)
+
biomass
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment