Author: chatellier Date: 2009-12-14 15:50:29 +0000 (Mon, 14 Dec 2009) New Revision: 2828 Modified: isis-fish/trunk/src/test/resources/test-database/scripts/SiMatrix.java isis-fish/trunk/src/test/resources/test-database/simulators/DefaultSimulator.java Log: Fix test database compilation Modified: isis-fish/trunk/src/test/resources/test-database/scripts/SiMatrix.java =================================================================== --- isis-fish/trunk/src/test/resources/test-database/scripts/SiMatrix.java 2009-12-14 14:28:56 UTC (rev 2827) +++ isis-fish/trunk/src/test/resources/test-database/scripts/SiMatrix.java 2009-12-14 15:50:29 UTC (rev 2828) @@ -19,7 +19,7 @@ package scripts; -import static org.codelutin.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n_; import java.util.ArrayList; import java.util.Collection; @@ -29,11 +29,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.codelutin.math.matrix.MatrixFactory; -import org.codelutin.math.matrix.MatrixIterator; -import org.codelutin.math.matrix.MatrixND; -import org.codelutin.topia.TopiaContext; -import org.codelutin.topia.TopiaException; +import org.nuiton.math.matrix.MatrixFactory; +import org.nuiton.math.matrix.MatrixIterator; +import org.nuiton.math.matrix.MatrixND; +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; import fr.ifremer.isisfish.IsisFishDAOHelper; import fr.ifremer.isisfish.IsisFishException; @@ -61,15 +61,15 @@ * Created: 21 aout 2006 15:53:01 * * @author poussin - * @version $Revision: 1.18 $ + * @version $Revision: 1 $ * - * Last update: $Date: 2007-11-02 17:53:20 $ + * Last update: $Date: 2009-10-19 14:25:49 +0200 (lun., 19 oct. 2009) $ * by : $Author: bpoussin $ */ public class SiMatrix { /** to use log facility, just put in your code: log.info("..."); */ - static private Log log = LogFactory.getLog(SiMatrix.class); + private Log log = LogFactory.getLog(SiMatrix.class); protected SimulationContext context = null; protected TopiaContext db = null; @@ -269,7 +269,7 @@ List<Strategy> strategies = getStrategies(date); List<Metier> metiers = getMetiers(date); - List<PopulationGroup> groups = matrixCatchPerStrategyMetPerCell + List<PopulationGroup> groups = (List<PopulationGroup>)matrixCatchPerStrategyMetPerCell .getSemantics(2); List<Zone> zones = getZones(date); @@ -1361,7 +1361,7 @@ 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); @@ -1425,8 +1425,8 @@ * @return */ public MatrixND matrixBiomass(MatrixND N, Population pop, Date date) { - List<PopulationGroup> groups = N.getSemantics(0); - List<Zone> zones = N.getSemantics(1); + List<PopulationGroup> groups = (List<PopulationGroup>)N.getSemantics(0); + List<Zone> zones = (List<Zone>)N.getSemantics(1); MatrixND result = MatrixFactory.getInstance().create( ResultName.MATRIX_BIOMASS, new List[] { groups, zones }, @@ -1448,8 +1448,8 @@ public MatrixND matrixBiomassBeginMonth(MatrixND N, Population pop, Date date) { - List<PopulationGroup> groups = N.getSemantics(0); - List<Zone> zones = N.getSemantics(1); + List<PopulationGroup> groups = (List<PopulationGroup>)N.getSemantics(0); + List<Zone> zones = (List<Zone>)N.getSemantics(1); MatrixND result = MatrixFactory.getInstance().create( ResultName.MATRIX_BIOMASS_BEGIN_MONTH, new List[] { groups, zones }, @@ -1470,8 +1470,8 @@ public MatrixND matrixAbondanceBeginMonth(MatrixND N, Population pop, Date date) { - List<PopulationGroup> groups = N.getSemantics(0); - List<Zone> zones = N.getSemantics(1); + List<PopulationGroup> groups = (List<PopulationGroup>)N.getSemantics(0); + List<Zone> zones = (List<Zone>)N.getSemantics(1); MatrixND result = MatrixFactory.getInstance().create( ResultName.MATRIX_ABUNDANCE_BEGIN_MONTH, new List[] { groups, zones }, Modified: isis-fish/trunk/src/test/resources/test-database/simulators/DefaultSimulator.java =================================================================== --- isis-fish/trunk/src/test/resources/test-database/simulators/DefaultSimulator.java 2009-12-14 14:28:56 UTC (rev 2827) +++ isis-fish/trunk/src/test/resources/test-database/simulators/DefaultSimulator.java 2009-12-14 15:50:29 UTC (rev 2828) @@ -1,6 +1,6 @@ /* *##% - * Copyright (C) 2006 - * Ifremer, Code Lutin, C?dric Pineau, Benjamin Poussin + * Copyright (C) 2006 - 2009 + * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,26 +23,25 @@ * Created: 21 ao?t 2006 10:57:46 * * @author poussin - * @version $Revision: 1.19 $ + * @version $Revision: 1 $ * - * Last update: $Date: 2007-11-06 18:16:14 $ + * Last update: $Date: 2009-10-19 14:25:49 +0200 (lun., 19 oct. 2009) $ * by : $Author: bpoussin $ */ package simulators; -import static org.codelutin.i18n.I18n._; -import static org.codelutin.i18n.I18n.n_; +import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; -import java.util.Collection; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.codelutin.math.matrix.MatrixFactory; -import org.codelutin.math.matrix.MatrixND; -import org.codelutin.topia.TopiaContext; -import org.codelutin.topia.TopiaException; +import org.nuiton.math.matrix.MatrixFactory; +import org.nuiton.math.matrix.MatrixND; +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; import scripts.GravityModel; import scripts.ResultName; @@ -52,8 +51,6 @@ import fr.ifremer.isisfish.entities.Metier; import fr.ifremer.isisfish.entities.Population; import fr.ifremer.isisfish.entities.PopulationSeasonInfo; -import fr.ifremer.isisfish.entities.Strategy; -import fr.ifremer.isisfish.entities.Zone; import fr.ifremer.isisfish.rule.Rule; import fr.ifremer.isisfish.simulator.MetierMonitor; import fr.ifremer.isisfish.simulator.PopulationMonitor; @@ -68,43 +65,47 @@ /** * @author poussin - * + * */ public class DefaultSimulator implements Simulator { - + /** to use log facility, just put in your code: log.info("..."); */ - static private Log log = LogFactory.getLog(DefaultSimulator.class); + private Log log = LogFactory.getLog(DefaultSimulator.class); /** * Called by isis don't modify signature */ public void simulate(SimulationContext context) throws Exception { - SimulationParameter param = context.getSimulationStorage().getParameter(); + SimulationParameter param = context.getSimulationStorage() + .getParameter(); SimulationControl control = context.getSimulationControl(); int lastYear = param.getNumberOfYear(); int lastDate = lastYear * Month.NUMBER_OF_MONTH; Date date = control.getDate(); - + ResultManager resManager = context.getResultManager(); TopiaContext db = context.getDB(); - + SiMatrix siMatrix = SiMatrix.getSiMatrix(context); GravityModel gravityModel = new GravityModel(context, siMatrix); - + PopulationMonitor populationMonitor = context.getPopulationMonitor(); MetierMonitor metierMonitor = context.getMetierMonitor(); RuleMonitor ruleMonitor = context.getRuleMonitor(); - + List<Population> allpops = siMatrix.getPopulations(date); populationMonitor.init(allpops); - + for (Population pop : allpops) { MatrixND N = param.getNumberOf(pop); N.setName(ResultName.MATRIX_ABUNDANCE); populationMonitor.setN(pop, N); } + + // reload context parameters with context.getDB() context + param.reloadContextParameters(); // // Rule initialisation @@ -113,32 +114,42 @@ control.setText("Rules initialisation:" + rules); for (Rule rule : rules) { rule.init(context); - log.info("Rule " +rule.getClass().getSimpleName()+ " initialized"); + log.info("Rule " + rule.getClass().getSimpleName() + + " initialized"); } - + // // Commit all change done un init rules methods. // context.getDB().commitTransaction(); - + // // Simulation loop // while (date.getDate() < lastDate) { + // // if user stop simulation before last year // if (control.isStopSimulationRequest()) { break; } - + control.setDate(date); control.setProgress(date.getDate()); control.setText(_("begin step " + date)); - + + // + // Reload parameters for current step + // + control.setText(_("Reloading parameters")); + // reload context parameters with db.rollbackTransaction() context + param.reloadContextParameters(); + rules = param.getRules(); + // raz des metiers interdits et des licences metierMonitor.clear(); - + if (date.getMonth().equals(Month.JANUARY)) { populationMonitor.clearCatch(); } @@ -147,17 +158,18 @@ if (siMatrix.getStrategies(date).size() > 0) { if (resManager.isEnabled(ResultName.MATRIX_NO_ACTIVITY)) { MatrixND mat = metierMonitor.getOrCreateNoActivity(date, - ResultName.MATRIX_NO_ACTIVITY, - siMatrix.getStrategies(date), - siMatrix.getMetiers(date)); + ResultName.MATRIX_NO_ACTIVITY, siMatrix + .getStrategies(date), siMatrix + .getMetiers(date)); resManager.addResult(date, mat); } } - + // // Rule condition evaluation // - control.setText("Evalute Rules conditions ("+rules.size()+" rules)"); + control.setText("Evaluate rules conditions (" + rules.size() + + " rules)"); for (Rule rule : rules) { for (Metier metier : siMatrix.getMetiers(date)) { boolean active = false; @@ -165,30 +177,34 @@ active = rule.condition(context, date, metier); } catch (Exception eee) { if (log.isWarnEnabled()) { - log.warn("Can't evaluate rule condition for: " + rule, eee); + log.warn("Can't evaluate rule condition for: " + + rule, eee); } } - ruleMonitor.setEvaluationCondition(date, rule, metier, active); + ruleMonitor.setEvaluationCondition(date, rule, metier, + active); if (active) { - log.info("Activate rule: " + rule.getClass().getSimpleName()); + log.info("Activate rule: " + + rule.getClass().getSimpleName()); resManager.addActiveRule(date, rule); } } } - + // // Rule pre action // control.setText("Do pre action Rules"); for (Rule rule : rules) { for (Metier metier : siMatrix.getMetiers(date)) { - boolean condition = ruleMonitor.getEvalutionCondition(date, rule, metier); + boolean condition = ruleMonitor.getEvalutionCondition(date, + rule, metier); if (condition) { rule.preAction(context, date, metier); } } } - + // // Keep modification's information done in rule // @@ -196,7 +212,7 @@ MatrixND metierZone = siMatrix.getMetierZone(date); resManager.addResult(date, metierZone); } - + // // Simulate one step for all pop // @@ -204,40 +220,37 @@ for (Population pop : siMatrix.getPopulations(date)) { computeMonth(context, siMatrix, date, pop); } - + // // Add some result not population dependante // - + // only if there are one or more strategy if (siMatrix.getStrategies(date).size() > 0) { control.setText("Add some results"); - if (resManager.isEnabled(ResultName.MATRIX_EFFORT_PER_STRATEGY_MET)) { - MatrixND effortPerStrategyMet = siMatrix.matrixEffortPerStrategyMet(date); + if (resManager + .isEnabled(ResultName.MATRIX_EFFORT_PER_STRATEGY_MET)) { + MatrixND effortPerStrategyMet = siMatrix + .matrixEffortPerStrategyMet(date); resManager.addResult(date, effortPerStrategyMet); } - - if (resManager.isEnabled(ResultName.MATRIX_STD_TRAVEL_EFFORT_PER_STRATEGY_MET)) { - MatrixND stdTravelEffortPerStrategyMet = siMatrix.matrixEffortPerStrategyMet(date); - resManager.addResult(date, stdTravelEffortPerStrategyMet); + + if (resManager.isEnabled(ResultName.MATRIX_EFFORT_NOMINAL_PER_STRATEGY_MET)) { + MatrixND effortNominalPerStrategyMet = siMatrix.matrixEffortNominalPerStrategyMet(date); + resManager.addResult(date, effortNominalPerStrategyMet); } - if (resManager.isEnabled(ResultName.MATRIX_EFFORT_PER_ZONE_POP)) { - MatrixND effortPerZonePop = siMatrix.matrixEffortPerStrategyMet(date); - resManager.addResult(date, effortPerZonePop); - } - - // // Add economics results // - if (!"false".equalsIgnoreCase(param.getTagValue().get("ecoResult"))) { + if (!"false".equalsIgnoreCase(param.getTagValue().get( + "ecoResult"))) { control.setText("Add economics results"); saveGravityModel(date, resManager, gravityModel); } } - + // // Add economics results // @@ -248,8 +261,6 @@ } } - - // // Rule post action // @@ -274,18 +285,25 @@ 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_PER_ZONE_POP, - new List[]{siMatrix.getStrategies(date), - siMatrix.getMetiers(date), - pop.getPopulationGroup(), - pop.getPopulationZone()}, - new String[]{n_("Strategies"), n_("Metiers"), n_("Groups"), n_("Zones")}); + discard = MatrixFactory.getInstance().create( + ResultName.MATRIX_DISCARDS_PER_STR_MET_PER_ZONE_POP, + new List[] { siMatrix.getStrategies(date), + siMatrix.getMetiers(date), + pop.getPopulationGroup(), + pop.getPopulationZone() }, + new String[] { n_("Strategies"), + n_("Metiers"), n_("Groups"), + n_("Zones") }); } resManager.addResult(date, pop, discard); - if (resManager.isEnabled(ResultName.MATRIX_DISCARDS_WEIGHT_PER_STR_MET_PER_ZONE_POP)) { - MatrixND discardWeightPerStrategyMet = siMatrix.matrixDiscardWeightPerStrategyMetPerZonePop(pop, date, discard); - resManager.addResult(date, pop, discardWeightPerStrategyMet); + if (resManager + .isEnabled(ResultName.MATRIX_DISCARDS_WEIGHT_PER_STR_MET_PER_ZONE_POP)) { + MatrixND discardWeightPerStrategyMet = siMatrix + .matrixDiscardWeightPerStrategyMetPerZonePop( + pop, date, discard); + resManager.addResult(date, pop, + discardWeightPerStrategyMet); } } @@ -294,7 +312,8 @@ // add landing result // if (resManager.isEnabled(ResultName.MATRIX_LANDING_PER_MET)) { - MatrixND landing = MatrixFactory.getInstance().create(populationMonitor.getCatch(pop)); + MatrixND landing = MatrixFactory.getInstance().create( + populationMonitor.getCatch(pop)); if (discard != null) { landing = landing.minus(discard); } @@ -309,14 +328,14 @@ // control.setText("Rollback rules changes"); db.rollbackTransaction(); - + // // commit result // control.setText("Commit results"); TopiaContext tx = context.getDbResult(); tx.commitTransaction(); - + // // Go next step // @@ -330,45 +349,50 @@ return result; } - protected void computeMonth(SimulationContext context, SiMatrix siMatrix, Date date, Population pop) throws IsisFishException, TopiaException { + protected void computeMonth(SimulationContext context, SiMatrix siMatrix, + Date date, Population pop) throws IsisFishException, TopiaException { // to add result - ResultStorage resManager = context.getSimulationStorage().getResultStorage(); + ResultStorage resManager = context.getSimulationStorage() + .getResultStorage(); PopulationMonitor popMon = context.getPopulationMonitor(); MatrixND N = popMon.getN(pop); - + if (log.isInfoEnabled()) { - log.info("====================== begin "+ date + " - " + pop +" =========================== " + System.currentTimeMillis()); + log.info("====================== begin " + date + " - " + pop + + " =========================== " + + System.currentTimeMillis()); log.info("N: " + N); } - + // add N and biomass result now, before computation // N is reassigned during computation - resManager.addResult(date, pop, N); + resManager.addResult(date, pop, N); if (resManager.isEnabled(ResultName.MATRIX_BIOMASS)) { MatrixND biomass = siMatrix.matrixBiomass(N, pop, date); resManager.addResult(date, pop, biomass); } - + Month month = date.getMonth(); PopulationSeasonInfo info = pop.getPopulationSeasonInfo(month); - + // group change MatrixND CA = null; if (date.getDate() == 0) { - CA = MatrixFactory.getInstance().matrixId(pop.sizePopulationGroup()*pop.sizePopulationZone()); + CA = MatrixFactory.getInstance().matrixId( + pop.sizePopulationGroup() * pop.sizePopulationZone()); } else { CA = info.getGroupChangeMatrix(month); } log.debug("CA: " + CA); - + //migration - MatrixND M = info.getMigrationMatrix(month, N); + MatrixND M = info.getMigrationMatrix(month, N); log.debug("M: " + M); //emigration - MatrixND EM = info.getEmigrationMatrix(month, N); + MatrixND EM = info.getEmigrationMatrix(month, N); log.debug("EM: " + EM); //immigration MatrixND IM = info.getImmigrationMatrix(month, N).transpose(); @@ -382,9 +406,9 @@ MatrixND tmp1 = M.minus(EM); MatrixND tmp2 = tmp0.mult(tmp1); MatrixND tmp3 = tmp2.add(IM); - + log.debug("N1D after mig: " + tmp3); - + // On reconvertie en une matrice Semantique N = pop.split2D(tmp3); @@ -393,32 +417,32 @@ //Recrutement MatrixND R = info.getReproductionMatrix(month, N); log.debug("R: " + R); - + // ajout de la matrice R dans le suivi de la pop comme etant // la reproduction pour le mois courant. popMon.setReproduction(date, pop, R); - + // recrutement MatrixND recruitment = popMon.getRecruitment(date, pop); log.debug("recruitment: " + recruitment); - + // mortalite de la reproduction popMon.applyReproductionMortality(pop); - + 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); + if (resManager.isEnabled(ResultName.MATRIX_ABUNDANCE)) { + MatrixND abondanceBM = siMatrix.matrixAbondanceBeginMonth(N, pop, + date); resManager.addResult(date, pop, abondanceBM); } - if (resManager.isEnabled(ResultName.MATRIX_BIOMASS_BEGIN_MONTH)) { + if (resManager.isEnabled(ResultName.MATRIX_BIOMASS)) { 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) { @@ -429,153 +453,193 @@ if (isEffortByCell(context)) { abundance = siMatrix.matrixAbundance(N, pop, date); - catchPerStrategyMetPerZonePop = - siMatrix.matrixCatchPerStrategyMetPerZonePop(N, pop, date); + catchPerStrategyMetPerZonePop = siMatrix + .matrixCatchPerStrategyMetPerZonePop(N, pop, date); } else { // en zone - MatrixND matrixFishingMortality = siMatrix.matrixFishingMortality(date, pop); + MatrixND matrixFishingMortality = siMatrix + .matrixFishingMortality(date, pop); resManager.addResult(date, pop, matrixFishingMortality); - - abundance = siMatrix.matrixAbundance(N, pop, date, matrixFishingMortality); + abundance = siMatrix.matrixAbundance(N, pop, date, + matrixFishingMortality); + // this matrix is necessary for matrixCatchPerStrategyMet - MatrixND catchRatePerStrategyMet = siMatrix.matrixCatchRatePerStrategyMetPerZone(pop, date, matrixFishingMortality); + MatrixND catchRatePerStrategyMet = siMatrix + .matrixCatchRatePerStrategyMetPerZone(pop, date, + matrixFishingMortality); resManager.addResult(date, pop, catchRatePerStrategyMet); - catchPerStrategyMetPerZonePop = - siMatrix.matrixCatchPerStrategyMetPerZone(N, pop, date, catchRatePerStrategyMet); + catchPerStrategyMetPerZonePop = siMatrix + .matrixCatchPerStrategyMetPerZone(N, pop, date, + catchRatePerStrategyMet); } - + popMon.holdCatch(pop, catchPerStrategyMetPerZonePop); resManager.addResult(date, pop, catchPerStrategyMetPerZonePop); - - if (resManager.isEnabled(ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP)) { - MatrixND catchWeightPerStrategyMet = - siMatrix.matrixCatchWeightPerStrategyMetPerZonePop(date, pop, - catchPerStrategyMetPerZonePop); + + if (resManager + .isEnabled(ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP)) { + MatrixND catchWeightPerStrategyMet = siMatrix + .matrixCatchWeightPerStrategyMetPerZonePop(date, pop, + catchPerStrategyMetPerZonePop); resManager.addResult(date, pop, catchWeightPerStrategyMet); } if (isEffortByCell(context)) { - MatrixND catchPerStrategyMetPerZoneMet = - siMatrix.matrixCatchPerStrategyMetPerZoneMet(N, pop, date); + 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); + 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 popMon.setN(pop, abundance); - log.debug("====================== end " + date + " - " + pop +" ==========================="); - + log.debug("====================== end " + date + " - " + pop + + " ==========================="); + } - + /** * @param date * @param resManager - * @throws IsisFishException - * @throws TopiaException + * @throws IsisFishException + * @throws TopiaException */ - private void saveGravityModel(Date date, ResultManager resManager, GravityModel gravityModel) throws IsisFishException, TopiaException { - if (resManager.isEnabled(ResultName.MATRIX_FISHING_TIME_PER_MONTH_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixFishingTimePerMonthPerVessel(date); + private void saveGravityModel(Date date, ResultManager resManager, + GravityModel gravityModel) throws IsisFishException, TopiaException { + if (resManager + .isEnabled(ResultName.MATRIX_FISHING_TIME_PER_MONTH_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixFishingTimePerMonthPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_FUEL_COSTS_OF_TRAVEL_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixFuelCostsOfTravelPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_FUEL_COSTS_OF_TRAVEL_PER_VESSEL)) { + MatrixND mat = gravityModel.matrixFuelCostsOfTravelPerVessel(date); resManager.addResult(date, mat); - } + } if (resManager.isEnabled(ResultName.MATRIX_COSTS_OF_FISHING_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixCostsOfFishingPerVessel(date); + MatrixND mat = gravityModel.matrixCostsOfFishingPerVessel(date); resManager.addResult(date, mat); - } + } if (resManager.isEnabled(ResultName.MATRIX_FUEL_COSTS_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixFuelCostsOfTravelPerVessel(date); + MatrixND mat = gravityModel.matrixFuelCostsOfTravelPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_REPAIR_AND_MAINTENANCE_GEAR_COSTS_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixRepairAndMaintenanceGearCostsPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_REPAIR_AND_MAINTENANCE_GEAR_COSTS_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixRepairAndMaintenanceGearCostsPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_OTHER_RUNNING_COSTS_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixOtherRunningCostsPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_OTHER_RUNNING_COSTS_PER_VESSEL)) { + MatrixND mat = gravityModel.matrixOtherRunningCostsPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_SHARED_NOT_FIXED_COSTS_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixSharedNotFixedCostsPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_SHARED_NOT_FIXED_COSTS_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixSharedNotFixedCostsPerVessel(date); resManager.addResult(date, mat); - } -// if (resManager.isEnabled(ResultName.MATRIX_SHARED_FIXED_COSTS_PER_VESSEL_PER_MET)) { -// MatrixND mat = gravityModel.matrixSharedFixedCostsPerVesselPerMet(date); -// resManager.addResult(date, mat); -// } - if (resManager.isEnabled(ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_SPECIES_PER_STRATEGY_MET)) { - MatrixND mat = gravityModel.matrixGrossValueOfLandingsPerSpeciesPerStrategyMet(date); + } + // if (resManager.isEnabled(ResultName.MATRIX_SHARED_FIXED_COSTS_PER_VESSEL_PER_MET)) { + // MatrixND mat = gravityModel.matrixSharedFixedCostsPerVesselPerMet(date); + // resManager.addResult(date, mat); + // } + if (resManager + .isEnabled(ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_SPECIES_PER_STRATEGY_MET)) { + MatrixND mat = gravityModel + .matrixGrossValueOfLandingsPerSpeciesPerStrategyMet(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET)) { - MatrixND mat = gravityModel.matrixGrossValueOfLandingsPerStrategyMet(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET)) { + MatrixND mat = gravityModel + .matrixGrossValueOfLandingsPerStrategyMet(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixGrossValueOfLandingsPerStrategyMetPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixGrossValueOfLandingsPerStrategyMetPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET)) { - MatrixND mat = gravityModel.matrixNetValueOfLandingsPerStrategyMet(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET)) { + MatrixND mat = gravityModel + .matrixNetValueOfLandingsPerStrategyMet(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixNetValueOfLandingsPerStrategyMetPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixNetValueOfLandingsPerStrategyMetPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_NET_RENEVUE_TO_SHARE_PER_STRATEGY_MET_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixNetRenevueToSharePerStrategyMetPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_NET_RENEVUE_TO_SHARE_PER_STRATEGY_MET_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixNetRenevueToSharePerStrategyMetPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_CREW_SHARE_PER_STRATEGY_MET_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixCrewSharePerStrategyMetPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_CREW_SHARE_PER_STRATEGY_MET_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixCrewSharePerStrategyMetPerVessel(date); resManager.addResult(date, mat); } - if (resManager.isEnabled(ResultName.MATRIX_OWNER_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_MET_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixOwnerMarginOverVariableCostsPerStrategyMetPerVessel(date); + if (resManager + .isEnabled(ResultName.MATRIX_OWNER_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_MET_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixOwnerMarginOverVariableCostsPerStrategyMetPerVessel(date); resManager.addResult(date, mat); } - if (resManager.isEnabled(ResultName.MATRIX_VESSEL_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_MET_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixVesselMarginOverVariableCostsPerStrategyMetPerVessel(date); + if (resManager + .isEnabled(ResultName.MATRIX_VESSEL_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_MET_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixVesselMarginOverVariableCostsPerStrategyMetPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_OWNER_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixOwnerMarginOverVariableCostsPerStrategyPerVessel(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_OWNER_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixOwnerMarginOverVariableCostsPerStrategyPerVessel(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_OWNER_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY)) { - MatrixND mat = gravityModel.matrixOwnerMarginOverVariableCostsPerStrategy(date); + } + if (resManager + .isEnabled(ResultName.MATRIX_OWNER_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY)) { + MatrixND mat = gravityModel + .matrixOwnerMarginOverVariableCostsPerStrategy(date); resManager.addResult(date, mat); - } - if (resManager.isEnabled(ResultName.MATRIX_VESSEL_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_PER_VESSEL)) { - MatrixND mat = gravityModel.matrixVesselMarginOverVariableCostsPerStrategyPerVessel(date); - resManager.addResult(date, mat); } - if (resManager.isEnabled(ResultName.MATRIX_VESSEL_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY)) { - MatrixND mat = gravityModel.matrixVesselMarginOverVariableCostsPerStrategy(date); + if (resManager + .isEnabled(ResultName.MATRIX_VESSEL_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY_PER_VESSEL)) { + MatrixND mat = gravityModel + .matrixVesselMarginOverVariableCostsPerStrategyPerVessel(date); resManager.addResult(date, mat); } + if (resManager + .isEnabled(ResultName.MATRIX_VESSEL_MARGIN_OVER_VARIABLE_COSTS_PER_STRATEGY)) { + MatrixND mat = gravityModel + .matrixVesselMarginOverVariableCostsPerStrategy(date); + resManager.addResult(date, mat); + } } } - -