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

observe mean length of female spawner

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