Author: jcouteau Date: 2009-04-28 13:19:55 +0000 (Tue, 28 Apr 2009) New Revision: 121 Added: trunk/rules/GraviteVPUE1LangEtGrossValueOtherSpeciesECOMOD.java Modified: trunk/exports/SensitivityCapturesWeightReferenceY7.java trunk/exports/SensitivityCapturesWeightRelativeReferenceY10.java trunk/exports/SensitivityCapturesWeightRelativeY4.java trunk/exports/SensitivityCapturesWeightY1.java trunk/rules/GraviteCPUE.java trunk/rules/TACpoids.java trunk/scripts/ResultName.java Log: Commit des scripts modifi?\195?\169s par St?\195?\169phanie adaptation des scripts existants Refactoring des scripts de st?\195?\169phanie (rajouts des @Doc sur les param?\195?\168tres, plus de system.out.println, organize imports et format du code) Modified: trunk/exports/SensitivityCapturesWeightReferenceY7.java =================================================================== --- trunk/exports/SensitivityCapturesWeightReferenceY7.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/exports/SensitivityCapturesWeightReferenceY7.java 2009-04-28 13:19:55 UTC (rev 121) @@ -24,7 +24,7 @@ static private Log log = LogFactory .getLog(SensitivityCapturesWeightReferenceY7.class); - protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP }; + protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET }; @Doc("Population") public Population param_pop; @@ -53,7 +53,7 @@ .getMatrix( new Date(lastDate.getDate() - i), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); capturesWeight += matlastdate.sumAll(); //Get the reference captures Weight of each month of the last year @@ -62,7 +62,7 @@ MatrixND matlastdatereference = referenceResultStorage .getMatrix( new Date(lastDate.getDate() - i), - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET + " " + pop, tx); capturesWeightReference += matlastdatereference.sumAll(); tx.commitTransaction(); Modified: trunk/exports/SensitivityCapturesWeightRelativeReferenceY10.java =================================================================== --- trunk/exports/SensitivityCapturesWeightRelativeReferenceY10.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/exports/SensitivityCapturesWeightRelativeReferenceY10.java 2009-04-28 13:19:55 UTC (rev 121) @@ -25,7 +25,7 @@ static private Log log = LogFactory .getLog(SensitivityCapturesWeightRelativeReferenceY10.class); - protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP }; + protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET }; @Doc("Population") public Population param_pop; @@ -56,7 +56,7 @@ .getMatrix( new Date(lastDate.getDate() - i), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); capturesWeight += matlastdate.sumAll(); //Get the captures Weight of each month of the first year @@ -64,7 +64,7 @@ .getMatrix( new Date(i), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); capturesWeightfirst += matfirstdate.sumAll(); //Get the reference captures Weight of each month of the last year @@ -75,7 +75,7 @@ MatrixND matlastdatereference = referenceResultStorage .getMatrix( new Date(lastDate.getDate() - i), - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET + " " + pop, tx); capturesWeightreference += matlastdatereference.sumAll(); @@ -83,7 +83,7 @@ MatrixND matfirstdatereference = referenceResultStorage .getMatrix( new Date(i), - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET + " " + pop, tx); capturesWeightfirstreference += matfirstdatereference .sumAll(); Modified: trunk/exports/SensitivityCapturesWeightRelativeY4.java =================================================================== --- trunk/exports/SensitivityCapturesWeightRelativeY4.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/exports/SensitivityCapturesWeightRelativeY4.java 2009-04-28 13:19:55 UTC (rev 121) @@ -23,7 +23,7 @@ static private Log log = LogFactory .getLog(SensitivityCapturesWeightRelativeY4.class); - protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP }; + protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET }; @Doc("Population") public Population param_pop; @@ -45,7 +45,7 @@ .getMatrix( new Date(lastDate.getDate() - i), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); capturesWeight += matlastdate.sumAll(); //Get the captures Weight of each month of the first year @@ -53,7 +53,7 @@ .getMatrix( new Date(i), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); capturesWeightfirst += matfirstdate.sumAll(); } Modified: trunk/exports/SensitivityCapturesWeightY1.java =================================================================== --- trunk/exports/SensitivityCapturesWeightY1.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/exports/SensitivityCapturesWeightY1.java 2009-04-28 13:19:55 UTC (rev 121) @@ -23,7 +23,7 @@ static private Log log = LogFactory .getLog(SensitivityCapturesWeightY1.class); - protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP }; + protected String[] necessaryResult = { ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET }; @Doc("Population") public Population param_pop; @@ -44,7 +44,7 @@ .getMatrix( new Date(lastDate.getDate() - i), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); capturesWeight += matlastdate.sumAll(); } Modified: trunk/rules/GraviteCPUE.java =================================================================== --- trunk/rules/GraviteCPUE.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/rules/GraviteCPUE.java 2009-04-28 13:19:55 UTC (rev 121) @@ -57,7 +57,7 @@ // example: // ResultName.MATRIX_BIOMASS, // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP, + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET, ResultName.MATRIX_EFFORT_PER_STRATEGY_MET, }; @@ -186,7 +186,7 @@ MatrixND temp = resultmanager.getMatrix( date.previousYear(), pop, - ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET_PER_ZONE_POP); + ResultName.MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET); // on somme sur les zones temp=temp.sumOverDim(3); // on somme sur les groupes Added: trunk/rules/GraviteVPUE1LangEtGrossValueOtherSpeciesECOMOD.java =================================================================== --- trunk/rules/GraviteVPUE1LangEtGrossValueOtherSpeciesECOMOD.java (rev 0) +++ trunk/rules/GraviteVPUE1LangEtGrossValueOtherSpeciesECOMOD.java 2009-04-28 13:19:55 UTC (rev 121) @@ -0,0 +1,542 @@ +package rules; + +import static org.codelutin.i18n.I18n._; +import static org.codelutin.i18n.I18n.n_; + +import java.io.File; +import java.io.FileReader; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codelutin.math.matrix.MapFunction; +import org.codelutin.math.matrix.MatrixFactory; +import org.codelutin.math.matrix.MatrixND; +import org.codelutin.util.FileUtil; + +import scripts.ResultName; +import scripts.SiMatrix; +import fr.ifremer.isisfish.datastore.ResultStorage; +import fr.ifremer.isisfish.entities.EffortDescription; +import fr.ifremer.isisfish.entities.Metier; +import fr.ifremer.isisfish.entities.Population; +import fr.ifremer.isisfish.entities.Strategy; +import fr.ifremer.isisfish.entities.StrategyMonthInfo; +import fr.ifremer.isisfish.rule.AbstractRule; +import fr.ifremer.isisfish.simulator.SimulationContext; +import fr.ifremer.isisfish.types.Date; +import fr.ifremer.isisfish.types.Month; + +/** + * GraviteVPUE1Anchois.java + * + * Created: 26 aout 2008 + * + * @author anonymous <anonymous@labs.libre-entreprise.org> + * @version $Revision: 1.2 $ + * + * Last update: $Date: 2008-10-23 08:59:38 $ by : $Author: Stephanie $ + */ +public class GraviteVPUE1LangEtGrossValueOtherSpeciesECOMOD extends + AbstractRule { + /** to use log facility, just put in your code: log.info("..."); */ + static private Log log = LogFactory + .getLog(GraviteVPUE1LangEtGrossValueOtherSpeciesECOMOD.class); + + public String param_nomfichier_coeffOthers0 = "Inputs_Langoustine/CoeffOthers_Intercept_Langoustine/CoeffOthersNephrops.csv"; + public String param_nomfichier_coeffOthers1 = "Inputs_Langoustine/CoeffOthers_Intercept_Langoustine/CoeffOthersHake.csv"; + public String param_nomfichier_coeffOthers2 = "Inputs_Langoustine/CoeffOthers_Intercept_Langoustine/CoeffOthersBenthic.csv"; + public boolean param_gravite = false; + // doit �tre � vrai si gravite s'applique sinon la methode calcul uniquement les grossvalue otherspecies + + static final protected String BETA_O = "BetaOthers"; + static final protected String ALPHA_O = "AlphaOthers"; + + protected File CoeffOthers0; + protected File CoeffOthers1; + protected File CoeffOthers2; + + protected MatrixND matrixCoeffOthers; + + protected List<Metier> metiers; + // interdit de faire des set sur les strategies de la map, il faut recuperer les strategies de la date courante + protected Map<String, Strategy> mesStrategies; + + /** stocke la somme des prop initiales [str x month] */ + private MatrixND SommePropInitial = null; + /** + * stocke par strat*met, la derni�re attractivite pour chaque mois [str x + * met x month] + */ + + /** permet de stocker les CPUE nominales [str x met] */ + private MatrixND valuePerUnitOfEffort = null; + + public String[] necessaryResult = { + // put here all necessary result for this rule + // example: + // ResultName.MATRIX_BIOMASS, + // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET, + ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET, + //ResultName.MATRIX_EFFORT_PER_STRATEGY_MET, + ResultName.MATRIX_EFFORT_NOMINAL_PER_STRATEGY_MET, // garder la , + + }; + + public String[] getNecessaryResult() { + return this.necessaryResult; + } + + /** + * Permet d'afficher a l'utilisateur une aide sur la regle. + * + * @return L'aide ou la description de la regle + */ + public String getDescription() throws Exception { + return _("calcule les proportion par m�tier chaque mois en fonction de la VPUE du m�tier l'ann�e pr�c�dante et les gross Values otherSpecies"); + /*"HYPOTHESES GRAVITE" + " attention cette r�gle doit toujours �tre mise avant les mesures de gestion"+ + " si pour un metier Effort (m�tier annee-1,mois) = 0 et propinitiale (m�tier, mois) !=0 (ie m�tier potentiellement pratiqu�), alors "+ + on remet propInitiale pour tous les m�tiers (premiere vue complete pour tous les metiers de la strategie - graviteVPUE1-, une alternative + pourrait �tre de chercher lapremiere ann�e avant ann�e -1 pour laquelle le m�tier, ayant une propInitiale non nulle , aurait une VPUE (metier,mois) non nulle + et recuperer la propStr (metier,mois) pour cette ann�e et on l'affecte ann�e courante - mois, les autres m�tiers se partageant la proportion d'effort restante + en fonction de leur VPUE - graviteVPUE2-, une alternative pourrait etre de chercher la premiere ann�e avant ann�e -1 pour laquelle tous les m�tiers, + ayant une propInitiale non nulle, auraient eu une propStr non nulle, (surement difficile � trouver) - - graviteVPUE3- d'autres hypoth�ses pourraient etre envisag�es) + "*/ + /*Calcul des gross Value Other Species en fonction de l'effort par strategie et par m�tier � date + Avant ann�e 1 (premiere ann�e d'appliaction de Gravit�) - il faut deja faire les calculs des grossValues des autres esp�ces + A partir de l'ann�e 1 : Gravit� s'applique, il faut donc attendre de connaitre l'allocation de l'effort � date (dependant des gross values species et otherspecies � date - 1) + pour pouvoir calculer les grossValueOtherSpecies � date + + */ + } + + /** + * function used to initialise MatrixND to NaN double + */ + private MapFunction nanFunction = new MapFunction() { + public double apply(double value) { + return Double.NaN; + } + }; + + /** + * Appel� au d�marrage de la simulation, cette m�thode permet d'initialiser + * des valeurs + * + * @param simulation + * La simulation pour lequel on utilise cette regle + */ + public void init(SimulationContext context) throws Exception { + Date date = new Date(0); + + List<Strategy> strs = SiMatrix.getSiMatrix(context).getStrategies(date); + List<Metier> metiers = SiMatrix.getSiMatrix(context).getMetiers(date); + List<Month> months = Arrays.asList(Month.MONTH); + + SommePropInitial = MatrixFactory.getInstance().create( + "SommePropInitial", new List[] { strs, months }, + new String[] { "Strategies", "Months" }); + SommePropInitial.map(nanFunction); + + valuePerUnitOfEffort = MatrixFactory.getInstance().create( + "ValuePerUnitOfEffort", new List[] { strs, metiers }, + new String[] { "Strategies", "Metiers" }); + valuePerUnitOfEffort.map(nanFunction); + + for (Strategy str : strs) { + List<Metier> strMetiers = SiMatrix.getSiMatrix(context).getMetiers( + str, date); + List<StrategyMonthInfo> infos = str.getStrategyMonthInfo(); + for (StrategyMonthInfo info : infos) { + double somme = 0; + for (Metier strMetier : strMetiers) { + somme += info.getProportionMetier(strMetier); + } + // FIXME soit on somme pour toutes les str le meme metier; donc pas de notion de str.getName dans la cle + // soit pour une str on somme tous ces metiers (mais ce doit etre 1; donc pas de notion de metier.getName dans la cle + SommePropInitial.setValue(str, info.getMonth(), somme); + } + } + + // load coefficients of relation others file in a matrix + if (param_nomfichier_coeffOthers0 == null + || "".equals(param_nomfichier_coeffOthers0)) { + CoeffOthers0 = FileUtil.getFile(".*.csv", + "fichier 0 csv s�parateur ';'"); + CoeffOthers1 = FileUtil.getFile(".*.csv", + "fichier 1 csv s�parateur ';'"); + CoeffOthers2 = FileUtil.getFile(".*.csv", + "fichier 2 csv s�parateur ';'"); + } else { + CoeffOthers0 = new File(param_nomfichier_coeffOthers0); + CoeffOthers1 = new File(param_nomfichier_coeffOthers1); + CoeffOthers2 = new File(param_nomfichier_coeffOthers2); + } + + // reccuperation des metiers et strategies + SiMatrix siMatrix = SiMatrix.getSiMatrix(context); + List<String> coeffs = Arrays.asList(new String[] { ALPHA_O, BETA_O }); + + // creation de mes strategies qui ne contient pas les espagnols + //mesStrategies = new HashMap<String, Strategy>(); + //for(Strategy str : strs) { + // mesStrategies.put(str.getName(), str); + //} + + MatrixND matCoeffOthers0 = MatrixFactory.getInstance().create( + "matCoeffOthers0", new List[] { metiers, coeffs }, + new String[] { "Metiers", "Coeff" }); + MatrixND matCoeffOthers1 = MatrixFactory.getInstance().create( + "matCoeffOthers1", new List[] { metiers, coeffs }, + new String[] { "Metiers", "Coeff" }); + MatrixND matCoeffOthers2 = MatrixFactory.getInstance().create( + "matCoeffOthers2", new List[] { metiers, coeffs }, + new String[] { "Metiers", "Coeff" }); + + matCoeffOthers0.importCSV(new FileReader(CoeffOthers0), new int[] { 0, + 0 }); + matCoeffOthers1.importCSV(new FileReader(CoeffOthers1), new int[] { 0, + 0 }); + matCoeffOthers2.importCSV(new FileReader(CoeffOthers2), new int[] { 0, + 0 }); + + // captures non simulees + matrixCoeffOthers = MatrixFactory.getInstance().create( + "matrixCoeffOthers", new List[] { strs, metiers, coeffs }, + new String[] { "Strategies", "Metiers", "Coeff" }); + + MatrixND matImport = MatrixFactory.getInstance().create( + new int[] { 14, 2 }); + ; + for (Strategy str : strs) { + log.info("str =" + str.getName()); + for (Metier met : metiers) { + for (String coeff : coeffs) { + if ("NephropsLargeLesSables".equals(str.getName()) + || "NephropsLargeGuilvinec".equals(str.getName()) + || "NephropsIntermediateLesSables".equals(str + .getName()) + || "NephropsIntermediateGuilvinec".equals(str + .getName())) { + matImport = matCoeffOthers0; + } else if ("HakeLargeLesSables".equals(str.getName()) + || "HakeLargeGuilvinec".equals(str.getName()) + || "HakeIntermediateLesSables" + .equals(str.getName()) + || "HakeIntermediateGuilvinec" + .equals(str.getName())) { + matImport = matCoeffOthers1; + } else if ("BenthicLargeLesSables".equals(str.getName()) + || "BenthicLargeGuilvinec".equals(str.getName()) + || "BenthicIntermediateLesSables".equals(str + .getName()) + || "BenthicIntermediateGuilvinec".equals(str + .getName())) { + matImport = matCoeffOthers2; + } + matrixCoeffOthers.setValue(str, met, coeff, matImport + .getValue(met, coeff)); + }// fin de for coeff + }// fin de for met + }// fin de for strategy + log.info("matrixCoeffOthers : " + matrixCoeffOthers); + + } + + /** + * La condition qui doit etre vrai pour faire les actions + * + * @param simulation + * La simulation pour lequel on utilise cette regle + * @return vrai si on souhaite que les actions soit faites + */ + public boolean condition(SimulationContext context, Date date, Metier metier) + throws Exception { + + return true; // on y passe a chaque pas de temps + } + + /** + * Si la condition est vrai alors cette action est execut�e avant le pas de + * temps de la simulation. + * + * @param simulation + * La simulation pour lequel on utilise cette regle + */ + // Booleen permettant que ne boucler que sur un seul metier dans la preaction : + boolean first = true; + + public void preAction(SimulationContext context, Date date, Metier metier) + throws Exception { + if (log.isDebugEnabled()) { + log.debug("first = " + first + "date:" + date); + } + log.info("first = " + first + " ,on passe dans la preaction ?"); + if (first) { // on passe dans preaction pour la premiere fois + + log.info("Oui, preaction : "); + + List<Strategy> strs = SiMatrix.getSiMatrix(context).getStrategies( + date); + List<Population> populations = SiMatrix.getSiMatrix(context) + .getPopulations(date); + List<Metier> metiers = SiMatrix.getSiMatrix(context).getMetiers( + date); + ResultStorage resultmanager = context.getSimulationStorage() + .getResultStorage(); + //on commence par creer une instance de resultats de matrice GrossValuesOtherSpecies + MatrixND GrossValueOtherSpeciesPerStrMet = MatrixFactory + .getInstance() + .create( + ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_OTHER_SPECIES_PER_STRATEGY_MET, + new List[] { strs, metiers }, + new String[] { n_("Strategies"), n_("Metiers") }); + log.info("GrossValueOtherSpeciesPerStrMet initialisee " + + GrossValueOtherSpeciesPerStrMet); + + // si ann�e>=1 alors on fait le calcul des gravit� puis on met � jour les gross value otherspecies + if ((date.getYear() > 0) & (param_gravite == true)) { + ////////Initialisation des matrices qui resultent de la simulation//////////////////////////////////////////////////////////// + log.info("calcul de Gravite"); + //Calcul de l effort nominal par strategy met + MatrixND EffortNominalPerStrMet = null; + EffortNominalPerStrMet = resultmanager.getMatrix(date + .previousYear(), + ResultName.MATRIX_EFFORT_NOMINAL_PER_STRATEGY_MET); + log.info("EffortNominalPerStrMet calculee " + + EffortNominalPerStrMet); + + //on commence par creer une matrice de valeurs (somme sur ttes les especes capturees) par strategie met + MatrixND GrossValuePerStrMet = null; + GrossValuePerStrMet = resultmanager + .getMatrix( + date.previousYear(), + ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET) + .copy(); + log.info("GrossValuePerStrMet calculee " + GrossValuePerStrMet); + + //ajouter pour tous les m�tiers les valeurs li�es qux autres esp�ces calcul�es par modele lineaire + // Boucle sur les strategies de mes strategies + //List <Strategy> mStr = strs; + for (Strategy strIndex : strs) { + // interdit de faire des set sur les strategies de la semantique de la matrice, il faut recuperer les strategies de la date courante + Strategy str = (Strategy) context.getDB().findByTopiaId( + strIndex.getTopiaId()); + + StrategyMonthInfo smi = str.getStrategyMonthInfo(date + .getMonth()); + Collection<EffortDescription> strMet = str + .getSetOfVessels().getPossibleMetiers(); + //2) calcul les valeurs non simulees du mois l ann�e pr�c�dante + for (EffortDescription effort : strMet) { + Metier met = effort.getPossibleMetiers(); + log.info("Boucle metier 1, metier possible: " + + met.getName()); + double eff = EffortNominalPerStrMet.getValue(str, met); + log.info("effort str" + str.getName() + met.getName() + + " : " + eff); + + //GrossValueAutres par strat�gie + // Hypothese 1 = pas de distinction entre les m�tiers n'agira donc pas sur la gravit�) + // Hypothese 2 = a distinguer selon les m�tiers - agira sur la gravit� + // l'hypothese est le resultat des coef dans la matrice en entr�e si tous identiques quelque soit le metier dans la strat�gie alors H1 + // sinon H2 + double valMetOther = matrixCoeffOthers.getValue(str, + met, ALPHA_O) + + matrixCoeffOthers.getValue(str, met, BETA_O) + * eff; + if (valMetOther < 0) { + valMetOther = 0; + } + double valMet = valMetOther + + GrossValuePerStrMet.getValue(str, met); + //log.info("valOtherMetAnchois :"+matrixCoeffOthers.getValue(str,met)*eff); + //log.info("GrossValuePerStrMet avant : "+GrossValuePerStrMet.getValue(str,met)); + GrossValuePerStrMet.setValue(str, met, valMet); + log.info("valOtherMetLangoustine : " + valMet); + log.info("GrossValuePerStrMet apres : " + + GrossValuePerStrMet.getValue(str, met)); + + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + valuePerUnitOfEffort.map(nanFunction); //r�initialisation avant calcul pour date + + for (Strategy str : strs) { + log.info("INFO: Boucle creation valuePerUnitEffort : " + + str.getName()); + //log.info("Boucle creation catchperuniteffort : "+ str.getName()); + StrategyMonthInfo smi = str.getStrategyMonthInfo(date + .getMonth()); + Collection<EffortDescription> strMet = str + .getSetOfVessels().getPossibleMetiers(); + //SiMatrix.getSiMatrix(context).getMetiers(str, date); + + // boucle pour tester s'il existe un metier pour lequel effort(metier)=0 et PropInitiale(metier)=0 (Condition) + boolean testCondition = false; + double somme = 0;//initialisation de la somme des VPUE des metiers de la strategie + for (EffortDescription ed : strMet) { + Metier strMetier = ed.getPossibleMetiers(); + log.info("Pour str=" + str.getName() + " et metier=" + + strMetier.getName()); + double effort = EffortNominalPerStrMet.getValue(str, + strMetier); + // on teste effort pour le calcul des VPUE + // si effort != 0 , valeur/effort + //sinon (effort =0) , deux cas de figure : + // 1. soit propInitiale =0 pour ce m�tier et dans ce cas VPUE =0 et ca ne doit pas impacter le calcul de la gravite pour les autres metiers de str + // 2. soit propInitiale! =0 et dans ce cas, on mettra PropInitiale pour tous les metiers de str + if (effort > 0) {// a pech� au mois, annee-1 + //on recupere la capture tot + double value = GrossValuePerStrMet.getValue(str, + strMetier); + log.info("DEBUG: value : " + value); + log.info("DEBUG: effort : " + effort); + double vpue = value / effort; + valuePerUnitOfEffort.setValue(str, strMetier, vpue); + log.info("value/effort= " + vpue); + somme += value / effort; + } else if ((effort == 0) + & (smi.getProportionMetier(strMetier) == 0)) {// n'a jamais p�che avec ce metier + valuePerUnitOfEffort.setValue(str, strMetier, 0); + log.info("n'a jamais p�che avec ce metier"); + } else {// n'a pas peche au mois, annee -1, mais avait une prop d'effort non nul a l'annee=0 + testCondition = true;// ie somme est incompl�te mais pas grave car on mettra PropInitiale � tous les metiers + log + .info("n'a pas peche au mois, annee -1, mais avait une prop d'effort non nul a l'annee=0"); + } + } + log.info("testCondition pour str" + str.getName() + ":" + + testCondition); + // � partir des VPUE stockees dans valuePerUnitOfEffort, on calcule la gravit� + double newProp = 0; + log + .info("� partir des VPUE stockees dans valuePerUnitOfEffort, on calcule la gravit�"); + if (!testCondition) { + double SommeVPUEstrat = somme; + log.info("SommeVPUEstrat=" + SommeVPUEstrat); + for (EffortDescription ed : strMet) { + Metier strMetier = ed.getPossibleMetiers(); + log.info("PropStrInitiale(metier=" + + strMetier.getName() + ")" + + smi.getProportionMetier(strMetier)); + log + .info("SommePropInitial.getValue(str, date.getMonth()=" + + SommePropInitial.getValue(str, + date.getMonth())); + log + .info("valuePerUnitOfEffort.getValue(str, strMetier)" + + valuePerUnitOfEffort.getValue( + str, strMetier)); + if (SommeVPUEstrat == 0) { + newProp = 0; + } else { + newProp = SommePropInitial.getValue(str, date + .getMonth()) + * valuePerUnitOfEffort.getValue(str, + strMetier) / SommeVPUEstrat; + } + log.info("newProp(metier=" + strMetier.getName() + + ")" + newProp); + smi.setProportionMetier(strMetier, newProp); + log.info("PropStrNouvelle(metier=" + + strMetier.getName() + ")" + + smi.getProportionMetier(strMetier)); + // annee>= 1 calcul des gross Value otherSpecies avec les nouvelles valeurs d'effort calcul�es par gravite + //avec la nouvelle proportion on en d�duit la gross Value of Species de date pour ce str-met + double valMetOtherSpecies = matrixCoeffOthers + .getValue(str, strMetier, ALPHA_O) + + matrixCoeffOthers.getValue(str, + strMetier, BETA_O) * newProp; + //tester si valMetOtherSpecies <= alors mettre � 0 + if (valMetOtherSpecies < 0) { + valMetOtherSpecies = 0; + } + GrossValueOtherSpeciesPerStrMet.setValue(str, + strMetier, valMetOtherSpecies); + log.info("valOtherMetLangoustine : " + + valMetOtherSpecies); + log.info("GrossValuePerStrMet apres : " + + GrossValueOtherSpeciesPerStrMet.getValue( + str, strMetier)); + } + } + // else ie on met propInitiale dans PropStr(str,annee,mois) + // rien n'a faire car au debut de chaque pas de temps, PropStr est par d�faut initialis� � la valeur de la base de donn�es (val initiales) + }//fin de boucle sur strategy + // r�sultats grossvalue otherspecies mis dans le resultManager + resultmanager + .addResult( + date, + ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_OTHER_SPECIES_PER_STRATEGY_MET, + GrossValueOtherSpeciesPerStrMet); + + } else if ((date.getYear() == 0) || (param_gravite == false)) { + //si ann�e==0 alors on ne fait que le calcul des gross value other species + for (Strategy str : strs) { + log.info("INFO: Boucle creation valuePerUnitEffort : " + + str.getName()); + //log.info("Boucle creation catchperuniteffort : "+ str.getName()); + StrategyMonthInfo smi = str.getStrategyMonthInfo(date + .getMonth()); + Collection<EffortDescription> strMet = str + .getSetOfVessels().getPossibleMetiers(); + for (EffortDescription ed : strMet) { + Metier strMetier = ed.getPossibleMetiers(); + log.info("PropStrInitiale(metier=" + + strMetier.getName() + ")" + + smi.getProportionMetier(strMetier)); + double valMetOtherSpecies = matrixCoeffOthers.getValue( + str, strMetier, ALPHA_O) + + matrixCoeffOthers.getValue(str, strMetier, + BETA_O) + * smi.getProportionMetier(strMetier); + //tester si valMetOtherSpecies <= alors mettre � 0 + if (valMetOtherSpecies < 0) { + valMetOtherSpecies = 0; + } + GrossValueOtherSpeciesPerStrMet.setValue(str, + strMetier, valMetOtherSpecies); + log.info("valOtherMetLangoustine : " + + valMetOtherSpecies); + log.info("GrossValuePerStrMet apres : " + + GrossValueOtherSpeciesPerStrMet.getValue(str, + strMetier)); + } + } + // r�sultats grossvalue otherspecies mis dans le resultManager + resultmanager + .addResult( + date, + ResultName.MATRIX_GROSS_VALUE_OF_LANDINGS_OTHER_SPECIES_PER_STRATEGY_MET, + GrossValueOtherSpeciesPerStrMet); + } // fin de calcul pour ann�e ==0 + first = false; + + }// fin de first= true + + if (log.isDebugEnabled()) { + log.debug("fin Gravite CPUEAction avant"); + } + + } + + /** + * Si la condition est vrai alors cette action est execut�e apres le pas de + * temps de la simulation. + * + * @param simulation + * La simulation pour lequel on utilise cette regle + */ + public void postAction(SimulationContext context, Date date, Metier metier) + throws Exception { + first = true; + + } + +} Modified: trunk/rules/TACpoids.java =================================================================== --- trunk/rules/TACpoids.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/rules/TACpoids.java 2009-04-28 13:19:55 UTC (rev 121) @@ -1,21 +1,19 @@ package rules; +import static org.codelutin.i18n.I18n._; + import java.util.HashSet; -import java.util.List; import java.util.Set; -import static org.codelutin.i18n.I18n._; - 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 scripts.ResultName; import scripts.RuleUtil; import scripts.SiMatrix; - +import fr.ifremer.isisfish.datastore.ResultStorage; import fr.ifremer.isisfish.entities.EffortDescription; import fr.ifremer.isisfish.entities.Metier; import fr.ifremer.isisfish.entities.Population; @@ -29,107 +27,119 @@ import fr.ifremer.isisfish.simulator.SimulationContext; import fr.ifremer.isisfish.types.Date; import fr.ifremer.isisfish.types.Month; +import fr.ifremer.isisfish.util.Doc; -import fr.ifremer.isisfish.util.Doc; // pour pouvoir afficher une aide contextuelle (BUG#1605) - /** * TAC.java * * Created: 7 septembre 2006 * * @author anonymous <anonymous@labs.libre-entreprise.org> - * @version $Revision: 1.5 $ + * @version $Revision: 1.3 $ * - * Last update: $Date: 2007-11-20 15:50:09 $ - * by : $Author: bpoussin $ + * Last update: $Date: 290607 $ + * by : $Author: sigrid $ */ /** - * TAC peut-etre utilisé pour les différents TAC, en proportion des effectifs + * TAC peut-etre utilis� pour les diff�rents TAC, en proportion des effectifs * et/ou avec survie ou non. * - * <li>Pour utiliser le tac proportionnel, il faut mettre dans le parametre propTac - * une valeur > 0, le TAC sera alors recalculé a chaque mois de janvier. - * <li>Pour utiliser la survie il faut mettre dans le paramètre propSurvie - * une valeur > 0, automatiquement les suvie seront ajouté aux effectifs - * + * <li>Pour utiliser le tac proportionnel, il faut mettre dans le parametre + * propTac une valeur > 0, le TAC sera alors recalcul� a chaque mois de janvier. + * <li>Pour utiliser la survie il faut mettre dans le param�tre propSurvie une + * valeur > 0, automatiquement les suvie seront ajout� aux effectifs + * */ public class TACpoids extends AbstractRule { /** to use log facility, just put in your code: log.info("..."); */ static private Log log = LogFactory.getLog(TACpoids.class); - @Doc(value="do the doc of param species") + @Doc(value = "do the doc of param species") public Species param_species = null; - @Doc(value="do the doc of param beginDate") + @Doc(value = "do the doc of param beginDate") public Date param_beginDate = new Date(0); - @Doc(value="do the doc of param endDate") - public Date param_endDate = new Date(22); - @Doc(value="do the doc of param propSurvie") + @Doc(value = "do the doc of param endDate") + public Date param_endDate = new Date(90); + @Doc(value = "do the doc of param propSurvie") public double param_propSurvie = 0; - @Doc(value="do the doc of param propTac") + @Doc(value = "do the doc of param propTac") public double param_propTac = 0; - /** TAC in tonne */ - public double param_tacInTons = 0; - + /** TAC in tonnes */ + @Doc(value = "TAC in tons") + public double param_tacInTons = 900; + boolean affectation = false; - - protected String [] necessaryResult = { - // put here all necessary result for this rule - // example: - // ResultName.MATRIX_BIOMASS, - // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET, + + protected String[] necessaryResult = { + // put here all necessary result for this rule + // example: + // ResultName.MATRIX_BIOMASS, + // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET, }; - + /** * @return the necessaryResult */ public String[] getNecessaryResult() { return this.necessaryResult; } - + /** * Permet d'afficher a l'utilisateur une aide sur la regle. + * * @return L'aide ou la description de la regle */ public String getDescription() { - return _("TAC weight in tons.\nIf you want survival discard use propSurvie other than 0.\nIf you wish TAC computed use propTac other than 0."); + return _("TAC weight in tons.\nIf you want survival discard use propSurvie other than 0.\nIf you wish TAC computed as a proportion of the biomass use propTac other than 0."); } - + /** - * Appelé au démarrage de la simulation, cette méthode permet d'initialiser + * Appel� au d�marrage de la simulation, cette m�thode permet d'initialiser * des valeurs - * @param simulation La simulation pour lequel on utilise cette regle + * + * @param simulation + * La simulation pour lequel on utilise cette regle */ - public void init(SimulationContext context) throws Exception { + public void init(SimulationContext context) throws Exception { } - + /** * La condition qui doit etre vrai pour faire les actions - * @param simulation La simulation pour lequel on utilise cette regle + * + * @param simulation + * La simulation pour lequel on utilise cette regle * @return vrai si on souhaite que les actions soit faites */ - public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception { + public boolean condition(SimulationContext context, Date date, Metier metier) + throws Exception { + + log.info("test si TAC atteint"); // read species in current session - param_species = (Species)context.getDB().findByTopiaId(param_species.getTopiaId()); - - // on fait le calcul du tac si nécessaire - if (param_propTac > 0 && date.getMonth().equals(Month.JANUARY)){ + param_species = (Species) context.getDB().findByTopiaId( + param_species.getTopiaId()); + + // on fait le calcul du tac si n�cessaire + if (param_propTac > 0 && date.getMonth().equals(Month.JANUARY)) { PopulationMonitor popMon = context.getPopulationMonitor(); param_tacInTons = popMon.getBiomass(param_species) * param_propTac; - } - + } + boolean result = false; - if(date.before(param_beginDate)) { + if (date.before(param_beginDate)) { result = false; - } else if(date.after(param_endDate)) { - result = false; + } else if (date.after(param_endDate)) { + result = false; } else { - TargetSpecies ts = metier.getMetierSeasonInfo(date.getMonth()).getSpeciesTargetSpecies(param_species); + TargetSpecies ts = metier.getMetierSeasonInfo(date.getMonth()) + .getSpeciesTargetSpecies(param_species); if (ts != null) { - double catchTons = RuleUtil.getTotalCatchTons(context, param_species, date); - log.info("[TAC] catchTons = " + catchTons + " >= param_tacInTons:" + param_tacInTons ); + double catchTons = RuleUtil.getTotalCatchTons(context, + param_species, date); + log.info("[TAC] catchTons = " + catchTons + + " >= param_tacInTons:" + param_tacInTons); if (catchTons >= param_tacInTons) { result = true; } @@ -137,39 +147,47 @@ } return result; } - + /** - * Si la condition est vrai alors cette action est executée avant le pas - * de temps de la simulation. - * @param simulation La simulation pour lequel on utilise cette regle + * Si la condition est vrai alors cette action est execut�e avant le pas de + * temps de la simulation. + * + * @param simulation + * La simulation pour lequel on utilise cette regle */ - public void preAction(SimulationContext context, Date date, Metier metier) throws Exception { + public void preAction(SimulationContext context, Date date, Metier metier) + throws Exception { affectation = false; + log.info("[TAC] preAction for: " + metier); - - TargetSpecies ts = metier.getMetierSeasonInfo(date.getMonth()).getSpeciesTargetSpecies(param_species); - if(ts != null && ts.getPrimaryCatch()) { + log.info(" TAC atteint [TAC] preAction for: " + metier); + TargetSpecies ts = metier.getMetierSeasonInfo(date.getMonth()) + .getSpeciesTargetSpecies(param_species); + if (ts != null && ts.getPrimaryCatch()) { // recupere tous les metiers qui ont l'espece en capture principale =>metiers vises - List<Metier> aimedMetiers = context.getDB().find("select distinct(metierSeasonInfo.metier) " + - "from fr.ifremer.isisfish.entities.TargetSpecies " + - "where species=? and primaryCatch=true", param_species); + // aimedMetiers ne fonctionne pas je ne sais pas pourquoi ! mais au final forbiddenMetier aura le meme effet + /*List<Metier> aimedMetiers = context.getDB().find("select distinct(metierSeasonInfo.metier) " + + "from fr.ifremer.isisfish.entities.TargetSpecies" + + "where species=? and primaryCatch=true", param_species); - log.info("aimed Metier: " + aimedMetiers); + log.info("aimed Metier: " + aimedMetiers);*/ context.getMetierMonitor().addforbiddenMetier(metier); - - //récupere toutes les stratégies pratiquant le métier et pour lesquelles la proportion !=0 + + //r�cupere toutes les strat�gies pratiquant le m�tier et pour lesquelles la proportion !=0 SiMatrix siMatrix = SiMatrix.getSiMatrix(context); Set<Strategy> strs = new HashSet<Strategy>(); for (Strategy str : siMatrix.getStrategies(date)) { - double prop = str.getStrategyMonthInfo(date.getMonth()).getProportionMetier(metier); + double prop = str.getStrategyMonthInfo(date.getMonth()) + .getProportionMetier(metier); if (prop != 0) { strs.add(str); } } - - for (Strategy str : strs){ - StrategyMonthInfo smi = str.getStrategyMonthInfo(date.getMonth()); - + + for (Strategy str : strs) { + StrategyMonthInfo smi = str.getStrategyMonthInfo(date + .getMonth()); + // 1er cas de figure: l'effort est reporte sur un metier de la // meme strategie, n'ayant pas l'espece comme capture principale // et pechant avec le meme engin @@ -181,35 +199,38 @@ // sans consideration sur les engins, et pour lesquels la // proportion peut etre nulle Set<Metier> possibleMetierCase3 = new HashSet<Metier>(); - - for (EffortDescription effort : str.getSetOfVessels().getPossibleMetiers()) { + + for (EffortDescription effort : str.getSetOfVessels() + .getPossibleMetiers()) { Metier newMetier = effort.getPossibleMetiers(); if ( - !aimedMetiers.contains(newMetier) - && !metier.getName().equalsIgnoreCase("nonActiviy") + /*!aimedMetiers.contains(newMetier) + &&*/!metier.getName().equalsIgnoreCase("nonActiviy") && !metier.getName().equalsIgnoreCase("nonActivie") - && !context.getMetierMonitor().getForbiddenMetier().contains(newMetier) - ) { + && !metier.getName().equalsIgnoreCase( + "non Activit�") + && !context.getMetierMonitor().getForbiddenMetier() + .contains(newMetier)) { possibleMetierCase3.add(newMetier); - + if (smi.getProportionMetier(newMetier) != 0) { possibleMetierCase2.add(newMetier); - + if (metier.getGear().equals(newMetier.getGear())) { possibleMetierCase1.add(newMetier); } } } } - + Set<Metier> possibleMetier = null; - if (possibleMetierCase1.size() != 0){ + if (possibleMetierCase1.size() != 0) { log.info("[TAC] Use case 1"); possibleMetier = possibleMetierCase1; } else if (possibleMetierCase2.size() != 0) { log.info("[TAC] Use case 2"); possibleMetier = possibleMetierCase2; - } else if (possibleMetierCase3.size() != 0){ + } else if (possibleMetierCase3.size() != 0) { log.info("[TAC] Use case 3"); possibleMetier = possibleMetierCase3; } @@ -219,46 +240,52 @@ // possibles dans la meme strategie si un metier possible existe // bien la repartion est proportionnelle a l'effort deja alloue // dans la strategie - - double somme=0; - for (Metier met : possibleMetierCase1) { + + double somme = 0; + for (Metier met : possibleMetier) { somme += smi.getProportionMetier(met); } - for (Metier met : possibleMetierCase1) { - double newProportion = - smi.getProportionMetier(met) - + (smi.getProportionMetier(metier) - * smi.getProportionMetier(met) / somme); + for (Metier met : possibleMetier) { + double newProportion = smi.getProportionMetier(met) + + (smi.getProportionMetier(metier) + * smi.getProportionMetier(met) / somme); smi.setProportionMetier(met, newProportion); } - smi.setProportionMetier(metier, 0); //le metier vise a alors une proportion nulle - } else{ + smi.setProportionMetier(metier, 0); //le metier vise a alors une proportion nulle + log.info("[TAC] il y a des metiers possibles"); + } else { log.info("[TAC] Use no activity"); - + // sinon on met tout dans le metier nonActivite MetierMonitor metierMon = context.getMetierMonitor(); MatrixND mat = metierMon.getOrCreateNoActivity(date, - ResultName.MATRIX_NO_ACTIVITY, - siMatrix.getStrategies(date), - siMatrix.getMetiers(date)); + ResultName.MATRIX_NO_ACTIVITY, siMatrix + .getStrategies(date), siMatrix + .getMetiers(date)); mat.setValue(str, metier, smi.getProportionMetier(metier)); - + smi.getProportionMetier().setValue(metier, 0); - } + } } } } - + /** - * Si la condition est vrai alors cette action est executée apres le pas - * de temps de la simulation. - * @param simulation La simulation pour lequel on utilise cette regle + * Si la condition est vrai alors cette action est execut�e apres le pas de + * temps de la simulation. + * + * @param simulation + * La simulation pour lequel on utilise cette regle */ - public void postAction(SimulationContext context, Date date, Metier metier) throws Exception { + public void postAction(SimulationContext context, Date date, Metier metier) + throws Exception { + ResultStorage resultmanager = context.getSimulationStorage() + .getResultStorage(); log.info("[TAC] postAction for: " + metier); - TargetSpecies ts = metier.getMetierSeasonInfo(date.getMonth()).getSpeciesTargetSpecies(param_species); - if(ts != null){ - if (!affectation){ + TargetSpecies ts = metier.getMetierSeasonInfo(date.getMonth()) + .getSpeciesTargetSpecies(param_species); + if (ts != null) { + if (!affectation) { // ATTENTION // les captures pour cette metapop ne sont plus du qu'au metier // pour qui l'espece est secondaire: elles sont affectees aux @@ -270,36 +297,46 @@ // pour les captures) ////// PopulationMonitor popMon = context.getPopulationMonitor(); + log.info("popMon biomass" + popMon.getBiomass(param_species)); for (Population pop : param_species.getPopulation()) { - // si on a deja une matrice rejet on le vide (elle vient - // forcement de la regle taille minimale or si le tac est - // atteint, tout va dorenavent dans les rejets et on mais - // TOUTES les captures dans les rejets - MatrixND discard = popMon.getDiscard(date, pop); - if (discard != null) { - discard.mults(0); - } - - discard = popMon.getCatch(pop).copy(); - discard.setName(ResultName.MATRIX_DISCARDS_PER_STR_MET_PER_ZONE_POP); - popMon.addDiscard(date, pop, discard); - log.info("[TAC] add discard for " + pop + ": " + discard); - - if (param_propSurvie > 0) { - MatrixND eff = popMon.getN(pop); - //on réajoute les survivants aux effectifs - for (MatrixIterator i=discard.iterator(); i.next();){ - Object [] coord = i.getSemanticsCoordinates(); - eff.setValue(coord[2],coord[3], - eff.getValue(coord[2],coord[3])+i.getValue()*param_propSurvie); + if (!pop.getName().equals("Population_new")) { + log.info("pop : " + pop.getName()); + // si on a deja une matrice rejet on le vide (elle vient + // forcement de la regle taille minimale or si le tac est + // atteint, tout va dorenavent dans les rejets et on mais + // TOUTES les captures dans les rejets + MatrixND discard = popMon.getDiscard(date, pop); + log.info("discard : " + discard); + if (discard != null) { + discard.mults(0); } + log.info("catch = " + popMon.getCatch(pop)); + discard = popMon.getCatch(pop).copy(); + // ca ne doit pas pouvoir marcher car MATRIX_DISCARDS_PER_STR_MET est de dimension pop groupe str met - et discard n'a plus la dimension pop + discard.setName(ResultName.MATRIX_DISCARDS_PER_STR_MET); + popMon.addDiscard(date, pop, discard); + log.info("[TAC] add discard for " + pop + ": " + + discard); + // ne manquerait-il pas + resultmanager.addResult(date, pop, discard); + if (param_propSurvie > 0) { + MatrixND eff = popMon.getN(pop); + //on r�ajoute les survivants aux effectifs + for (MatrixIterator i = discard.iterator(); i + .next();) { + Object[] coord = i.getSemanticsCoordinates(); + eff.setValue(coord[2], coord[3], eff.getValue( + coord[2], coord[3]) + + i.getValue() * param_propSurvie); + } + } + } + // on a affecte une fois cette meta pop au rejet il ne faut pas + // le refaire + affectation = true; } - - // on a affecte une fois cette meta pop au rejet il ne faut pas - // le refaire - affectation=true; } } } Modified: trunk/scripts/ResultName.java =================================================================== --- trunk/scripts/ResultName.java 2009-04-22 16:32:05 UTC (rev 120) +++ trunk/scripts/ResultName.java 2009-04-28 13:19:55 UTC (rev 121) @@ -1,6 +1,6 @@ /* *##% * Copyright (C) 2006 - * Code Lutin, Cédric Pineau, Benjamin Poussin + * 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 @@ -20,7 +20,7 @@ /* * * ResultName.java * - * Created: 23 août 2006 15:09:37 + * Created: 23 ao�t 2006 15:09:37 * * @author poussin * @version $Revision: 1.10 $ @@ -37,54 +37,48 @@ /** * Contient l'ensemble des noms des differents resultats. Le mieux lorsque l'on - * veut un nouveau résultat est d'ajouter une constante ici, et de l'utiliser - * ensuite lors de la création de la matrice. + * veut un nouveau r�sultat est d'ajouter une constante ici, et de l'utiliser + * ensuite lors de la cr�ation de la matrice. * <p> - * Ceci permet d'avoir un endroit unique ou l'on voit l'ensemble des résultats - * potentiellement disponible et de ne pas ce tromper en écrivent le nom - * d'un résultat + * Ceci permet d'avoir un endroit unique ou l'on voit l'ensemble des r�sultats + * potentiellement disponible et de ne pas ce tromper en �crivent le nom + * d'un r�sultat * <p> * Cette classe ne doit contenir que des noms de resultat en static public String * l'interface de lancement de simulation se base sur cette classe pour - * afficher l'ensemble des résultats disponible + * afficher l'ensemble des r�sultats disponible * * @author poussin */ public class ResultName { @Doc(value = "do the doc of Result matrixDiscardsWeightPerStrMet") - static final public String MATRIX_DISCARDS_WEIGHT_PER_STR_MET_PER_ZONE_POP = n_("matrixDiscardsWeightPerStrMet"); + static final public String MATRIX_DISCARDS_WEIGHT_PER_STR_MET = n_("matrixDiscardsWeightPerStrMet"); @Doc(value = "do the doc of Result matrixDiscardsPerStrMet") - static final public String MATRIX_DISCARDS_PER_STR_MET_PER_ZONE_POP = n_("matrixDiscardsPerStrMet"); + static final public String MATRIX_DISCARDS_PER_STR_MET = n_("matrixDiscardsPerStrMet"); @Doc(value = "do the doc of Result matrixLandingPerMet") static final public String MATRIX_LANDING_PER_MET = n_("matrixLandingPerMet"); @Doc(value = "do the doc of Result matrixEffortPerStrategyMet") static final public String MATRIX_EFFORT_PER_STRATEGY_MET = n_("matrixEffortPerStrategyMet"); + @Doc(value = "do the doc of Result matrixEffortNominalPerStrategyMet") + static final public String MATRIX_EFFORT_NOMINAL_PER_STRATEGY_MET = n_("matrixEffortNominalPerStrategyMet"); @Doc(value = "do the doc of Result matrixStdTravelEffortPerStrategyMet") 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") - static final public String MATRIX_CATCH_PER_STRATEGY_MET_PER_ZONE_POP = n_("matrixCatchPerStrategyMetPerZonePop"); - @Doc(value = "do the doc of Result matrixCatchWeightPerStrategyMetPerZoneMet") - 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") + @Doc(value = "do the doc of Result matrixCatchRatePerStrategyMet") + static final public String MATRIX_CATCH_RATE_PER_STRATEGY_MET = n_("matrixCatchRatePerStrategyMet"); + @Doc(value = "do the doc of Result matrixCatchPerStrategyMet") + static final public String MATRIX_CATCH_PER_STRATEGY_MET = n_("matrixCatchPerStrategyMet"); + @Doc(value = "do the doc of Result matrixFishingMortality") static final public String MATRIX_FISHING_MORTALITY = n_("matrixFishingMortality"); + @Doc(value = "do the doc of Result matrixCatchWeightPerStrategyMet") + static final public String MATRIX_CATCH_WEIGHT_PER_STRATEGY_MET = n_("matrixCatchWeightPerStrategyMet"); @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"); @@ -105,6 +99,8 @@ static final public String MATRIX_GROSS_VALUE_OF_LANDINGS_PER_SPECIES_PER_STRATEGY_MET = n_("matrixGrossValueOfLandingsPerSpeciesPerStrategyMet"); @Doc(value = "do the doc of Result matrixGrossValueOfLandingsPerStrategyMet") static final public String MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET = n_("matrixGrossValueOfLandingsPerStrategyMet"); + @Doc(value = "do the doc of Result matrixGrossValueOfLandingsOtherSpeciesPerStrategyMet") + static final public String MATRIX_GROSS_VALUE_OF_LANDINGS_OTHER_SPECIES_PER_STRATEGY_MET = n_("matrixGrossValueOfLandingsOtherSpeciesPerStrategyMet"); @Doc(value = "do the doc of Result matrixGrossValueOfLandingsPerStrategyMetPerVessel") static final public String MATRIX_GROSS_VALUE_OF_LANDINGS_PER_STRATEGY_MET_PER_VESSEL = n_("matrixGrossValueOfLandingsPerStrategyMetPerVessel"); @Doc(value = "do the doc of Result matrixNetValueOfLandingsPerStrategyMet")