Commit 4200adf9 authored by pfreon's avatar pfreon
Browse files

Major changes on reordering of questions, additional warnings + minor changes

Arbre-decison.csv + TexteRegle.java + QuestionReponse.java: Reordering of the first questions.
QuestionReponse: Addition of a warning when the number of exploited year-classes is >8 (and reduction of the range of choice offered for this variable).

Changes in Global.java related to the previous comimit on stock-structure (metapopulation), + changes in the titles of the graphs (main and axes).
Addition of a Fake data file .CLI with 13 years of observation.

Cadre_ModeleDirect. Java:  Addition of a warning when the number of exploited year-classes is >8 (and reduction of the range of choice offered for this variable) consistent with QuestionReponse.java. Addition of error messages when there are inconstancies in the values of ages (begining, end of environmental influence, number of exploited year-classes).

Model.java: Addition of a warning when the number of df of the model is <10 (in addtion to <12). Changement mineurs de titres de graphiques (weighted, etc.) et rajout de commentaires.
parent 028fdd80
Years;Production;Effort;Environment
1985.000000;284441.000000; 82.700000; 0.9
1986.000000; 223432.000000; 84.300000; 1.0
1987.000000; 149161.000000; 58.900000; 1.025
1988.000000; 189166.000000; 78.300000; 1.07
1989.000000; 149672.000000; 65.100000; 1.02
1990.000000; 87206.000000; 35.500000; 0.975
1991.000000; 87690.000000; 33.600000; 1.30000
1992.000000; 31912.000000; 11.400000; 0.17500
1993.000000; 35864.000000; 8.900000; 0.97500
1994.000000; 61097.000000; 11.700000; 0.6250000
1995.000000; 59383.000000; 10.300000; 2.0000
1996.000000; 56867.000000; 19.300000; 1.22500
1997.0;70000.0;120.0;1.5
......@@ -75,8 +75,7 @@ public class Cadre_ModeleDirect extends JFrame {
try {
nbFit = 0;
initWindow();
UtilCadre.Size(this, 35, 40); // 80, 85 -> 35, 40 Facteur de réduction fenetre "Fit a model directly" Test 2020
System.out.println("Définition dans ligne 78 de Cadre_ModeleDirect.java des Facteurs de réduction (60, 55) (JFrame) par rapport à max (sx et sy ligne 73 UtilCadre.java");// Test 2020
UtilCadre.Size(this, 60, 65); // 80, 85 -> 35, 40 Facteur de réduction fenetre "Fit a model directly" Test 2020
UtilCadre.Centrer(this);
} catch (Exception e) {
e.printStackTrace();
......@@ -322,15 +321,19 @@ public class Cadre_ModeleDirect extends JFrame {
});
chkE.setSelected(true);
/*ejecutar al abrir la ventana*/
/*Gestion message dans cadre de droite de "Current known facts" de fenêtre principale
lors de selection directe de modeles. Attribution de valeurs aux variables environmental_influence
et effort_preponderant en fonction du type de modèle selectioné.
ejecutar al abrir la ventana.
*/
displayList(RechercheModele.getlisteModele(0));
EnvironmentsetEnabled(false);
Global.environmental_influence = Global.influenceEnv[0];
Global.effort_preponderant = 1;
/*fin ejecutar*/
}
void chkE_actionPerformed(ActionEvent e) {
displayList(RechercheModele.getlisteModele(0));
EnvironmentsetEnabled(false);
......@@ -528,6 +531,7 @@ private void displayList(String[] liste) {
}
void cmdFit_actionPerformed(ActionEvent e) {
try {
MsgDialogBox msg;
if (jlstChoix.getSelectedIndex() == -1) {
msg = new MsgDialogBox(0, "Please, you have to select\n a model", 0, Global.CadreMain);
......@@ -561,6 +565,22 @@ private void displayList(String[] liste) {
Global.begin_influence_period = jcboBegining.getSelectedIndex();
Global.end_influence_period = jcboEnd.getSelectedIndex();
}
//System.out.println("Global.recruitment_age: " + Global.recruitment_age + "Global.nb_classes_exploitees: " + Global.nb_classes_exploitees + " Global.begin_influence_period: " + Global.begin_influence_period + "Global.end_influence_period: " + Global.end_influence_period);
if (Global.nb_classes_exploitees > 8) {
throw new OnError("WARNING! \nA stock with too many significantly exploited year-classes is not a situation compatible with the use of \nsurplus production models that make use of the transition prediction approach (past-effort-averaging) of \nFox (1975). This method is used in CLIMPROD to fit data on non-equilibrium conditions. It simulates the \nequilibrium by using a weighted average of fishing effort (E). \nIf interanual variability of E is too large, the results are likely to be uncertain.");
}
if (Global.end_influence_period < Global.begin_influence_period) {
throw new OnError("Age at the end of environmental influence must be larger than or equal to \nage at the begining of environmental influence. \nPlease modify your selection(s)");
}
if (Global.begin_influence_period > (Global.recruitment_age + Global.nb_classes_exploitees)) {
throw new OnError("If the age at the begining of environmental influence occurs \nafter the age of the last exploited year class \n(that is age at recruitment + number of significantly exploited year classes - 1) \nthen there is no point in using a model incorporating an environmental variable. \nPlease modify your age selection(s)");
}
if (Global.end_influence_period > (Global.recruitment_age + Global.nb_classes_exploitees)) {
throw new OnError("If the age at the end of environmental influence occurs \nafter the age of the last exploited year class \n(that is age at recruitment + number of significantly exploited year classes - 1) \nthen only its influence on exploited year classes will be taken into account.");
}
} catch (Exception ee) {
new MsgDialogBox(0, ee.getMessage(), 0, Global.CadreMain);
}
Global.numero_modele = RechercheModele.getNumero();
Global.typeModele = RechercheModele.getType();
Modele.Estimer();
......
/**
* Titre : Climprod<p>
* Classe statique qui regroupe l'ensemble des variables globales
*
* Classe statique qui regroupe l'ensemble des variables globales avec en
* commentaire les questions correspondantes lorsque relevant.
* Donne les titres de certains graphiques et les appelle.
* Calcul du test de Fisher.
* @version 1.0
*/
package fr.ird.climprod;
......@@ -33,7 +35,7 @@ public class Global {
static boolean range_data; // Does the relative range of observed value<0.4
static int changement_exploitation; // Have there been changes in the fishing pattern during the period (effort allocation, quota, mesh-size ...)
static int sous_stock; // Does the data-set apply to a sub-stock
static int metapopulation; // Does the data-set apply to a sub-stock
static int stock_unique; // Does the data-set apply to a single stock
static int stock_divise; // Is the single stock subdivided into various geographical sub-stocks (all must be exploited by the fleet)
static int unite_standardisee; // Is the fishing effort unit standardized and is the CPUE proportional to abundance
......@@ -113,17 +115,17 @@ public class Global {
static double critereAIC; //Akeike
static boolean validationOk; // true si Validation ex�cut�e
static boolean modelisationOk; // true si mod�le ajust�
static int Compteur_erreurs_Jackknife;
static int[] Nb_years_lower100;
static int [] Nb_years_greater100;
static String Texte_erreur_jackknife$;
static int Compteur_erreurs_Jackknife; // Rajout 2020.
static int[] Nb_years_lower100; // Rajout 2020.
static int [] Nb_years_greater100; // Rajout 2020.
static String Texte_erreur_jackknife$; // Rajout 2020.
/**
* *********** Plots ************************
*/
//static int[] typePlot = {2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 2,2,2,2,2};
//static Hashtable htPlot=new Hashtable();
static String[] titreG = {"E Time Plot", "V Time Plot", "Y Time Plot", "CPUE Time Plot", "E Distribution", "V Distribution", "Y Distribution", "CPUE Distribution", "Y versus E", "Y versus V", " CPUE versus E ", "CPUE versus V", "E versus V", "Observed and Fitted CPUE", "Time Plot of residual CPUE", "Residual CPUE versus E", "Residual CPUE versus V", "a (%) Time Plot", " b (%) Time Plot", "c (%) Time Plot", "d (%) Time", "Plot R2 (% of %) Time Plot", "Function Y versus V & E", "Function Y versus V & E", "Function CPUE versus V & E", "Function CPUE versus V & E", "MSY versus V", "MS-E versus V"};
static String[] titreSx = {"Year", "Year", "Year", "Year", "Classes", "Classes", "Classes", "Classes", "Effort (E)", "Environment (V)", "Effort (E)", "Environment (V)", "Environment (V)", "Year", "Year", "Effort (E)", "Environment (V)", "Year", "Year", " Year", "Year", "Year", "Effort (E)", "Effort (E)", "Effort (E)", " Effort (E)", "Environment (V)", "Environment (V)"};
static String[] titreG = {"E Time Plot", "V Time Plot", "Y Time Plot", "CPUE Time Plot", "E Distribution", "V Distribution", "Y Distribution", "CPUE Distribution", "Y vs E (unlagged)", "Y vs V (unlagged)", "CPUE vs E (unlagged)", "CPUE vs V (unlagged)", "CPUE versus E (E weighted if relevant)", "CPUE versus V (V lagged if relevant)","E versus V (unlagged)", "Observed and Fitted CPUE (lag effect if relevant)", "Time Plot of residual CPUE (lag effect if relevant)", "Residual CPUE versus E (E weighted if relevant)", "Residual CPUE versus V (V lagged and weighted if relevant)", "a (%) Time Plot (lag effect if relevant)", " b (%) Time Plot (lag effect if relevant)", "c (%) Time Plot (lag effect if relevant)", "d (%) Time Plot (lag effect if relevant)", "Plot R2 (% of %) Time Plot", "Function Y versus V & E (lagged if relevant)", "Function Y versus V & E (E weighted if relevant)", "Function CPUE versus V & E (E weighted if relevant)", "Function CPUE versus V & E (E weighted if relevant)", "MSY versus V", "MS-E versus V"};
static String[] titreSx = {"Year", "Year", "Year", "Year", "Classes", "Classes", "Classes", "Classes", "Effort (E)", "Environment (V)", "Effort (E)", "Environment (V)", "Environment (V)", "Year", "Year", "Effort (E)", "Environment (V)", "Year", "Year", " Year", "Year", "Year", "Weighted effort (E)", "Weighted effort (E)", "Weighted effort (E)", " Weighted effort (E)", "Environment (V)", "Environment (V)"};
static String[] titreSy = {"Effort (E)", "Environment (V)", "Production (Y)", "CPUE ", "Nb", "Nb", "Nb", "Nb", "Production (Y)", "Production (Y)", "CPUE", "CPUE", "CPUE", "CPUE", " Residual", "Residual", "Residual", "a (%)", "b (%)", "c (%)", "d (%)", "R² (%)", "Production (Y)", "Production (Y)", "CPUE", "CPUE", "MSY", "MS-E"};
static Plot[] timePlot = new Plot[4];
......@@ -176,11 +178,11 @@ public class Global {
CadreMSPlots.dispose();
}
range_data = false; // Does the relative range of observed value<0.4
range_data = false; // Does the relative range of observed value<0.4
changement_exploitation = -1; // Have there been changes in the fishing pattern during the period (effort allocation, quota, mesh-size ...)
sous_stock = -1; // Does the data-set apply to a sub-stock
metapopulation = -1; // Does the data-set applies to a metapopulation?
stock_unique = -1; // Does the data-set apply to a single stock
stock_divise = -1; // Is the single stock subdivided into various geographical sub-stocks (all must be exploited by the fleet)
// stock_divise = -1; // Supprimé en 2020 car redondant avec metapopulation. La variable metapopulation est utilisée en remplacement dans les règles concernées. Is the single stock subdivided into various geographical sub-stocks (all must be exploited by the fleet)
unite_standardisee = -1; // Is the fishing effort unit standardized and is the CPUE proportional to abundance
effet_delais_abundance_negligeable = -1; // Do time-lags and deviations from the stable age structure have negligible effects on production rate
......
/**
* Titre : Climprod<p>
*
* Appelle et lance les graphiques serie, bivariees et histogramme pour réponse à questions graphiques
* au debut des questions du menu "Select the appropriate model and fit it".
* Lances ces graphiques
* Ajuste un modèle par l'algorithme de Marquart
*
*/
package fr.ird.climprod;
......@@ -10,7 +13,6 @@ import java.text.DecimalFormat;
import java.awt.Color;
public class Modele {
static final private int nparmax = 4;
static final private int maxrit = 100;
......@@ -52,15 +54,25 @@ public class Modele {
nim = Data.getNbDataRetenue();
// System.out.println("nim= " +nim);
if (nim < 12) {
if (nim < 10) {
message
= "WARNING! few d.f. in the fit due to lags. Owing to " + Global.nb_classes_exploitees + " annual lags included in the model,\nonly " + nim + " years are used for ";
= "WARNING! \nToo few d.f. in the fit due to the incorporation of lags. Owing to " + Global.nb_classes_exploitees + " annual lags included in the model, only " + nim + " pairs ";
message = message
+ "\nor triplet of values are used for fitting, which does not give enough degrees of freedom to the model.\nResults will be poor.\n";
message = message
+ "It is strongly recommanded that yoy stop her the procedure.";
MsgDialogBox msg = new MsgDialogBox(0, message, 1, Global.CadreMain);
}
else
{message = "";
message = "WARNING! \nFew d.f. in the fit due to the incorporation of lags. Owing to " + Global.nb_classes_exploitees + " annual lags included in the model, only " + nim + " pairs ";
message = message
+ "fitting, which does not give enough degrees of freedom to the model.\nResults will be poor.\n";
+ "\nor triplet of values are used for fitting, which does not give enough degrees of freedom to the model.\nResults will be poor.\n";
message = message
+ "Despite this limitation I shall continue fitting.";
MsgDialogBox msg = new MsgDialogBox(0, message, 1, Global.CadreMain);
}
}
f = Data.getF();
v = Data.getV();
vbar = Data.getVbar();
......@@ -71,7 +83,7 @@ public class Modele {
//calc_var();
calcul_val_init();
for (int i = 0; i < nbre_par; i++) {
par_init[i] = par_alors[i];
par_init[i] = par_alors[i]; // Nombre de parametre pour une estimation des valeurs initiales du modèle simplifié initial (sans constante) avant ajustement du modèle final incluant une constante. Comment. 2020
}
// System.out.println( "Avant marquard");
// for(int i=0;i<nbre_par;i++)System.out.print( par_alors[i]+" ");
......@@ -131,7 +143,7 @@ public class Modele {
switch (Global.numero_modele) {
case 0:
nbre_par = 2;
nbre_par = 2; // Modèle Schaefer CPUE=a+b.E. Commentaire 2020
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
ptmp[1] = f[k];
......@@ -141,19 +153,19 @@ public class Modele {
//inverse_gauss(nbre_par,covar,par_alors,covpy);
inverse_gauss();
break;
case 1:
case 1: // Modèle de Fox (exponentiel). CPUE=a.exp(b.E)CPUE=a.exp(b.E). Commentaire 2020
nbre_par = 2;
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
ptmp[1] = f[k];
yy = Math.log(pue[k]);
yy = Math.log(pue[k]); // Transformation log de CPUE. Commentaire 2020
itercov();
}
inverse_gauss();
//inverse_gauss(nbre_par,covar,par_alors,covpy);
par_alors[0] = Math.exp(par_alors[0]);
par_alors[0] = Math.exp(par_alors[0]); // Transformation exp. de paramètre a Commentaire 2020
break;
case 2:
case 2: // CPUE=a+b.V. Commentaire 2020
nbre_par = 2;
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
......@@ -163,18 +175,18 @@ public class Modele {
}
inverse_gauss();
break;
case 3:
case 3: // CPUE=a.V^b. Commentaire 2020
nbre_par = 2;
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
ptmp[1] = Math.log(vbar[k]);
ptmp[1] = Math.log(vbar[k]); // Transformation log de CPUE. Commentaire 2020
yy = Math.log(pue[k]);
itercov();
}
inverse_gauss();
par_alors[0] = Math.exp(par_alors[0]);
par_alors[0] = Math.exp(par_alors[0]); // Transformation exp. de paramètre a Commentaire 2020.
break;
case 4:
case 4: // CPUE=a+b.V^c. Commentaire 2020
nbre_par = 2;
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
......@@ -184,9 +196,9 @@ public class Modele {
}
inverse_gauss();
nbre_par = 3;
par_alors[2] = 1.;
par_alors[2] = 1.; //Parametre c initialisé à 1
break;
case 5:
case 5: // CPUE=a.V+b.V^2+c. Commentaire 2020
nbre_par = 3;
for (k = 0; k < nim; k++) {
ptmp[0] = vbar[k];
......@@ -197,7 +209,7 @@ public class Modele {
}
inverse_gauss();
break;
case 6:
case 6: // Modèle généralisé CPUE=(a+b.E)^(1/(c-1). Commentaire 2020
nbre_par = 2;
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
......@@ -207,9 +219,9 @@ public class Modele {
}
inverse_gauss();
nbre_par = 3;
par_alors[2] = 2.;
par_alors[2] = 2.; // Paramètre c initialisé à 2.0. Commentaire 2020
break;
case 7:
case 7: // CPUE=a.V^b+c.E. Commentaire 2020
nbre_par = 2;
for (k = 0; k < nim; k++) {
ptmp[0] = vbar[k];
......@@ -219,10 +231,10 @@ public class Modele {
}
inverse_gauss();
par_alors[2] = par_alors[1];
par_alors[1] = 1;
par_alors[1] = 1; // Initialisation a 1 du parametre b. Commentaire 2020
nbre_par = 3;
break;
case 8:
case 8: //CPUE=a+b.V+c.E. Commentaire 2020
nbre_par = 3;
for (k = 0; k < nim; k++) {
ptmp[0] = 1;
......@@ -809,6 +821,7 @@ public class Modele {
private static void makePlot() {
/**
* ***************** cpue plot *****************************
* ********** observed and fitted time series ***************
*/
double minx = Stat1.min(Data.getYears());
PlotSerie[] ps = new PlotSerie[5];
......@@ -831,15 +844,17 @@ public class Modele {
Global.fittedCpuePlot[1].setXcutYat(0);
for (int i = 0; i < 2; i++) {
Global.fittedCpuePlot[i].setTitreGraphique(Global.titreG[13 + i]);
Global.fittedCpuePlot[i].setTitreGraphique(Global.titreG[15 + i]);
Global.fittedCpuePlot[i].setTitreX(Global.titreSx[13 + i]);
Global.fittedCpuePlot[i].setTitreY(Global.titreSy[13 + i]);
Global.fittedCpuePlot[i].setDecimalsurX(0);
Global.fittedCpuePlot[i].setDecimalsurX(0); // Pas de décimale car années en X. Comment 2020.
Global.fittedCpuePlot[i].setMinAxeX(minx - 1);
Global.fittedCpuePlot[i].setpasX(2.0d);
}
/**
* ****************** residuals plot **************************
* i = 0 pour Résidus CPUE = f(E)
* i = 0 pour Résidus CPUE = f(V)
*/
for (int i = 0; i < 2; i++) {
......@@ -849,9 +864,10 @@ public class Modele {
Global.residualsPlot[0].setValeurs(new PlotSerie("", Data.getF(), "", res));
Global.residualsPlot[1].setValeurs(new PlotSerie("", Data.getV(), "", res));
for (int i = 0; i < 2; i++) {
Global.residualsPlot[i].setTitreGraphique(Global.titreG[i + 15]);
Global.residualsPlot[i].setTitreGraphique(Global.titreG[i + 17]);
Global.residualsPlot[i].setTitreX(Global.titreSx[i + 15]);
Global.residualsPlot[i].setTitreY(Global.titreSy[i + 15]);
Global.residualsPlot[i].setDecimalsurX(1); // setDecimalsurX(0) -> pas de décilmale sur axe des X. Avec setDecimalsurX(1) -> décimales SI NECESSAIRE en principe. Modif 2020.
// ajusteExtremas de Plot.java: selon valeur booléenne (vrai ou faux) applique ou non l'ajustement
// surX, sur X et met ou non le minimum à zéro sur Y et sur Y
Global.residualsPlot[i].ajusteExtremas(false, false, false, false); // seconde valeur boolénne changée de true en false. Modification 2020
......@@ -860,7 +876,7 @@ public class Modele {
}
/**
* *********************variate plot ******************************
* *********************Three-variate plot ******************************
*/
double pasx, pasy, minix, miniy, maxix, maxiy, xx, yy;
double[] estim1 = new double[nim];
......@@ -886,14 +902,14 @@ public class Modele {
PlotSerie[] pvs = new PlotSerie[8];
Global.variatePlot[0] = new Plot();
Global.variatePlot[1] = new Plot();
pvs[0] = new PlotSerie("Effort (E)", Data.getF(), "CPUE", Data.getPue());
pvs[1] = new PlotSerie("Effort (E)", Data.getF(), "Production (Y)", Data.getYexp());
pvs[0] = new PlotSerie("Weighted effort (E)", Data.getF(), "CPUE", Data.getPue());
pvs[1] = new PlotSerie("Weighted effort (E)", Data.getF(), "Production (Y)", Data.getYexp());
pvs[0].setCouleur(Color.black);
pvs[1].setCouleur(Color.black);
Global.variatePlot[0].setValeurs(pvs[0]);
Global.variatePlot[0].setTitreGraphique("Function CPUE versus V&E");
Global.variatePlot[0].setTitreGraphique("Function CPUE versus V&E (E weighted if relevant)"); // Trivariate plots. 2020
Global.variatePlot[1].setValeurs(pvs[1]);
Global.variatePlot[1].setTitreGraphique("Function Y versus V&E");
Global.variatePlot[1].setTitreGraphique("Function Y versus V&E (E weighted if relevant)"); // Trivariate plots. 2020
pvs[0].setFigure(2);
pvs[1].setFigure(2);
pvs[0].setMark(2);
......@@ -906,8 +922,8 @@ public class Modele {
xx = xx + pasx;
}
if (j == 0) {
pvs[2] = new PlotSerie("Effort (E)", tabxx, "Vmini:" + df.format(yy).toString(), estim1);
pvs[3] = new PlotSerie("Effort (E)", tabxx, "Vmini:" + df.format(yy).toString(), estim2);
pvs[2] = new PlotSerie("Weighted effort (E)", tabxx, "Vmini:" + df.format(yy).toString(), estim1);
pvs[3] = new PlotSerie("Weighted effort (E)", tabxx, "Vmini:" + df.format(yy).toString(), estim2);
pvs[2].setFigure(2);
pvs[3].setFigure(2);
pvs[2].setCouleur(Color.blue);
......@@ -915,16 +931,16 @@ public class Modele {
Global.variatePlot[0].setValeurs(pvs[2]);
Global.variatePlot[1].setValeurs(pvs[3]);
} else if (j == 4) {
pvs[4] = new PlotSerie("Effort (E)", tabxx, "Vmaxi:" + df.format(yy).toString(), estim1);
pvs[5] = new PlotSerie("Effort (E)", tabxx, "Vmaxi:" + df.format(yy).toString(), estim2);
pvs[4] = new PlotSerie("Weighted effort (E)", tabxx, "Vmaxi:" + df.format(yy).toString(), estim1);
pvs[5] = new PlotSerie("Weighted effort (E)", tabxx, "Vmaxi:" + df.format(yy).toString(), estim2);
Global.variatePlot[0].setValeurs(pvs[4]);
Global.variatePlot[1].setValeurs(pvs[5]);
pvs[4].setFigure(2);
pvs[5].setFigure(2);
} else if (j == 2 && ((Global.numero_modele == 10) || (Global.numero_modele == 21) || (Global.numero_modele == 23) || (Global.numero_modele == 24) || (Global.numero_modele == 25) || (Global.numero_modele == 27) || (Global.numero_modele == 30))) {
pvs[6] = new PlotSerie("Effort (E)", tabxx, "Vmiddle:" + df.format(yy).toString(), estim1);
pvs[7] = new PlotSerie("Effort (E)", tabxx, "Vmiddle:" + df.format(yy).toString(), estim2);
pvs[6] = new PlotSerie("Weighted effort (E)", tabxx, "Vmiddle:" + df.format(yy).toString(), estim1);
pvs[7] = new PlotSerie("Weighted effort (E)", tabxx, "Vmiddle:" + df.format(yy).toString(), estim2);
pvs[6].setCouleur(Color.green);
pvs[7].setCouleur(Color.green);
pvs[6].setFigure(2);
......@@ -943,6 +959,16 @@ public class Modele {
Global.variatePlot[1].setMinAxeY(0);
Global.variatePlot[0].ShowLegend = true;
Global.variatePlot[1].ShowLegend = true;
Global.variatePlot[0].setDecimalsurX(1);
Global.variatePlot[1].setDecimalsurX(1);
/* Ce qui suit ne marche pas car matrice stat non globalisée et donc à zéro.
if (stat[7][2] <10) Global.variatePlot[0].setDecimalsurX(1); // Avant setDecimalsurX(0) -> pas de décilmale sur axe des X. Avec setDecimalsurX(1) -> décimales SI NECESSAIRE. Modif 2020.
else Global.variatePlot[0].setDecimalsurX(0); // Modif 2020.
if (stat[7][2] <10) Global.variatePlot[1].setDecimalsurX(1); // Avant setDecimalsurX(0) -> pas de décilmale sur axe des X. Avec setDecimalsurX(1) -> décimales SI NECESSAIRE. Modif 2020.
else Global.variatePlot[1].setDecimalsurX(0); // Modif 2020.
System.out.println("stat[7][2] dans Modele.java= " + stat[7][2]);
*/
} else //traitement des mod�les � Environement pr�pond�rant
{
double[] ext = Stat1.Extremas(Data.getV());
......@@ -958,13 +984,12 @@ public class Modele {
PlotSerie[] pvs = new PlotSerie[8];
Global.variatePlot[0] = new Plot();
Global.variatePlot[1] = null;//new Plot();
pvs[0] = new PlotSerie("Environment (V)", Data.getV(), "CPUE", Data.getPue());
pvs[0] = new PlotSerie("Weighted environment (V)", Data.getV(), "CPUE", Data.getPue());
pvs[0].setCouleur(Color.black);
pvs[0].setFigure(2);
pvs[0].setMark(2);
Global.variatePlot[0].setValeurs(pvs[0]);
Global.variatePlot[0].setTitreGraphique("Function CPUE versus V");
Global.variatePlot[0].setTitreGraphique("Function CPUE versus V lagged if relevant)");
}
}
......
......@@ -234,10 +234,10 @@ public class QuestionReponse {
// System.out.println("Dans QuestionReponse.java ligne 234, Global.warningDic: " + Global.warningDic + " commentTxt: " + commentTxt);
try {
switch (numEnCours) {
case 1:
case 2: // Suite à réorganisation ordre des questions posées. Modif. 2020.
Global.changement_exploitation = index;
break;
case 2:
case 3: // Suite à réorganisation ordre des questions posées. Modif. 2020.
Global.unite_standardisee = index;
break;
case 4:
......@@ -278,7 +278,10 @@ public class QuestionReponse {
break;
case 17:
Global.nb_classes_exploitees = index;
Data.init_val();//Pour obtenir la relation en fct du d�calage
if (Global.nb_classes_exploitees > 8) {
throw new OnError("A stock with too many significantly exploited year-classes is not a situation compatible with the use of \nsurplus production models that make use of the transition prediction approach (past-effort-averaging) of Fox (1975). \n this method is used in CLIMPROD to fit data on non-equilibrium conditions. It simulate the equilibrium by using a weighted average of fishing effort (E). \nIf interanual variability of E is too large, the results are likely to be uncertain.");
}
Data.init_val();//Pour obtenir la relation en fct du d�calage
break;
case 18:
Global.relationCPU_E = 0; //Initialisations pour prendre
......
......@@ -32,7 +32,7 @@ public class TexteRegles {
{
try
{
Flag_Modele_Lineaire_deja_recherche=0;
Flag_Modele_Lineaire_deja_recherche=0;
Flag_Modele_Exponentiel_deja_recherche=0;
Flag_Modele_General_deja_recherche=0;
int nbData=0;
......@@ -152,27 +152,28 @@ public static boolean isTrue(){
if(!result)
commentaireEnCours="The number of years of observation of your data set is " +Data.getNbYears() ;
break;
case 42:
result = (Global.changement_exploitation!=2);
break;
case 43:
result = (Global.unite_standardisee!=1);
break;
case 47:
double temp;
double[] effort=Data.getF();
double[] ext=Stat1.Extremas(effort);
temp=((ext[1]-ext[0])/ext[0]);
result = temp<1.0d; // Avant <0.4d. Modif. 2020.
System.out.println("Règle 47 ext[1] = " + ext[1] + " ext[0] = " + ext[0] + " temp = " + temp + " result= " + result);
if(!result)
commentaireEnCours="The range of fishing effort variation of your data set is " + (temp);
break;
case 42:
result = (Global.changement_exploitation!=2);
break;
case 43:
result = (Global.unite_standardisee!=1);
break;
case 44:
result = (Global.effet_delais_abundance_negligeable!=1);
break;
case 46:
result = (Global.stock_unique!=1 && Global.metapopulation!=1); // Changement de nom variable. Modif. 2020
System.out.println("Dans TexteRegles.java ligne 169 case 46, result = " + result);
//System.out.println("Dans TexteRegles.java ligne 169 case 46, result = " + result);
if(!result){
commentaireEnCours="Metapopulations are special cases that difficult the application of any kind of population dynamics model. \nAccording to the level connectivity between sub-stocks, modelization might be borderline or not recommended as you will see \nafter answering the next question.";
}
......@@ -188,7 +189,7 @@ public static boolean isTrue(){
break;
case 35:
result = (Global.under_and_over_exploited!=1);// Avant Global.under_and_over_exploited!=1 && Global.under_and_optimaly==1). Modif 2020.
System.out.println("Dans TexteRegles.java ligne 182, case 35, result = " + result);
//System.out.println("Dans TexteRegles.java ligne 182, case 35, result = " + result);
break;
case 49:
result = (Global.under_and_optimaly!=1); // Avant (Global.under_and_over_exploited!=1 && Global.under_and_optimaly!=1). Modif 2020.
......
0;-1;1;41;1;;;;
1;-1;2;42;1;changement_exploitation; Have there been changes in the fishing pattern during the period (effort allocation quota mesh-size ...)?;changes.hlp ;
2;3;-1;43;1;unite_standardisee;Is the fishing effort unit standardized and is the CPUE proportional to abundance?;standard.hlp ;
3;-1;4;47;1;;;;
1;-1;2;47;1;;;;
2;-1;3;42;1;changement_exploitation; Have there been changes in the fishing pattern during the period (effort allocation quota mesh-size ...)?;changes.hlp ;
3;4;-1;43;1;unite_standardisee;Is the fishing effort unit standardized and is the CPUE proportional to abundance?;standard.hlp ;
4;5;-1;44;1;effet_delais_abundance_negligeable;Do time-lags and deviations from the stable age structure have negligible effects on production rate?; lageffe1.hlp ;
5;9;6;-1;1;stock_unique;Does the data-set apply to a unit stock?; singlest.hlp ;
6;7;-1;46;1;metapopulation;Does the data-set applies to a metapopulation?; metapopulation.hlp ;
......@@ -15,7 +15,7 @@
14;15;15;39;1;abnormal_points_scatt;Do you see outlier points?; outlier.hlp ;
15;16;16;50;1;effort_increasing;Constantly increasing effort?; increasf.hlp ;
16;17;17;40;1;independance;Are the two variables dependent?; independ.hlp ;;;;;;;;;;;
17;18;18;-1;1;nb_classes_exploitees;Number of significantly exploited year-classes; nbclass.hlp ;1;2;3;4;5;6;7;8;9;10;>10
17;18;18;-1;1;nb_classes_exploitees;Number of significantly exploited year-classes; nbclass.hlp ;1;2;3;4;5;6;7;8;>8;;;
18;19;57;-1;1;effort_preponderant;Is the influence of fishing effort on CPUE more important than the environmental influence?; fishmore.hlp ;;;;;;;;;;;
19;20;-1;48;1;decreasing_relationship;Does this plot appear to be decreasing?; decreas.hlp ;;;;;;;;;;;
20;40;21;17;1;obviously;Does this plot look obviously linear?; obvious.hlp ;;;;;;;;;;;
......
......@@ -11,7 +11,7 @@
44;Your data-set is not appropriate for use with these models on account of the population dynamics of your stock.;Sorry, I stop the model selection routine here.
45;Your data-set is not appropriate for use with these models on account of the stock structure.; Sorry, I stop the model selection routine here.
46;Your data-set is not appropriate on account of the stock structure.; Sorry, I stop the model selection routine here.
47;"Your data-set is not appropriate for use with surplus production models using fishing effort because the range of fishing effort variation is lower than 100% (factor x2).;If you think that environment is the main variable driving CPUE variation and if you suppose that fishing effort will continue to stay at the same level,;you may apply a simple regression using only environment as an independent variable (choose the 'fit_a_model_directly' menu or answer NO to the question: "Is the influence of effort on CPUE more important than the environmental influenceÿ?"; \nNote that this regression is not a model and that any prediction will be poor since the fishing effort level may change without influence on the regression."
47;"Your data-set is not appropriate for use with surplus production models using fishing effort because the range of fishing effort variation is lower than 100% (factor x 2).;If you think that environment is the main variable driving CPUE variation and if you suppose that fishing effort will continue to stay at the same level,;you may apply a simple regression using only environment as an independent variable (choose the 'fit_a_model_directly' menu or answer NO to the question:;"Is the influence of effort on CPUE more important than the environmental influenceÿ?";Note that this regression is not a model and that any prediction will be poor since the fishing effort level may change without influence on the regression."
48;There is a contradiction between your answers, or your data-set is not appropriate for use with surplus production models because the relationship between CPUE (or CPUE residuals) and effort is expected to be decreasing.;This means that fishing effort was probably not the key variable driving the stock during the period of observation.;If you think that environment is the main variable driving CPUE variations and if you suppose that fishing effort will continue to stay at the same level, you may apply a simple regression using only environment as independent variable (choose the "fit_a_model_directly" menu or answer NO to the question: "Is the influence of effort on CPUE more important than the environmental influence?".; Note that this regression is not a model and that any prediction will be poor since the fishing effort level may change without influence on the regression.;Sorry, I stop the model selection routine here.
49;Model results would be inappropriate for stock assessment owing to the low range of exploitation levels.;Sorry, I stop the model selection routine here.
50;Maximum production(s) will be overestimated owing to the dynamics of exploitation: when the effort is constantly increasing, the equilibrium state is not respected, and owing to the past-effort-averaging method which was retained in transitional state cases MSY is overestimaded (see Appendix B of the manual for discussion).
Number of significantly exploited year-classes?
Give the number of year-classes commonly exploited by the fishery, without
taking into account the exceptionally-old individuals.
Indicate the number of year-classes significantly exploited by the fishery.
An arbitrary threshold of a contribution to 5% of the catches in weight can be
used to count the number of year-classes. Usually this eliminate part of the
younger and oldest individuals.

\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment