Commit 711c7ba9 authored by pfreon's avatar pfreon
Browse files

Minor changes (comments, text files, etc.)

Minor changes on java files (addition of comments or system print for test) and on help files.
parent a6332c99
/**
* Titre : Climprod<p>
* Gestion partie droite de fenetre principale "Current known facts". Comment. 2020.
*/
package fr.ird.climprod;
......
......@@ -47,8 +47,8 @@ public class Cadre_Help extends JDialog {
this.getContentPane().add(jScrollPane1, BorderLayout.CENTER);
this.getContentPane().add(jPanel1, BorderLayout.SOUTH);
this.setModal(true);
this.setSize(250, 600);
this.setTitle("Climprod : Help ");
this.setSize(350, 700);
this.setTitle("Climprod: Help ");
jPanel1.setLayout(borderLayout1);
jTextAreaHelp.setLineWrap(true);
......
......@@ -26,8 +26,8 @@ public class Cadre_Plot extends JFrame {
try {
plots = p;
initWindow();
UtilCadre.Size(this, 30, 40); // 70, 70 -> 30, 40
System.out.println(" Defintion des facteurs reduction fenetre par rapport a max, sx et sy ligne 29 Cadre_Plot.java = " + 70 + " " + 70 +" -> 30, 40"); // Test 2020
UtilCadre.Size(this, 70, 70);
// System.out.println(" Defintion des facteurs reduction fenetre par rapport a max, sx et sy ligne 29 Cadre_Plot.java = " + 70 + " " + 70 +" -> 30, 40"); // Test 2020
UtilCadre.Centrer(this);
} catch (Exception e) {
......
/**
* Titre : Climprod<p>
* Gère les fenêtres de "Select the appropriate model and fit it" (=Questions)
* y compris les messages de résultats de la sélection.
* y compris les messages de résultats de la sélection, dont ceux
* correspondant aux décisions négatives (-1, -2, -3; lignes 410-441).
*/
package fr.ird.climprod;
import static fr.ird.climprod.UtilCadre.Centrer;
......@@ -405,7 +406,7 @@ public class Cadre_Question extends JFrame
modele = new DefaultListModel<String>();
numQ = QuestionReponse.getNum();
numR = QuestionReponse.getNumRegle();
//System.out.println("Dans Cadre_Question ligne 406: n° de question numQ = " + numQ + " n° de règle numR = " + numR);
System.out.println("Dans Cadre_Question ligne 406: n° de question numQ = " + numQ + " n° de règle numR = " + numR);
if (numQ == -1)
{
String m$ = ""; // Modif. 2020
......@@ -420,9 +421,10 @@ public class Cadre_Question extends JFrame
return;
}
else
if (numQ == -2 || numQ == -3)
if (numQ == -2)
{
new MsgDialogBox(0, "Problem in Jackknife computation \ndue to CPUE values <1. \nPlease modifiy your units of production (catches) and/or effort.", 0, this.parent);//System.out.println("Texte_erreur_jackknife$1 = "); // + Texte_erreur_jackknife$[1]
new MsgDialogBox(0, "The fit of the selected model is not good enough.", 0, this.parent);
//System.out.println("Texte_erreur_jackknife$1 = "); // + Texte_erreur_jackknife$[1]
QuestionReponse.reset();
this.dispose();
Global.CadreQuestion = null;
......@@ -433,7 +435,21 @@ public class Cadre_Question extends JFrame
}
return;
}
else
else
if (numQ == -3)
{
new MsgDialogBox(0, "The selected model is not validated due to your answer or to the jackknife statistical test \non at least one of the coefficients of the model (see in the jackknife plots).", 0, this.parent);
QuestionReponse.reset();
this.dispose();
Global.CadreQuestion = null;
if (dlgSp != null)
{
dlgSp.setVisible(false);
dlgSp = null;
}
return;
}
else
if (numQ == -4)
{
if (dlgSp != null)
......@@ -441,7 +457,7 @@ public class Cadre_Question extends JFrame
dlgSp.setVisible(false);
dlgSp = null;
}
new MsgDialogBox(0, "The model is validated. \nYou can have a look at the MSY and MS_E graphs \nin the 'Plots' menu. \nYou can also use this model for prediction \nand display result tables through the 'Modelization' menu. ", 1, this.parent);
new MsgDialogBox(0, "The model is validated. \nYou can use this model for prediction \nand display result tables through the 'Modelization' menu. ", 1, this.parent);
QuestionReponse.reset();
this.dispose();
......@@ -538,29 +554,32 @@ public class Cadre_Question extends JFrame
//dlgSp=new Cadre_SplitPlot(Global.scatterPlot[2]);
dlgSp = new Cadre_SplitPlot(Global.lagPlot[0]);
break;
case 48:
case 49:
case 50:
case 51:
dlgSp = new Cadre_SplitPlot(Global.residualsPlot[1]);
break;
case 59:
case 60:
case 61:
//dlgSp=new Cadre_SplitPlot(Global.scatterPlot[3]);
dlgSp = new Cadre_SplitPlot(Global.lagPlot[1]);
break;
case 69:
case 68:
dlgSp = new Cadre_SplitPlot(Global.residualsPlot[0]);
break;
case 97:
case 95:
dlgSp = new Cadre_SplitPlot(Global.variatePlot);
break;
case 98:
case 96:
dlgSp = new Cadre_SplitPlot(Global.fittedCpuePlot, true);
break;
case 100:
case 98:
dlgSp = new Cadre_SplitPlot(Global.jackknifePlot);
break;
case 99:
System.out.println("Flag Cadre_Question ligne 464: n° de question numQ = " + numQ + " n° de règle numR = " + numR);
dlgSp = new Cadre_SplitPlot(Global.msyPlot);
break;
}
if (dlgSp != null) {
UtilCadre.leftResize(this, 35, 95); // 35 -> 13 et 95 ->48 pour réduire largeur fenêtre Question lors de présentation graphiques. Premier chiffre affecte largeur fenetre, second ?? Test 2020
......
package fr.ird.climprod;
import static fr.ird.climprod.AppelNavigateur.isMacPlatform;
/* ******************************************************************
*******Definition of the Main() method (Java entry point)
******************************************************************
*/
import static fr.ird.climprod.AppelNavigateur.isMacPlatform; // isMacPlatform returns whether this is a Mac OS X platform
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
......
......@@ -170,7 +170,7 @@ public class PanelPlot extends JPanel
return;
}
if (plot.getNbSerie() == 0) {
MsgDialogBox msg = new MsgDialogBox(0, "Unable to display the plot (axe X or axe Y = 0).", 0, Global.CadreMain);
MsgDialogBox msg = new MsgDialogBox(0, "Unable to display the plot (axe X or axe Y = 0) for this model and data set.", 0, Global.CadreMain);
return;
}
Gra = plot;
......
......@@ -75,7 +75,7 @@ public class PlotPreferences extends JDialog
getContentPane().add(container);
pack();
UtilCadre.Size(this, 75, 50, true);
System.out.println("Fag definition taille fenetre (75, 50) et apparence (true) dans PlotPreferences.java"); // Test 2020
//System.out.println("Flag definition taille fenetre (75, 50) et apparence (true) dans PlotPreferences.java"); // Test 2020
UtilCadre.Centrer(this);
setVisible(true);
// UIManager.addPropertyChangeListener(new UISwitchListener(container));
......
......@@ -146,7 +146,7 @@ static public double cov(int[] x,int[] y){
}
/**
* Calcul du coefficient de Pearson sur 2 tableaux d'entiers.
* Calcul du coefficient de correlation conventionel de Pearson sur 2 tableaux d'entiers.
* Attention les tableaux doivent �tre de m�me taille.
* @param int[] x,int[] y
* @return un double, le coefficient de Pearson.
......@@ -166,7 +166,7 @@ static public double pearson(int[] x,int[] y){
return pearson(da,db);
}
/**
* Calcul du coefficient de Pearson sur 2 tableaux de float.
* Calcul du coefficient de correlation conventionel de Pearson sur 2 tableaux de float.
* Attention les tableaux doivent �tre de m�me taille.
* @param float[] x,float[] y
* @return un double, le coefficient de Pearson.
......@@ -186,7 +186,7 @@ static public double pearson(float[] x,float[] y){
return pearson(da,db);
}
/**
* Calcul du coefficient de Pearson sur 2 tableaux de double.
* Calcul du coefficient de correlation conventionel de Pearson sur 2 tableaux de double.
* Attention les tableaux doivent �tre de m�me taille.
* @param double[] x,double[] y.
* @return un double, le coefficient de Pearson.
......@@ -208,7 +208,7 @@ static public double pearson(float[] x,float[] y){
}
/**
* Calcul du coefficient de corr�lation rho sur 2 tableaux de double.
* Calcul du coefficient de corr�lation sur les rangs de Spearman (rho) sur 2 tableaux de double.
* Attention les tableaux doivent �tre de m�me taille.
* @param double[] x,double[] y.
* @return un double, le coefficient de corr�lation rho.
......@@ -334,7 +334,7 @@ static public float[] histoCentreReduit(float [] x,boolean freqRelative)
return compte;
}
static public double min(double [] s){
static public double min(double [] s){ // Utilisé pour analyser autre chose que données brutes (axes graphiques en particulier).
double min=s[0];
for (int i=0;i<s.length;i++)
{
......@@ -350,11 +350,12 @@ for (int i=0;i<s.length;i++)
{
if(s[i]>max)
max=s[i];
}
return max;
}
static public double[] Extremas(double [] s){
static public double[] Extremas(double [] s){ // Utilisé pour analyser données brutes.
double[] ext=new double[2];
ext[0]=s[0];
ext[1]=s[0];
......@@ -364,8 +365,8 @@ for (int i=0;i<s.length;i++)
ext[0]=s[i];
else if (s[i]>ext[1])
ext[1]=s[i];
}
// System.out.println("Flag 2 Stat1, ext[0] = " + ext[0] + " ext[1] = " + ext[1]);
return ext;
}
......
/**
* Titre : GenLev<p>
* Cette classe dote la class JTables de fonctionnalit� de copier-coller.
* Le format de donn�es copi�es dans le presse papier est compatible avec le format Excel.
* Source : d'apr�s JavaWorld rubrique type 77.
*/
package fr.ird.climprod;
......@@ -11,12 +13,6 @@ import javax.swing.*;
import java.awt.datatransfer.*;
import java.util.*;
/**
* Cette classe dote la class JTables de fonctionnalit� de copier-coller.
* Le format de donn�es copi�es dans le presse papier est compatible avec le format Excel.
* Source : d'apr�s JavaWorld rubrique type 77.
*
*/
public class jTableCopyPaste implements ActionListener
{
private Clipboard system;
......
......@@ -3,8 +3,8 @@ Is this an acceptable model?
These two graphs present pseudo three-dimensional relationships between
the two independent variables fishing effort (E) and environment (V), and:
-the production (Y) on the left side;
-the catch per unit of effort (CPUE) on the right side.
-the production (Y) on the upper panel;
-the catch per unit of effort (CPUE) on lower panel.
The two lines of each graph correspond to minimum and maximum observed
values of V. Note that from these graphs it is not possible to estimate
......
......@@ -2,4 +2,7 @@ What is the life span of the species?
Give the duration in years of the common lifespan of the species, without
taking into account the exceptionally-old individuals.
Please be consistent with your previous answers regarding
the number of exploited year-classes.

\ No newline at end of file
Are the shapes of the MSY and MS-E graphs acceptable?
For the selected model to be validated the shape of the plot of MS-Y vs V
within the range of observed V values, must have the same shape as expected
when you decided wether the relationship between V and CPUE (or CPUE residuals)
was linear or monotonic or quadratic (parabola). If not, (for instance
monotonicshape of MS-Y graph when the relationship was supposed to be
quadratic) you have to use an other model with less parameters.

\ No newline at end of file
......@@ -3,4 +3,7 @@ Is the ratio (life span/number of exploited year-classes) lower than 2 ?
If you answer YES the program will receive an argument in favour of
an exponential model because in such cases the stock is supposed to be
resistant to collapse.
Please be consistent with your previous answers regarding
the life span and the number of exploited year-classes.

\ No newline at end of file
Reasonable jackknife coefficient R2 (over 65% recommended),
no yearly extreme coefficient and acceptable MSY graph?
Reasonable jackknife coefficient R2 (over 65% recommended) and
no yearly extreme coefficient?
As CPUE=Y/E the two variables CPUE and E are not mathematically independant.
Therefore, the conventional parametric or non-parametric tests on R2 are
useless, and empirical criteria are retain to assess the fit.
The jackknife validation is "reasonable" when the jackknife coefficient of
determination R2 is over 65%, and when any yearly coefficient ratio
(for R2 and for the coefficients of regression a, b, c and d) is < 60%
or >140%, as plotted on the last graphs which indicated the stability
of the model when removing one year from the data-set. The 65%, 60% and
140% values previously mentioned are empirical limits which do not take
into account the number of degrees of freedom.
Moreover to be validated the shape of the plot of MS-Y versus V, within
For the model to be validated, the shape of the plot of MS-Y versus V, within
the range of observed V values, must have the same shape as expected when
you decided wether the relationship between V and CPUE (or CPUE residuals)
was linear or monotonic or quadratic (parabola). If not, (for instance
......
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