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
11cbd429
Commit
11cbd429
authored
Oct 25, 2019
by
Lambert Patrick
Browse files
getter fiir both nutiren fluxes
parent
8fbafde8
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/java/species/DiadromousFishGroup.java
View file @
11cbd429
...
...
@@ -509,7 +509,7 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
targetedAgeForMaleSpawnerForFirstTime
=
4.5
;
//this.nutrientRoutine.getNutrientFluxesCollection().setBasinNames(this.getEnvironment().getRiverBasinNames());
this
.
nutrientRoutine
.
createNutrienFluxesCollection
(
this
.
getEnvironment
().
getRiverBasinNames
());
this
.
nutrientRoutine
.
createNutrienFluxesCollection
s
(
this
.
getEnvironment
().
getRiverBasinNames
());
}
...
...
src/main/java/species/NutrientRoutine.java
View file @
11cbd429
...
...
@@ -106,17 +106,15 @@ public class NutrientRoutine {
*/
private
Map
<
DiadromousFish
.
Gender
,
Map
<
String
,
Double
>>
compoGametes
;
// For juveniles - Based on Taverny (1991)
/**
* chemical composition of juveniles
* <key> chemical element
* <value> value
*/
private
Map
<
String
,
Double
>
compoJuvenile
;
private
transient
NutrientImportFluxesCollection
nutrientImportFluxesCollection
;
private
transient
NutrientExportFluxesCollection
nutrientExportFluxesCollection
;
public
NutrientRoutine
()
{
...
...
@@ -157,17 +155,27 @@ public class NutrientRoutine {
this
.
compoJuvenile
=
compoJuvenile
;
this
.
nutrientImportFluxesCollection
=
new
NutrientImportFluxesCollection
();
this
.
nutrientExportFluxesCollection
=
new
NutrientExportFluxesCollection
();
}
public
void
createNutrienFluxesCollection
(
String
[]
basinNames
)
{
nutrientImportFluxesCollection
=
new
NutrientImportFluxesCollection
();
nutrientImportFluxesCollection
.
setBasinNames
(
basinNames
);
public
void
createNutrienFluxesCollections
(
String
[]
basinNames
)
{
this
.
nutrientImportFluxesCollection
=
new
NutrientImportFluxesCollection
();
this
.
nutrientImportFluxesCollection
.
setBasinNames
(
basinNames
);
this
.
nutrientExportFluxesCollection
=
new
NutrientExportFluxesCollection
();
this
.
nutrientExportFluxesCollection
.
setBasinNames
(
basinNames
);
}
public
NutrientImportFluxesCollection
getNutrientFluxesCollection
()
{
public
NutrientImportFluxesCollection
getNutrientImportFluxesCollection
()
{
return
nutrientImportFluxesCollection
;
}
public
NutrientExportFluxesCollection
getNutrientExportFluxesCollection
()
{
return
nutrientExportFluxesCollection
;
}
/**
* compute the nutrient fluxes for a single fish (in the super individual)
...
...
@@ -624,10 +632,11 @@ public class NutrientRoutine {
*/
//
private
Map
<
Long
,
Map
<
String
,
Map
<
String
,
Double
>>>
exportFluxesCollection
;
private
transient
String
[]
basinNames
;
NutrientExportFluxesCollection
()
{
exportFluxesCollection
=
new
HashMap
<
Long
,
Map
<
String
,
Map
<
String
,
Double
>>>
();
}
...
...
src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java
View file @
11cbd429
...
...
@@ -268,11 +268,11 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
for
(
String
nutrient:
aFluxAfterSurvival
.
keySet
())
{
//For all survival fish
group
.
getNutrientRoutine
().
getNutrientFluxesCollection
().
group
.
getNutrientRoutine
().
getNutrient
Import
FluxesCollection
().
put
(
Time
.
getYear
(
group
.
getPilot
()),
nutrient
,
fish
.
getBirthBasin
().
getName
(),
riverBasin
.
getName
(),
aFluxAfterSurvival
.
get
(
nutrient
)
*
survivalAmount
);
//For all dead fish
group
.
getNutrientRoutine
().
getNutrientFluxesCollection
().
group
.
getNutrientRoutine
().
getNutrient
Import
FluxesCollection
().
put
(
Time
.
getYear
(
group
.
getPilot
()),
nutrient
,
fish
.
getBirthBasin
().
getName
(),
riverBasin
.
getName
(),
aFluxForDeadFish
.
get
(
nutrient
)
*
(
fish
.
getAmount
()
-
survivalAmount
));
}
...
...
@@ -299,7 +299,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
Map
<
String
,
Double
>
aFluxForDeadFish
=
group
.
getNutrientRoutine
().
computeNutrientsInputForDeathAfterSpawning
(
fish
);
//
for
(
String
nutrient:
aFluxForDeadFish
.
keySet
())
{
group
.
getNutrientRoutine
().
getNutrientFluxesCollection
().
group
.
getNutrientRoutine
().
getNutrient
Import
FluxesCollection
().
put
(
Time
.
getYear
(
group
.
getPilot
()),
nutrient
,
fish
.
getBirthBasin
().
getName
(),
riverBasin
.
getName
(),
aFluxForDeadFish
.
get
(
nutrient
)
*
(
fish
.
getAmount
()
-
survivalAmount
));
}
biomass
=
group
.
getNutrientRoutine
().
getWeight
(
fish
)
*
(
fish
.
getAmount
());
...
...
src/main/java/species/Survive.java
View file @
11cbd429
...
...
@@ -115,7 +115,7 @@ public class Survive extends AquaNismsGroupProcess<DiadromousFish, DiadromousFis
Map
<
String
,
Double
>
aFluxForDeadFishBeforeSpawning
=
group
.
getNutrientRoutine
().
computeNutrientsInputForDeathBeforeSpawning
(
fish
);
//
for
(
String
nutrient:
aFluxForDeadFishBeforeSpawning
.
keySet
())
{
group
.
getNutrientRoutine
().
getNutrientFluxesCollection
().
group
.
getNutrientRoutine
().
getNutrient
Import
FluxesCollection
().
put
(
Time
.
getYear
(
group
.
getPilot
()),
nutrient
,
fish
.
getBirthBasin
().
getName
(),
basin
.
getName
(),
aFluxForDeadFishBeforeSpawning
.
get
(
nutrient
)
*
deathAmount
);
}
...
...
src/main/java/species/WriteImportNutrientFluxes.java
View file @
11cbd429
...
...
@@ -47,7 +47,7 @@ public class WriteImportNutrientFluxes extends AquaNismsGroupProcess<DiadromousF
bW
.
write
(
"\n"
);
Map
<
Long
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
Double
>>>>
fluxesCollection
=
group
.
getNutrientRoutine
().
getNutrientFluxesCollection
().
getImportFluxesCollection
();
Map
<
Long
,
Map
<
String
,
Map
<
String
,
Map
<
String
,
Double
>>>>
fluxesCollection
=
group
.
getNutrientRoutine
().
getNutrient
Import
FluxesCollection
().
getImportFluxesCollection
();
// to iterate on sorted years
List
<
Long
>
years
=
new
ArrayList
<
Long
>(
fluxesCollection
.
keySet
());
...
...
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