Author: bpoussin
Date: 2009-02-20 17:06:06 +0000 (Fri, 20 Feb 2009)
New Revision: 60
Added:
trunk/simulators/SimulatorEffortByCell.java
Modified:
trunk/scripts/ResultName.java
trunk/scripts/SiMatrix.java
trunk/simulators/DefaultSimulator.java
Log:
- Modification de SiMatrix et default simulor pour pouvoir simuler par cell ou par zone sur l'effort
- ajout des petites modifications faites par l'ifremer
Modified: trunk/scripts/ResultName.java
===================================================================
--- trunk/scripts/ResultName.java 2008-12-18 15:20:52 UTC (rev 59)
+++ trunk/scripts/ResultName.java 2009-02-20 17:06:06 UTC (rev 60)
@@ -55,7 +55,7 @@
static final public String MATRIX_DISCARDS_WEIGHT_PER_STR_MET_PER_ZONE_POP = n_("matrixDiscardsWeightPerStrMet");
@Doc(value = "do the doc of Result matrixDiscardsPerStrMet")
- static final public String MATRIX_DISCARDS_PER_STR_MET = n_("matrixDiscardsPerStrMet");
+ static final public String MATRIX_DISCARDS_PER_STR_MET_PER_ZONE_POP = n_("matrixDiscardsPerStrMet");
@Doc(value = "do the doc of Result matrixLandingPerMet")
static final public String MATRIX_LANDING_PER_MET = n_("matrixLandingPerMet");
@@ -65,6 +65,8 @@
static final public String MATRIX_STD_TRAVEL_EFFORT_PER_STRATEGY_MET = n_("matrixStdTravelEffortPerStrategyMet");
@Doc(value = "do the doc of Result matrixEffortPerZonePop")
static final public String MATRIX_EFFORT_PER_ZONE_POP = n_("matrixEffortPerZonePop");
+ @Doc(value = "Disponible uniquement avec les simulations par Zone. do the doc of Result matrixCatchRatePerStrategyMet")
+ static final public String MATRIX_CATCH_RATE_PER_STRATEGY_MET_PER_ZONE_POP = n_("matrixCatchRatePerStrategyMet");
@Doc(value = "do the doc of Result matrixCatchPerStrategyMetPerZoneMet")
static final public String MATRIX_CATCH_PER_STRATEGY_MET_PER_ZONE_MET = n_("matrixCatchPerStrategyMetPerZoneMet");
@Doc(value = "do the doc of Result matrixCatchPerStrategyMetPerZonePop")
@@ -73,10 +75,16 @@
static final public String MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_MET = n_("matrixCatchWeightPerStrategyMetPerZoneMet");
@Doc(value = "do the doc of Result matrixCatchWeightPerStrategyMetPerZonePop")
static final public String MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP = n_("matrixCatchWeightPerStrategyMetPerZonePop");
+ @Doc(value = "Disponible uniquement avec les simulations par Zone. do the doc of Result matrixFishingMortality")
+ static final public String MATRIX_FISHING_MORTALITY = n_("matrixFishingMortality");
@Doc(value = "do the doc of Result matrixAbundance")
static final public String MATRIX_ABUNDANCE = n_("matrixAbundance");
@Doc(value = "do the doc of Result matrixBiomass")
static final public String MATRIX_BIOMASS = n_("matrixBiomass");
+ @Doc(value = "do the doc of Result matrixBiomassBeginMonth")
+ static final public String MATRIX_BIOMASS_BEGIN_MONTH = n_("matrixBiomassBeginMonth");
+ @Doc(value = "do the doc of Result matrixBiomassBeginMonth")
+ static final public String MATRIX_ABONDANCE_BEGIN_MONTH = n_("matrixAbondanceBeginMonth");
@Doc(value = "do the doc of Result matrixFishingTimePerMonthPerVessel")
static final public String MATRIX_FISHING_TIME_PER_MONTH_PER_VESSEL = n_("matrixFishingTimePerMonthPerVessel");
Modified: trunk/scripts/SiMatrix.java
===================================================================
--- trunk/scripts/SiMatrix.java 2008-12-18 15:20:52 UTC (rev 59)
+++ trunk/scripts/SiMatrix.java 2009-02-20 17:06:06 UTC (rev 60)
@@ -337,9 +337,251 @@
return result;
}
+
/**
+ * Utilise pour le calcul en Zone
+ *
* Matrice des captures en nombre
* dim [ Strategy x Metier x Classe x zonePop ]
+ *
+ * @param N l'abondance sous forme de matrice 2D [class x zone]
+ * @param pop
+ * @param date
+ * @return
+ * @throws TopiaException
+ * @throws IsisFishException
+ */
+ public MatrixND matrixCatchPerStrategyMetPerZone(MatrixND N, Population pop,
+ Date date, MatrixND matrixCatchRatePerStrategyMet) throws TopiaException, IsisFishException {
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+ List<Zone> zones = pop.getPopulationZone();
+
+ // on le passe en argument ce qui evite de le calculer 2 fois
+// MatrixND matrixCatchRatePerStrategyMet = matrixCatchRatePerStrategyMet(pop, date);
+ MatrixND result = matrixCatchRatePerStrategyMet.copy();
+ result.setName(ResultName.MATRIX_CATCH_PER_STRATEGY_MET_PER_ZONE_POP);
+
+ for(PopulationGroup group : groups) {
+ MatrixND sub = result.getSubMatrix(2, group, 1);
+ for(Zone zone : zones){
+ MatrixND subsub = sub.getSubMatrix(3, zone, 1);
+ double val = N.getValue(group, zone);
+ subsub.mults(val);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Utilise pour le calcul en Zone
+ * Matrice des captures en poids
+ * dim [ Strategy x Metier x Classe x zonePop ]
+ *
+ * @param pop
+ * @param date
+ * @return
+ * @throws TopiaException
+ * @throws IsisFishException
+ */
+ public MatrixND matrixCatchRatePerStrategyMetPerZone(Population pop, Date date, MatrixND matrixFishingMortality) throws TopiaException, IsisFishException {
+ List<Strategy> strategies = getStrategies(date);
+ List<Metier> metiers = getMetiers(date);
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+ List<Zone> zones = pop.getPopulationZone();
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ ResultName.MATRIX_CATCH_RATE_PER_STRATEGY_MET_PER_ZONE_POP,
+ new List[]{strategies, metiers, groups, zones},
+ new String[]{n_("Strategies"), n_("Metiers"), n_("Groups"), n_("Zones")});
+
+ // Optimisation Hilaire
+ for (int s=0; s < strategies.size(); s++) {
+ Strategy str = strategies.get(s);
+ metiers = getMetiers(str, date);
+ for (int m=0; m < metiers.size(); m++) {
+ Metier metier = metiers.get(m);
+ for (int z=0; z < zones.size(); z++) {
+ Zone zone = zones.get(z);
+ double effort = effortPerZonePop(str,metier,date,zone);
+ if (effort > 0){
+ for (int g=0; g < groups.size(); g++) {
+ PopulationGroup group = groups.get(g);
+ double value = catchRatePerStrategyMet(str, metier, date, group, zone, matrixFishingMortality);
+ result.setValue(str, metier, group, zone, value);
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @param str
+ * @param metier
+ * @param date
+ * @param zone
+ * @return
+ */
+ private double effortPerZonePop(Strategy str, Metier metier, Date date, Zone zonePop) {
+ Month month = date.getMonth();
+ Collection<Zone> zoneMet = metier.getMetierSeasonInfo(month).getZone();
+ double inter = nbCellInter(zoneMet, zonePop);
+
+ double effortPerStrategyPerCell = effortPerStrategyPerCell(str, metier, date);
+
+ if(log.isDebugEnabled()) {
+ log.debug(
+ " strategy=" + str +
+ " metier=" + metier +
+ " inter=" + inter +
+ " effortPerStrategyPerCell=" + effortPerStrategyPerCell
+ );
+ }
+
+ double result = effortPerStrategyPerCell * inter;
+ return result;
+ }
+
+ // Optimisation Hilaire
+ private double catchRatePerStrategyMet(Strategy str, Metier metier, Date date, PopulationGroup group, Zone zone, MatrixND matrixFishingMortality) throws TopiaException, IsisFishException {
+ double totalFishingMortality = totalFishingMortality(date, matrixFishingMortality).getValue(group, zone);
+
+ if(totalFishingMortality == 0){
+ if(log.isDebugEnabled()) {log.debug("pas de totalFishingMortality pour (" + group + ", " + zone +")");}
+ return 0;
+ }
+
+ double fishingMortality = matrixFishingMortality.getValue(str, metier, group, zone);
+ double totalCatchRate = totalCatchRate(date, group, zone, totalFishingMortality);
+
+ if(log.isDebugEnabled()) {
+ log.debug(
+ " totalFishingMortality=" + totalFishingMortality +
+ " fishingMortality=" + fishingMortality +
+ " totalCatchRate=" + totalCatchRate);
+ }
+ double result = fishingMortality / totalFishingMortality * totalCatchRate;
+
+ return result;
+ }
+
+
+ /**
+ * @param date
+ * @param group
+ * @param zone
+ * @param totalFishingMortality
+ * @return
+ * @throws TopiaException
+ */
+ private double totalCatchRate(Date date, PopulationGroup group,
+ Zone zone, double totalFishingMortality) throws TopiaException {
+ double M = group.getNaturalDeathRate(zone) / Month.NUMBER_OF_MONTH;
+ if(M == 0){
+ // normalement il devrait y avoir de la mortalite naturelle
+ if (log.isWarnEnabled()) {
+ log.warn("Pas de mortalit� naturelle pour: " + group);
+ }
+ }
+ double F = totalFishingMortality;
+
+ double result = 0;
+ if( M != 0 || F != 0){
+ result = F/(F+M) * (1 - Math.exp(-(F+M)));
+ }
+
+ return result;
+ }
+
+ /**
+ * Returne une matrice de mortalite group x zone, donc somme sur str et metier
+ *
+ * @param date
+ * @param matrixFishingMortality
+ * @param group
+ * @param zone
+ * @return
+ */
+ private MatrixND totalFishingMortality(Date date, MatrixND matrixFishingMortality) {
+ MatrixND result = matrixFishingMortality.sumOverDim(0);
+ result = result.sumOverDim(1);
+ result = result.reduceDims(0, 1);
+ return result;
+ }
+
+ /**
+ * Matrice fishing mortality
+ * dim [ Strategy x Metier x Classe x zonePop ]
+ *
+ * @param pop
+ * @param date
+ * @return
+ * @throws TopiaException
+ * @throws IsisFishException
+ */
+ public MatrixND matrixFishingMortality(Date date, Population pop) throws TopiaException, IsisFishException {
+ List<Strategy> strategies = getStrategies(date);
+ List<Metier> metiers = getMetiers(date);
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+ List<Zone> zones = pop.getPopulationZone();
+
+ // default value in matrix is 0
+ MatrixND result = MatrixFactory.getInstance().create(
+ ResultName.MATRIX_FISHING_MORTALITY,
+ new List[]{strategies, metiers, groups, zones},
+ new String[]{n_("Strategies"), n_("Metiers"), n_("Groups"), n_("Zones")});
+
+ Month month = date.getMonth();
+ PopulationSeasonInfo infoPop = pop.getPopulationSeasonInfo(month);
+
+ for (int g = 0; g < groups.size(); g++) {
+ PopulationGroup group = groups.get(g);
+
+ // getCapturability is check matrix validity and create matrix if needed and get one value in
+ double capturability = infoPop.getCapturability(group);
+ if (capturability != 0) { // check 0, this prevent next call, for default value
+
+ for (int m = 0; m < metiers.size(); m++) {
+ Metier metier = metiers.get(m);
+
+ MetierSeasonInfo infoMet = metier.getMetierSeasonInfo(month);
+ // getTargetFactor seem to be simple
+ double ciblage = infoMet.getTargetFactor(group);
+
+ if (ciblage != 0) { // check 0, this prevent next call, for default value
+
+ Gear gear = metier.getGear();
+ Selectivity selectivity = gear.getPopulationSelectivity(pop);
+ if (selectivity != null) {
+
+ // getCoefficient is equation evaluation
+ double coeff = selectivity.getCoefficient(pop, group, metier);
+ if (coeff != 0) { // check 0, this prevent next call, for default value
+
+ for (int s = 0; s < strategies.size(); s++) {
+ Strategy str = strategies.get(s);
+ for (int z = 0; z < zones.size(); z++) {
+ Zone zone = zones.get(z);
+ double effort = effortPerZonePop(str, metier, date, zone);
+ if (effort > 0) { // put value only if <> 0
+ double value = coeff * capturability * ciblage * effort;
+ result.setValue(str, metier, group, zone, value);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Matrice des captures en nombre
+ * dim [ Strategy x Metier x Classe x zonePop ]
*
* @param N l'abondance sous forme de matrice 2D [class x zone]
* @param pop
@@ -1219,6 +1461,7 @@
}
/**
+ * Utilise pour le calcule en Cell
* @param N
* @param pop
* @param date
@@ -1238,12 +1481,95 @@
return result;
}
-
+
/**
+ * Utilise pour le calcule en Zone
+ * @param N
+ * @param pop
* @param date
+ * @return
+ * @throws IsisFishException
+ * @throws TopiaException
+ */
+ public MatrixND matrixAbundance(MatrixND N, Population pop, Date date, MatrixND matrixFishingMortality) throws TopiaException, IsisFishException {
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+ List<Zone> zones = pop.getPopulationZone();
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ ResultName.MATRIX_ABUNDANCE,
+ new List[]{groups, zones},
+ new String[]{n_("Groups"), n_("Zones")});
+
+ for (int g=0; g < groups.size(); g++) {
+ PopulationGroup group = groups.get(g);
+ for (int z=0; z < zones.size(); z++) {
+ Zone zone = zones.get(z);
+ double value = survivalRatePerZone(date, group, zone, matrixFishingMortality);
+ double n = N.getValue(g, z);
+ value *= n;
+ result.setValue(g, z, value);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Utilise pour la mortalite des poissons, lorsqu'aucune strategie n'est
+ * selectionnee.
+ * @param N
+ * @param pop
+ * @param date
+ * @return
+ * @throws IsisFishException
+ * @throws TopiaException
+ */
+ public MatrixND matrixAbundanceSsF(MatrixND N, Population pop, Date date) throws TopiaException, IsisFishException {
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+ List<Zone> zones = pop.getPopulationZone();
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ ResultName.MATRIX_ABUNDANCE,
+ new List[]{groups, zones},
+ new String[]{n_("Groups"), n_("Zones")});
+
+ for (int g=0; g < groups.size(); g++) {
+ PopulationGroup group = groups.get(g);
+ for (int z=0; z < zones.size(); z++) {
+ Zone zone = zones.get(z);
+ double M = group.getNaturalDeathRate(zone)/(double)Month.NUMBER_OF_MONTH;
+ double value = (double)Math.exp(-M);;
+ double n = N.getValue(g, z);
+ value *= n;
+ result.setValue(g, z, value);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @param date
* @param group
* @param zone
* @return
+ * @throws IsisFishException
+ * @throws TopiaException
+ */
+ private double survivalRatePerZone(Date date, PopulationGroup group, Zone zone, MatrixND matrixFishingMortality) throws TopiaException, IsisFishException {
+ double F = totalFishingMortality(date, matrixFishingMortality).getValue(group, zone); //totalFishingMortality(date, group, zone); // rem perf: totalFishingMortality a deja ete calcul�
+ double M = group.getNaturalDeathRate(zone)/(double)Month.NUMBER_OF_MONTH;
+ double result = Math.exp(-(F+M));
+
+ return result;
+ }
+
+
+ /**
+ * @param date
+ * @param group
+ * @param zone
+ * @return
* @throws IsisFishException
* @throws TopiaException
*/
@@ -1289,18 +1615,53 @@
result.setValue(group, zone, value);
}
}
-
-// for(PopulationGroup group : groups){
-// double meanWeight = group.getMeanWeight();
-// for(Zone zone : zones){
-// double val = N.getValue(group, zone) * meanWeight;
-// result.setValue(group, zone, val);
-// }
-// }
return result;
}
+ public MatrixND matrixBiomassBeginMonth(MatrixND N, Population pop, Date date) {
+ List<PopulationGroup> groups = N.getSemantics(0);
+ List<Zone> zones = N.getSemantics(1);
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ ResultName.MATRIX_BIOMASS_BEGIN_MONTH,
+ new List[]{groups, zones},
+ new String[]{n_("Groups"), n_("Zones")});
+
+ for (int g = 0; g < groups.size(); g++) {
+ PopulationGroup group = groups.get(g);
+ double meanWeight = group.getMeanWeight();
+ for (int z = 0; z < zones.size(); z++) {
+ Zone zone = zones.get(z);
+ double n = N.getValue(group, zone);
+ double value = n * meanWeight;
+ result.setValue(group, zone, value);
+ }
+ }
+ return result;
+ }
+
+ public MatrixND matrixAbondanceBeginMonth(MatrixND N, Population pop, Date date) {
+ List<PopulationGroup> groups = N.getSemantics(0);
+ List<Zone> zones = N.getSemantics(1);
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ ResultName.MATRIX_ABONDANCE_BEGIN_MONTH,
+ new List[]{groups, zones},
+ new String[]{n_("Groups"), n_("Zones")});
+
+ for (int g = 0; g < groups.size(); g++) {
+ PopulationGroup group = groups.get(g);
+ for (int z = 0; z < zones.size(); z++) {
+ Zone zone = zones.get(z);
+ double value = N.getValue(group, zone);
+ result.setValue(group, zone, value);
+ }
+ }
+ return result;
+ }
+
+
///////////////////////////////////////////////////////////////////////////
//
//
Modified: trunk/simulators/DefaultSimulator.java
===================================================================
--- trunk/simulators/DefaultSimulator.java 2008-12-18 15:20:52 UTC (rev 59)
+++ trunk/simulators/DefaultSimulator.java 2009-02-20 17:06:06 UTC (rev 60)
@@ -274,7 +274,7 @@
MatrixND discard = populationMonitor.getDiscard(date, pop);
if (discard != null || date.getDate() == 0) { // force discard for the first month to have discard in result
if (discard == null) {
- discard = MatrixFactory.getInstance().create(ResultName.MATRIX_DISCARDS_PER_STR_MET,
+ discard = MatrixFactory.getInstance().create(ResultName.MATRIX_DISCARDS_PER_STR_MET_PER_ZONE_POP,
new List[]{siMatrix.getStrategies(date),
siMatrix.getMetiers(date),
pop.getPopulationGroup(),
@@ -323,7 +323,13 @@
date = date.next();
}
}
-
+
+ protected boolean isEffortByCell(SimulationContext context) {
+ boolean result = "true".equalsIgnoreCase(context.getSimulationStorage()
+ .getParameter().getTagValue().get("effortByCell"));
+ return result;
+ }
+
protected void computeMonth(SimulationContext context, SiMatrix siMatrix, Date date, Population pop) throws IsisFishException, TopiaException {
// to add result
ResultStorage resManager = context.getSimulationStorage().getResultStorage();
@@ -402,25 +408,44 @@
N = N.add(recruitment);
log.debug("N after recru: " + N);
+ if (resManager.isEnabled(ResultName.MATRIX_ABONDANCE_BEGIN_MONTH)) {
+ MatrixND abondanceBM = siMatrix.matrixAbondanceBeginMonth(N, pop, date);
+ resManager.addResult(date, pop, abondanceBM);
+ }
+
+ if (resManager.isEnabled(ResultName.MATRIX_BIOMASS_BEGIN_MONTH)) {
+ MatrixND biomassBM = siMatrix.matrixBiomassBeginMonth(N, pop, date);
+ resManager.addResult(date, pop, biomassBM);
+ }
+
+
MatrixND abundance = N;
// compute fishing matrix only if there are one or more strategy
if (siMatrix.getStrategies(date).size() > 0) {
// compute some Matrix and add result
+
+ // this matrix is necessary for PopulationMonitor.holdCatch (reused in rule)
+ MatrixND catchPerStrategyMetPerZonePop;
+
+ if (isEffortByCell(context)) {
+ abundance = siMatrix.matrixAbundance(N, pop, date);
+ catchPerStrategyMetPerZonePop =
+ siMatrix.matrixCatchPerStrategyMetPerZonePop(N, pop, date);
+ } else { // en zone
+ MatrixND matrixFishingMortality = siMatrix.matrixFishingMortality(date, pop);
+ resManager.addResult(date, pop, matrixFishingMortality);
- // n'existe plus suite a l'implantation de calculs en cell
-// MatrixND matrixFishingMortality = siMatrix.matrixFishingMortality(date, pop);
-// resManager.addResult(date, pop, matrixFishingMortality);
-
- abundance = siMatrix.matrixAbundance(N, pop, date);
+ abundance = siMatrix.matrixAbundance(N, pop, date, matrixFishingMortality);
- // n'existe plus suite a l'implantation de calculs en cell
- // this matrix is necessary for matrixCatchPerStrategyMet
-// MatrixND catchRatePerStrategyMet = siMatrix.matrixCatchRatePerStrategyMet(pop, date, matrixFishingMortality);
-// resManager.addResult(date, pop, catchRatePerStrategyMet);
+ // this matrix is necessary for matrixCatchPerStrategyMet
+ MatrixND catchRatePerStrategyMet = siMatrix.matrixCatchRatePerStrategyMetPerZone(pop, date, matrixFishingMortality);
+ resManager.addResult(date, pop, catchRatePerStrategyMet);
- // this matrix is necessary for PopulationMonitor.holdCatch (reused in rule)
- MatrixND catchPerStrategyMetPerZonePop =
- siMatrix.matrixCatchPerStrategyMetPerZonePop(N, pop, date);
+ catchPerStrategyMetPerZonePop =
+ siMatrix.matrixCatchPerStrategyMetPerZone(N, pop, date, catchRatePerStrategyMet);
+
+ }
+
popMon.holdCatch(pop, catchPerStrategyMetPerZonePop);
resManager.addResult(date, pop, catchPerStrategyMetPerZonePop);
@@ -430,20 +455,25 @@
catchPerStrategyMetPerZonePop);
resManager.addResult(date, pop, catchWeightPerStrategyMet);
}
-
- MatrixND catchPerStrategyMetPerZoneMet =
- siMatrix.matrixCatchPerStrategyMetPerZoneMet(N, pop, date);
- resManager.addResult(date, pop, catchPerStrategyMetPerZoneMet);
-
- if (resManager.isEnabled(ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_MET)) {
- MatrixND catchWeightPerStrategyMet =
- siMatrix.matrixCatchWeightPerStrategyMetPerZoneMet(date, pop,
- catchPerStrategyMetPerZoneMet);
- resManager.addResult(date, pop, catchWeightPerStrategyMet);
+
+ if (isEffortByCell(context)) {
+ MatrixND catchPerStrategyMetPerZoneMet =
+ siMatrix.matrixCatchPerStrategyMetPerZoneMet(N, pop, date);
+ resManager.addResult(date, pop, catchPerStrategyMetPerZoneMet);
+
+ if (resManager.isEnabled(ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_MET)) {
+ MatrixND catchWeightPerStrategyMet =
+ siMatrix.matrixCatchWeightPerStrategyMetPerZoneMet(date, pop,
+ catchPerStrategyMetPerZoneMet);
+ resManager.addResult(date, pop, catchWeightPerStrategyMet);
+ }
}
- }
+ } else { // no strategies
+ // compute only if fishing mortality =0 to apply Natural Mortality
+ abundance = siMatrix.matrixAbundanceSsF(N, pop, date);
+ }
log.debug("abundance: " + abundance);
// Keep new N
Added: trunk/simulators/SimulatorEffortByCell.java
===================================================================
--- trunk/simulators/SimulatorEffortByCell.java (rev 0)
+++ trunk/simulators/SimulatorEffortByCell.java 2009-02-20 17:06:06 UTC (rev 60)
@@ -0,0 +1,66 @@
+/* *##%
+ * Copyright (C) 2009
+ * Ifremer, Code Lutin, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/* *
+ * SimulatorEffortByCell.java
+ *
+ * Created: 20 janvier 2009 16:26:46
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+
+package simulators;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import fr.ifremer.isisfish.simulator.Simulator;
+
+/**
+ * Simulateur qui fixe la valeur de effortByCell a true pour force
+ * l'utilisation des calcules par cellule plutot que par zone.
+ *
+ * @author poussin
+ *
+ */
+public class SimulatorEffortByCell implements Simulator {
+
+ /** to use log facility, just put in your code: log.info("..."); */
+ static private Log log = LogFactory.getLog(SimulatorEffortByCell.class);
+
+ /**
+ * Called by isis don't modify signature
+ */
+ public void simulate(SimulationContext context) throws Exception {
+ SimulationParameter param = context.getSimulationStorage().getParameter();
+ param.getTagValue().put("effortByCell", "true");
+
+ DefaultSimulator simulator = new DefaultSimulator();
+ simulator.simulate(context);
+ }
+
+}
+
+