Commit 7ca61607 authored by Lambert Patrick's avatar Lambert Patrick
Browse files

with observer of mean length of spawner

parent 7867b61c
......@@ -53,8 +53,8 @@
<yAxisLabel>age (year)</yAxisLabel>
<variableName>getMeanAgeOfFirstReprodutionForMale</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<graphType>LINE</graphType>
<title>Statistic for male spawners age</title>
......@@ -71,6 +71,22 @@
<variableName>computeFemaleSpawnerForFirstTimeSummaryStatistic</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<graphType>LINE</graphType>
<title>Mean length at first reproduction for female</title>
<xAxisLabel>Time (season)</xAxisLabel>
<yAxisLabel>length (cm)</yAxisLabel>
<variableName>getMeanLengthOfFirstReprodutionForFemale</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<graphType>LINE</graphType>
<title>Mean length at first reproduction for male</title>
<xAxisLabel>Time (season)</xAxisLabel>
<yAxisLabel>length (cm)</yAxisLabel>
<variableName>getMeanLengthOfFirstReprodutionForMale</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
</observers>
</fr.cemagref.observation.kernel.ObservablesHandler>
</entry>
......
......@@ -39,6 +39,10 @@ public class RiverBasin extends Basin {
private QueueMemory<Double> numberOfNonNulRecruitmentDuringLastYears; // Prob of non nul recruitment during the last "memorySize" years... if 10 non nul recruitment during the last 10 year, p=0.999... if 8 non nul recruitment during the last 10 years, p = 0.8... if 0 recruitment, p = 0.001
private QueueMemory<Double> femaleSpawnersForFirstTimeMeanAges;
private QueueMemory<Double> maleSpawnersForFirstTimeMeanAges;
private QueueMemory<Double> femaleSpawnersForFirstTimeMeanLengths;
private QueueMemory<Double> maleSpawnersForFirstTimeMeanLengths;
private QueueMemory<Double> numberOfNonNulRecruitmentForFinalProbOfPres;
private double nativeSpawnerMortality; // mortality coefficient between recruitement and spawning for fish born in this basin
......@@ -115,6 +119,9 @@ public class RiverBasin extends Basin {
this.femaleSpawnersForFirstTimeMeanAges = new QueueMemory<Double>(memorySize) ;
this.maleSpawnersForFirstTimeMeanAges = new QueueMemory<Double>(memorySize);
this.femaleSpawnersForFirstTimeMeanLengths = new QueueMemory<Double>(memorySize) ;
this.maleSpawnersForFirstTimeMeanLengths = new QueueMemory<Double>(memorySize) ;
this.numberOfNonNulRecruitmentForFinalProbOfPres = new QueueMemory<Double>(memorySizeLongQueue);
if (cobservable == null) {
......@@ -209,6 +216,15 @@ public class RiverBasin extends Basin {
return spawnersForFirstTimeMeanAges.get(Gender.FEMALE);
}*/
public QueueMemory<Double> getSpawnersForFirstTimeMeanLengths(DiadromousFish.Gender gender) {
if (gender == Gender.FEMALE)
return femaleSpawnersForFirstTimeMeanLengths;
else if (gender == Gender.MALE)
return maleSpawnersForFirstTimeMeanLengths;
else
return null;
}
public QueueMemory<Double> getSpawnersForFirstTimeMeanAges(DiadromousFish.Gender gender) {
if (gender == Gender.FEMALE)
return femaleSpawnersForFirstTimeMeanAges;
......
......@@ -684,6 +684,20 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
}
@Observable(description="mean length of first reprodution for female")
public double getMeanLengthOfFirstReprodutionForFemale() {
double sum = 0;
double nb =0;
for (RiverBasin riverBasin : getEnvironment().getRiverBasins()) {
if (riverBasin.getSpawnersForFirstTimeMeanLengths(Gender.FEMALE).getMeanWithoutZero() > 0.) {
nb ++;
sum += riverBasin.getSpawnersForFirstTimeMeanLengths(Gender.FEMALE).getMeanWithoutZero() ;
}
}
return sum/nb;
}
public double computeMaleSpawnerForFirstTimeSummaryStatisticWithTarget(double TARGET ) {
double sum = 0;
for (RiverBasin riverBasin : getEnvironment().getRiverBasins()) {
......@@ -714,7 +728,20 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
return sum/nb;
}
@Observable(description="mean length of first reprodution for male")
public double getMeanLengthOfFirstReprodutionForMale() {
double sum = 0;
double nb =0;
for (RiverBasin riverBasin : getEnvironment().getRiverBasins()) {
if (riverBasin.getSpawnersForFirstTimeMeanLengths(Gender.MALE).getMeanWithoutZero() > 0.) {
nb ++;
sum += riverBasin.getSpawnersForFirstTimeMeanLengths(Gender.MALE).getMeanWithoutZero() ;
}
}
return sum/nb;
}
@Observable(description = "Likelihood Summary stat")
public double computeLikelihood() {
int obsVal;
......
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