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
fdbf0c50
Commit
fdbf0c50
authored
Sep 27, 2019
by
Poulet Camille
Browse files
Included a populate process according to basin surface
parent
01d34a36
Changes
4
Hide whitespace changes
Inline
Side-by-side
data/input/fishTryRealBV_CC.xml
View file @
fdbf0c50
...
...
@@ -235,7 +235,7 @@
<lFirstMaturityForMale>
40.0
</lFirstMaturityForMale>
<processes>
<processesAtBegin>
</processesAtBegin>
<processesEachStep>
...
...
@@ -247,15 +247,15 @@
<temporisation>
0
</temporisation>
</species.PlopProcess>
<species.PopulateBasinNetworkSeveralTimes>
<species.PopulateBasinNetworkSeveralTimes
AccordingToBasinSize
>
<synchronisationMode>
ASYNCHRONOUS
</synchronisationMode>
<nbSIPerBasin>
200
</nbSIPerBasin>
<nbFishPerSI>
2500
</nbFishPerSI>
<initialLength>
20.0
</initialLength>
<initialLength>
2.0
</initialLength>
<etaPopulate>
40.0
</etaPopulate>
<timesOfPopulate>
5
</timesOfPopulate>
<populateSeason>
SPRING
</populateSeason>
</species.PopulateBasinNetworkSeveralTimes>
</species.PopulateBasinNetworkSeveralTimes
AccordingToBasinSize
>
<species.Age>
<synchronisationMode>
ASYNCHRONOUS
</synchronisationMode>
</species.Age>
...
...
@@ -291,11 +291,11 @@
<species.Survive>
<synchronisationMode>
ASYNCHRONOUS
</synchronisationMode>
<tempMinSurvivalSpawnerInRiv>
9.
0
</tempMinSurvivalSpawnerInRiv>
<tempMinSurvivalSpawnerInRiv>
9.
4
</tempMinSurvivalSpawnerInRiv>
<tempMaxSurvivalSpawnerInRiv>
23.0
</tempMaxSurvivalSpawnerInRiv>
<!--
<tempOptSurvivalSpawnerInRiv>20.0</tempOptSurvivalSpawnerInRiv>
-->
<tempOptSurvivalSpawnerInRiv>
20.0
</tempOptSurvivalSpawnerInRiv>
<survivalProbOptSpawnerInRiv>
1.0
</survivalProbOptSpawnerInRiv>
<mortalityRateInRiver>
0.4
</mortalityRateInRiver>
<!--
<mortalityRateInRiver>0.4</mortalityRateInRiver>
-->
<mortalityRateInSea>
0.4
</mortalityRateInSea>
<mortalityRateInOffshore>
0.4
</mortalityRateInOffshore>
</species.Survive>
...
...
@@ -316,9 +316,9 @@
<species.ReproduceAndSurviveAfterReproductionWithDiagnose>
<synchronisationMode>
ASYNCHRONOUS
</synchronisationMode>
<reproductionSeason>
SPRING
</reproductionSeason>
<tempMinRep>
9.
8
</tempMinRep>
<tempMaxRep>
2
6
.0
</tempMaxRep>
<tempOptRep>
20.0
</tempOptRep>
<tempMinRep>
9.
4
</tempMinRep>
<tempMaxRep>
2
3
.0
</tempMaxRep>
<tempOptRep>
16.5
</tempOptRep>
<eta>
2.4
</eta>
<ratioS95__S50>
1.9
</ratioS95__S50>
<a>
135000.0
</a>
...
...
exploration/scriptR/BruchPrg.R
View file @
fdbf0c50
...
...
@@ -51,20 +51,20 @@ cj= 4.1e-4 / (84810*.5356)
# temperature effect on growth
# ------------------------------------------------
temperatureEffect
=
function
(
temp
,
Tmin
,
Topt
,
Tmax
){
# if (temp<=Tmin | temp >= Tmax)
# return(0)
# else
response
=
(
temp
-
Tmin
)
*
(
temp
-
Tmax
)
/
((
temp
-
Tmin
)
*
(
temp
-
Tmax
)
-
(
temp
-
Topt
)
^
2
)
response
[
temp
<=
Tmin
|
temp
>=
Tmax
]
=
0
return
(
response
)
}
# if (temp<=Tmin | temp >= Tmax)
# return(0)
# else
response
=
(
temp
-
Tmin
)
*
(
temp
-
Tmax
)
/
((
temp
-
Tmin
)
*
(
temp
-
Tmax
)
-
(
temp
-
Topt
)
^
2
)
response
[
temp
<=
Tmin
|
temp
>=
Tmax
]
=
0
return
(
response
)
}
temperature
=
seq
(
8
,
30
,
.1
)
# temperature effect on spawner survival
# temperature effect on spawner survival
(Survival Process in GR3D)
plot
(
temperature
,
temperatureEffect
(
temperature
,
10
,
20
,
23
),
type
=
'l'
)
# temperature effect on recruit survival
lines
(
temperature
,
temperatureEffect
(
temperature
,
9.75
,
20
,
26
),
,
col
=
'red'
)
# temperature effect on recruit survival
(Reproduction process in GR3D, that is computed from the survival curve of juveniles (Jatteau et al, 2017) )
lines
(
temperature
,
temperatureEffect
(
temperature
,
9.75
,
20
,
26
),
col
=
'red'
)
lines
(
temperature
,
temperatureEffect
(
temperature
,
9.75
,
20
,
26
)
*
temperatureEffect
(
temperature
,
10
,
20
,
23
),
type
=
'l'
,
col
=
'green'
)
...
...
@@ -116,7 +116,7 @@ abline(h=40)
for
(
i
in
1
:
100
)
{
lines
(
age
,
vonBertalaffyIncrement
(
6
/
.25
,
2
,
60
,
0.3900707
,
.25
,
.2
,
withTempEffect
=
TRUE
),
col
=
'green'
)
}
lines
(
age
,
vonBertalaffyGrowth
(
age
,
2
,
60
,
0.3900707
*
mean
(
temperatureEffect
(
Tref
,
3
,
17
,
26
))),
lty
=
2
,
lwd
=
2
)
lines
(
age
,
vonBertalaffyGrowth
(
age
,
2
,
60
,
0.3900707
*
mean
(
temperatureEffect
(
Tref
,
3
,
17
,
26
))),
lty
=
2
,
lwd
=
2
)
abline
(
h
=
40
)
...
...
@@ -125,8 +125,8 @@ abline(h=40)
nbRep
=
1000
res
=
matrix
(
nrow
=
nbRep
)
for
(
i
in
1
:
nbRep
)
{
prov
=
vonBertalaffyIncrement
(
24
,
2
,
60
,
0.3900707
,
.25
,
.2
)
res
[
i
]
=
prov
[
max
(
which
(
prov
<
40
))
+4
]
prov
=
vonBertalaffyIncrement
(
24
,
2
,
60
,
0.3900707
,
.25
,
.2
)
res
[
i
]
=
prov
[
max
(
which
(
prov
<
40
))
+4
]
}
mean
(
res
)
hist
(
res
,
20
)
...
...
@@ -181,8 +181,6 @@ tapply(simGaronne$length[sel], simGaronne[sel,c('year')],quantile, na.rm = TRUE,
sel
=
(
dataBruch
$
LOT
==
'Tuilières'
|
dataBruch
$
LOT
==
'Golfech'
)
&
!
is.na
(
dataBruch
$
`M.gonades.(g)`
)
&
dataBruch
$
Sexe
==
'F'
mean
(
dataBruch
$
`M.gonades.(g)`
[
sel
]
/
dataBruch
$
`M.tot.(g)`
[
sel
])
sel
=
(
dataBruch
$
LOT
==
'Tuilières'
|
dataBruch
$
LOT
==
'Golfech'
)
&
dataBruch
$
Sexe
==
'F'
sum
(
sel
)
Wpre
=
mean
(
dataBruch
$
`M.tot.(g)`
[
sel
])
...
...
@@ -192,3 +190,158 @@ sel = (! (dataBruch$LOT =='Tuilières' | dataBruch$LOT =='Golfech')) & dataBruch
Wpost
=
mean
(
dataBruch
$
`M.tot.(g)`
[
sel
])
WgonadSpent
=
mean
(
dataBruch
$
`M.gonades.(g)`
[
sel
],
na.rm
=
TRUE
)
(
Wloss
=
(
Wpre
-
Wpost
)
/
Wpre
)
# ===================================================================
# Exploration of Stock recruitement-relationship for GR3D calibration
# =====================================================================
#Use to improve the likelihood between observations and GR3D outputs in terms of abudances and North limit colonization.
#a = fcondit de l'espce, a = 135000
#S = quantit de gniteurs: ici on veut la quantit R0 produite par 1000 gniteurs en fonction de la T
#Ratio = 0.2
#n= paramtre simulant l'effet Allee
#-----------On cherche a reproduire la relation SR telle que modlise dans GR3D--------------
temperatureEffect
=
function
(
tempWater
,
TminRep
,
ToptRep
,
TmaxRep
){
# if (tempWater<=TminRep | tempWater >= TmaxRep)
# return(0)
# else
response
=
(
tempWater
-
TminRep
)
*
(
tempWater
-
TmaxRep
)
/
((
tempWater
-
TminRep
)
*
(
tempWater
-
TmaxRep
)
-
(
tempWater
-
ToptRep
)
^
2
)
response
[
tempWater
<=
TminRep
|
tempWater
>=
TmaxRep
]
=
0
return
(
response
)
}
#Relation SR telle qu'elle est modlise dans GR3D
numberOfSpawner
<-
seq
(
0
:
400000
)
StockRecruitementRelationship
<-
function
(
temp
,
surfaceWatershed
,
S
)
{
lambda
=
4.1E-4
deltaTrecruitement
=
0.33
survOptRep
=
0.0017
n
=
2.4
ratioTeta
=
1.9
a
=
135000
#parametre c de la RS de BH intgrant un effet du BV considr
cj
=
lambda
/
surfaceWatershed
#parametre b reprsentant la mortalit densit dpendante de la RS de BH intgrant un effet de la temperature
# bj = (-(1/deltaTrecruitement))*
# log(survOptRep * temperatureEffect(temp, 9.8, 20.0, 26.0))
bj
=
-
log
(
survOptRep
*
temperatureEffect
(
temp
,
9.8
,
20.0
,
26.0
))
/
deltaTrecruitement
#parametre a (fcondit de l'espce) de la RS de BH intgrant un effet de la temperature
alphaj
=
(
bj
*
exp
(
-
bj
*
deltaTrecruitement
))
/
(
cj
*
(
1
-
exp
(
-
bj
*
deltaTrecruitement
)))
#Bj = paramtre de la relation SR intgrant l'effet de la temprature
betaj
=
bj
/
(
a
*
cj
*
(
1
-
exp
(
-
bj
*
deltaTrecruitement
)))
#p = proportion de gniteurs participant la reproduction en focntion de la quantit de gniteur total
#p = 1/(1+exp(-log(19)*(S-n)/(Ratio*surfaceWatershed)))
S95
=
n
*
surfaceWatershed
S50
=
S95
/
ratioTeta
p
=
1
/
(
1
+
exp
(
-
log
(
19
)
*
(
S
-
S50
)
/
(
S95
-
S50
)))
#relation Stock Recrutement ie calcul le nombre de recrues en fonction du nombre de gniteurs et de la T en intgrant l'effet Allee
#R0 = aj * S * p
AlleeEffect
=
1
/
(
1
+
exp
(
-
log
(
19
)
*
(
S
-
n
/
ratioTeta
*
surfaceWatershed
)
/
(
n
*
surfaceWatershed
-
n
/
ratioTeta
*
surfaceWatershed
)))
Rj
=
(
alphaj
*
S
*
AlleeEffect
)
/
(
betaj
+
S
*
AlleeEffect
)
#Rj = ((aj * S) * p)/(Bj +S * p)
StockRecruitement
=
as.data.frame
(
Rj
)
return
(
Rj
)
}
StockRecruitement
<-
StockRecruitementRelationship
(
18
,
84810
,
numberOfSpawner
)
plot
(
numberOfSpawner
,
StockRecruitement
,
type
=
'l'
,
xlab
=
"Number of spawners"
,
ylab
=
"Number of recruits"
)
#-----------On cherche dterminer le numbre de juvniles gnrs par S = 100000 gniteurs en fonction de la T --------------
temperature
<-
seq
(
8
,
30
,
.1
)
numberOfSpawner
=
100000
StockRecruitementRelationship
<-
function
(
temp
,
surfaceWatershed
,
S
)
{
lambda
=
4.1E-4
deltaTrecruitement
=
0.33
survOptRep
=
0.0017
n
=
2.4
ratioTeta
=
1.9
a
=
135000
#parametre c de la RS de BH intgrant un effet du BV considr
cj
=
lambda
/
surfaceWatershed
#parametre b reprsentant la mortalit densit dpendante de la RS de BH intgrant un effet de la temperature
# bj = (-(1/deltaTrecruitement))*
# log(survOptRep * temperatureEffect(temp, 9.8, 20.0, 26.0))
bj
=
-
log
(
survOptRep
*
temperatureEffect
(
temp
,
9.8
,
20.0
,
26.0
))
/
deltaTrecruitement
#parametre a (fcondit de l'espce) de la RS de BH intgrant un effet de la temperature
alphaj
=
(
bj
*
exp
(
-
bj
*
deltaTrecruitement
))
/
(
cj
*
(
1
-
exp
(
-
bj
*
deltaTrecruitement
)))
#Bj = paramtre de la relation SR intgrant l'effet de la temprature
betaj
=
bj
/
(
a
*
cj
*
(
1
-
exp
(
-
bj
*
deltaTrecruitement
)))
#p = proportion de gniteurs participant la reproduction en focntion de la quantit de gniteur total
#p = 1/(1+exp(-log(19)*(S-n)/(Ratio*surfaceWatershed)))
S95
=
n
*
surfaceWatershed
S50
=
S95
/
ratioTeta
p
=
1
/
(
1
+
exp
(
-
log
(
19
)
*
(
S
-
S50
)
/
(
S95
-
S50
)))
#relation Stock Recrutement ie calcul le nombre de recrues en fonction du nombre de gniteurs et de la T en intgrant l'effet Allee
#R0 = aj * S * p
AlleeEffect
=
1
/
(
1
+
exp
(
-
log
(
19
)
*
(
S
-
n
/
ratioTeta
*
surfaceWatershed
)
/
(
n
*
surfaceWatershed
-
n
/
ratioTeta
*
surfaceWatershed
)))
Rj
=
(
alphaj
*
S
*
AlleeEffect
)
/
(
betaj
+
S
*
AlleeEffect
)
#Rj = ((aj * S) * p)/(Bj +S * p)
StockRecruitement
=
as.data.frame
(
Rj
)
return
(
Rj
)
}
plot
(
temperature
,
StockRecruitementRelationship
(
temperature
,
84810
,
numberOfSpawner
),
type
=
"l"
,
xlab
=
" Temperature (C)"
,
ylab
=
"Number Of Recruits"
)
#-----------On cherche dterminer le numbre de gniteurs survivants en fonction de la T --------------
#Prend en compte Zsea
plot
(
temperature
,
StockRecruitementRelationship
(
temperature
,
84810
,
numberOfSpawner
),
type
=
"l"
,
xlab
=
" Temperature (C)"
,
ylab
=
"Number Of Recruits"
)
src/main/java/species/PopulateBasinNetworkSeveralTimesAccordingToBasinSize.java
0 → 100644
View file @
fdbf0c50
package
species
;
import
com.thoughtworks.xstream.XStream
;
import
com.thoughtworks.xstream.io.xml.DomDriver
;
import
environment.Basin
;
import
environment.RiverBasin
;
import
environment.SeaBasin
;
import
environment.Time
;
import
environment.Time.Season
;
import
fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess
;
import
species.DiadromousFish.Gender
;
import
org.openide.util.lookup.ServiceProvider
;
@ServiceProvider
(
service
=
AquaNismsGroupProcess
.
class
)
public
class
PopulateBasinNetworkSeveralTimesAccordingToBasinSize
extends
AquaNismsGroupProcess
<
DiadromousFish
,
DiadromousFishGroup
>
{
private
int
nbFishPerSI
=
2500
;
private
double
initialLength
=
2
.;
private
double
etaPopulate
=
40
;
// parameter linking surface of a basin and S_etoile; Should be superior at eta (eta = 2.4 in ReproduceAndSurviveAfterReproduction).
private
int
timesOfPopulate
=
5
;
private
Season
populateSeason
=
Season
.
SPRING
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
()))
.
toXML
(
new
PopulateBasinNetworkSeveralTimesAccordingToBasinSize
()));
}
@Override
public
void
doProcess
(
DiadromousFishGroup
group
)
{
if
(
Time
.
getNbYearFromBegin
(
group
.
getPilot
())
<=
timesOfPopulate
&&
Time
.
getSeason
(
group
.
getPilot
())
==
populateSeason
){
for
(
RiverBasin
riverBasin
:
group
.
getEnvironment
().
getRiverBasins
()){
int
numberOfFemaleToPopulate
=
(
int
)
Math
.
round
(
etaPopulate
*
riverBasin
.
getAccessibleSurface
())
;
int
nbFemaleSI
=
numberOfFemaleToPopulate
/
nbFishPerSI
;
int
nbMaleSI
=
nbFemaleSI
;
for
(
int
i
=
0
;
i
<
nbFemaleSI
;
i
++){
group
.
addAquaNism
(
new
DiadromousFish
(
group
.
getPilot
(),
riverBasin
,
initialLength
,
nbFishPerSI
,
Gender
.
FEMALE
));
}
for
(
int
i
=
0
;
i
<
nbMaleSI
;
i
++){
group
.
addAquaNism
(
new
DiadromousFish
(
group
.
getPilot
(),
riverBasin
,
initialLength
,
nbFishPerSI
,
Gender
.
MALE
));
}
}
}
System
.
out
.
println
(
"fem: "
+
group
.
getFemaleSpawnerEffective
()+
" \tmal"
+
group
.
getMaleSpawnerEffective
());
}
}
src/main/java/species/ReproduceAndSurviveAfterReproductionWithDiagnose.java
View file @
fdbf0c50
...
...
@@ -176,6 +176,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
amountPerSuperIndividual
=
alpha
/
maxNumberOfSuperIndividualPerReproduction
;
// Compute the Allee effect parameters S95 and S50
S95
=
eta
*
riverBasin
.
getAccessibleSurface
();
// corresponds to S* in the rougier publication
S50
=
S95
/
ratioS95_S50
;
...
...
@@ -395,7 +396,7 @@ public class ReproduceAndSurviveAfterReproductionWithDiagnose extends AquaNismsG
riverBasin
.
getSpawnersForFirstTimeMeanLengths
(
Gender
.
FEMALE
).
push
(
femaleSpawnersForFirstTimeLengthsSum
/
numberOfFemaleSpawnerForFirstTime
);
}
else
{
riverBasin
.
getSpawnersForFirstTimeMeanAges
(
Gender
.
FE
MALE
).
push
(
0
.);
riverBasin
.
getSpawnersForFirstTimeMeanAges
(
Gender
.
MALE
).
push
(
0
.);
riverBasin
.
getSpawnersForFirstTimeMeanLengths
(
Gender
.
MALE
).
push
(
0
.);
}
if
(
numberOfMaleSpawnerForFirstTime
>
0
)
{
...
...
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