Commit 85e68843 authored by Lambert Patrick's avatar Lambert Patrick
Browse files

observe mean length of female spawner

parent cc436e52
......@@ -43,7 +43,7 @@
<title>Mean age of female spawners</title>
<xAxisLabel>Time (season)</xAxisLabel>
<yAxisLabel>age (year)</yAxisLabel>
<variableName>computeFemaleSpawnerForFirstTimeSummaryStatistic</variableName>
<variableName>getMeanLengthOfFemaleSpawnerForFirstTime</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
</observers>
......
......@@ -626,7 +626,7 @@ public NutrientRoutine getNutrientRoutine() {
public double computeFemaleSpawnerForFirstTimeSummaryStatistic() {
double sum = 0;
//TODO move TARGET to the right place
double TARGET = 5.5.;
double TARGET = 5.5;
for (RiverBasin riverBasin : getEnvironment().getRiverBasins()) {
if (riverBasin.getSpawnersForFirstTimeMeanAges(Gender.FEMALE).getMeanWithoutZero() > 0.) {
double val = riverBasin.getSpawnersForFirstTimeMeanAges(Gender.FEMALE).getMeanWithoutZero() - TARGET;
......@@ -636,18 +636,17 @@ public NutrientRoutine getNutrientRoutine() {
return sum;
}
@Observable(description="Female spawners For First Time Summary Statistic")
public double computeFemaleSpawnerForFirstTimeSummary() {
@Observable(description="mean length for female spawners For First Time")
public double getMeanLengthOfFemaleSpawnerForFirstTime() {
double sum = 0;
//TODO move TARGET to the right place
double TARGET = 0.;
double nb =0;
for (RiverBasin riverBasin : getEnvironment().getRiverBasins()) {
if (riverBasin.getSpawnersForFirstTimeMeanAges(Gender.FEMALE).getMeanWithoutZero() > 0.) {
double val = riverBasin.getSpawnersForFirstTimeMeanAges(Gender.FEMALE).getMeanWithoutZero() - TARGET;
sum += val * val;
nb ++;
sum += riverBasin.getSpawnersForFirstTimeMeanAges(Gender.FEMALE).getMeanWithoutZero() ;
}
}
return sum;
return sum/nb;
}
......
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