Commit 4682d087 authored by Lambert Patrick's avatar Lambert Patrick
Browse files

new observer for spawner effective

parent 29f5cd97
......@@ -31,6 +31,14 @@
<variableName>getFishEffective</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<graphType>LINE</graphType>
<title>Abundance of spawners</title>
<xAxisLabel>Time (season)</xAxisLabel>
<yAxisLabel>number of fishes</yAxisLabel>
<variableName>getSpawnerEffective</variableName>
</fr.cemagref.observation.observers.jfreechart.TemporalSerieChart>
<miscellaneous.TemporalRangeSerieChart>
<title>Range distribution</title>
<xAxisLabel>Time (season)</xAxisLabel>
......
......@@ -33,6 +33,7 @@ import java.util.regex.Pattern;
import miscellaneous.Duo;
import miscellaneous.TreeMapForCentile;
import species.DiadromousFish.Gender;
import species.DiadromousFish.Stage;
import org.openide.util.lookup.ServiceProvider;
......@@ -915,6 +916,22 @@ public class DiadromousFishGroup extends AquaNismsGroup< DiadromousFish, BasinNe
return eff;
}
/**
* @return sum of effectives in all the river basins
*/
@Observable(description = "Number of spawners in river basins")
public double getSpawnerEffective() {
long eff = 0;
for (RiverBasin basin : this.getEnvironment().getRiverBasins()){
if (basin.getFishs(this) != null) {
for (DiadromousFish fish : basin.getFishs(this)) {
if (fish.getStage() == Stage.MATURE)
eff += fish.getAmount();
}
}
}
return eff;
}
@Override
public void addAquaNism(DiadromousFish fish) {
......
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