Commit 99240dee authored by pfreon's avatar pfreon
Browse files

Changements moderes sur Validation & TexteRegles et affichage titres plots...

Changements moderes sur Validation & TexteRegles et affichage titres plots jackknife, mineurs ailleurs

Rajout R2 corrigé sur validation et affichage different R2 et test Fisher dans titres plots jackknife.
Age recrutement et début/fin influence environnement pas demandés si modèle catchability. Patch nécesssaire sur indexEnCours.
Parch sur RapportHtml pour résoudre pb des questions/réponses qui plantent système lorsque demandées.
Changement mineurs ailleurs.
parent 40227258
......@@ -4,14 +4,20 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Configuration.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/CadreMain.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/nbproject/build-impl.xml</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Modele.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Stat1.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Validation.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Global.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/TexteRegles.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Cadre_Question.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/RapportHtml.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Main.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Stat1.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Validation.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/org/apache/commons/math3/optim/nonlinear/vector/jacobian/AbstractLeastSquaresOptimizer.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/QuestionReponse.java</file>
<file>file:/E:/CLIMPROD_Git2/climprod/src/fr/ird/climprod/Cadre_ModeleDirect.java</file>
</group>
</open-files>
</project-private>
......@@ -152,18 +152,18 @@ public class Cadre_Modele extends JDialog {
jTextAreaModele.setText("Knowing the relationship between Cpue and E is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.append("\n");
jTextAreaModele.append("Knowing the environmental effect is " + Global.environmental_influence);
jTextAreaModele.append("\n\t");
jTextAreaModele.append("The rule governing the relationship between residual Cpue and V is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("A possible global model could be " + RechercheModele.getEquation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("And the rule governing the relationship between residual Cpue and V is " + RechercheModele.getCpue_VRelation());
} else {
jTextAreaModele.setText("Knowing the relationship between Cpue and V is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.append("\n");
jTextAreaModele.append("Knowing the environmental effect is " + Global.environmental_influence);
jTextAreaModele.append("\n\t");
jTextAreaModele.append("A possible global model could be " + RechercheModele.getEquation());
jTextAreaModele.append("The rule governing the relationship between residual Cpue and E is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("And the rule governing the relationship between residual Cpue and E is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.append("A possible global model could be " + RechercheModele.getEquation());
}
break;
default:
......
......@@ -183,8 +183,7 @@ public class Cadre_Question extends JFrame
jlstItem.addMouseListener(new javax.swing.event.MouseInputListener() {
@Override
public void mouseClicked(MouseEvent e) {
System.out.println("Mouse clicked (# of clicks: "
+ e.getClickCount() + ")");
//System.out.println("Mouse clicked (# of clicks: " + e.getClickCount() + ")");
if (e.getClickCount() == 2){
cmdNext.doClick();
}
......@@ -327,7 +326,7 @@ public class Cadre_Question extends JFrame
if (Global.etapeEnCours == 2) {
Global.modelisationOk = false;
Global.numero_modele = -2;
System.out.println("Dans Cadre_Question.java: On passe de l'�tape 2 � l'�tape 1");
//System.out.println("Dans Cadre_Question.java: On passe de l'�tape 2 � l'�tape 1");
} else if (Global.etapeEnCours == 3) {
Global.validationOk = false;
//System.out.println("Dans Cadre_Question.java: On passe de l'�tape 3 � l'�tape 2");
......@@ -406,7 +405,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
......@@ -438,7 +437,7 @@ public class Cadre_Question extends JFrame
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);
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 the jackknife plots and the \n'Current known facts' section in the CLIMPROD main frame after closing \nthis dialog box.", 0, this.parent);
QuestionReponse.reset();
this.dispose();
Global.CadreQuestion = null;
......@@ -468,7 +467,7 @@ public class Cadre_Question extends JFrame
if (numR >= 0)
{
//TexteRegles.loadRegles(numR);
System.out.println("Dans Cadre_Question ligne 455: n° de question numQ = " + numQ + " n° de règle numR = " + numR);
//System.out.println("Dans Cadre_Question ligne 455: n° de question numQ = " + numQ + " n° de règle numR = " + numR);
jTextAreaRegle.setText(TexteRegles.getScript());
String[] itemR = TexteRegles.getItem();
for (int i = 0; i < itemR.length; i++) // Item.length = nombre d'item (questions) associés à la règle. Commentaire 2020.
......@@ -577,7 +576,6 @@ public class Cadre_Question extends JFrame
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;
}
......@@ -595,7 +593,7 @@ public class Cadre_Question extends JFrame
@Override
public void keyTyped(KeyEvent e) {
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
System.out.println("PRESSED : "+e.getKeyChar());
//System.out.println("PRESSED : "+e.getKeyChar());
if (e.getKeyChar() == 'n'){
cmdNext.doClick();
}
......
......@@ -285,8 +285,8 @@ public class Data {
}
ageder = agerec + nbexploit - 1;
dtot = 0;
System.out.println("In Data.java ligne 298 nbexploit = " + nbexploit + "*** agerec = "+ agerec + "*** begining = " + begining + "****ending = "+ ending);
System.out.println("*** ageder =" + ageder + "decalmax = " + decalmax);
//System.out.println("In Data.java ligne 298 nbexploit = " + nbexploit + "*** agerec = "+ agerec + "*** begining = " + begining + "****ending = "+ ending);
//System.out.println("*** ageder =" + ageder + "decalmax = " + decalmax);
if (begining == -1) begining = 0;
for (int i = 0; i < nbexploit; i++) {
for (int d = begining; d <= ending; d++) {
......
......@@ -88,7 +88,8 @@ public class Global {
/*
* *********Validation***************************
*/
static double jackknife, fF;
static double jackknife, fF;
static String fFsignif$;
static boolean test_jackknife;
static String [] param$={"a","b","c","d"}; // Rajout 2020.
static String[] Test_Jackknife_Param$={" (good)"," (bad)"}; // Rajout 2020.
......@@ -133,7 +134,7 @@ public class Global {
*/
//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 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 (%) Time Plot", "Function Y=f(V & E) (lagged if relevant)", "Function Y=f(V & E) (E weighted if relevant)", "Function CPUE=f(V & E)(E weighted if relevant)", "Function CPUE=f(V & E) (E weighted if relevant)", "MSY versus V", "MSE versus 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)", "R2 (%) Time Plot", "Function Y=f(V & E) (lagged if relevant)", "Function Y=f(V & E) (E weighted if relevant)", "Function CPUE=f(V & E)(E weighted if relevant)", "Function CPUE=f(V & E) (E weighted if relevant)", "MSY versus V", "MSE 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", "MSE"};
......
......@@ -923,7 +923,7 @@ public class Modele {
maxiy = ext[1];
pasy = (maxiy - miniy) / 4.0;
xx = minix;
//xx=minix+pasx;
//xx=minix+pasx;
yy = miniy;
PlotSerie[] pvs = new PlotSerie[8];
Global.variatePlot[0] = new Plot();
......@@ -1073,13 +1073,18 @@ public class Modele {
if ((Global.fF < 0.001 && Global.fF > 0) || Global.fF> 999.999 || Global.fF < 1.0E-3) data$[nbre_par + 4][1] = numFormat.format(Global.fF);
else data$[nbre_par + 4][1] = nf.format( Global.fF);
data$[nbre_par+5][0]= "Fisher test on R²: p-value";
if (Global.fF < (Global.TableFisher_p_05 [nimTabFish- Global.nbre_param - 1][Global.nbre_param - 1 - 1])) // The last -1 term is here to compensate the fact that table indices start at 0 and not at 1.
if (Global.fF < (Global.TableFisher_p_05 [nimTabFish- Global.nbre_param - 1][Global.nbre_param - 1 - 1])) {// The last -1 term is here to compensate the fact that table indices start at 0 and not at 1.
data$[nbre_par+5][1]= " >0.05";
Global.fFsignif$ = ", p>0.05";
}
else
if (Global.fF >= Global.TableFisher_p_05 [nimTabFish - Global.nbre_param - 1][Global.nbre_param - 1 - 1] && Global.fF < Global.TableFisher_p_01 [nimTabFish - Global.nbre_param - 1][Global.nbre_param - 1 -1])
if (Global.fF >= Global.TableFisher_p_05 [nimTabFish - Global.nbre_param - 1][Global.nbre_param - 1 - 1] && Global.fF < Global.TableFisher_p_01 [nimTabFish - Global.nbre_param - 1][Global.nbre_param - 1 -1]) {
data$[nbre_par+5][1]= " <0.05";
Global.fFsignif$ = ", p<0.05";
}
else
data$[nbre_par+5][1]= " <0.01";
data$[nbre_par+5][1]= " <0.01";
Global.fFsignif$ = ", p<0.01";
data$[nbre_par + 6][0] = "Corrected R² ";
data$[nbre_par + 6][1] = nf2.format(Global.corrected_R2);
data$[nbre_par + 7][0] = "AIC ";
......
......@@ -21,8 +21,8 @@ public class QuestionReponse {
private static HashMap<String, String> htNum = new HashMap<String, String>();
private static HashMap<String, String> htName = new HashMap<String, String>();
private static int[] type;
private static int indexEnCours; //Index associ� � la cl (Numro de r�gle)
private static int numEnCours; //Numro de r�gle
private static int indexEnCours; //Index associé à la clé (Numéro de décision): index partant de 0 dans tableau Arbre-decision.csv
private static int numEnCours; //Numéro de décision
private static String scriptEnCours;
private static String[] itemEnCours;
private static String helpEnCours;
......@@ -222,7 +222,7 @@ public class QuestionReponse {
MsgDialogBox msg; // Addition 2020.
selectedItem[indexEnCours] = index;
index = index + 1;
System.out.println("Answer to rule " + regle[indexEnCours] + " given to question " + numEnCours + " is " + index);
System.out.println("In QuestionReponse. java Answer to rule " + regle[indexEnCours] + " given to question " + numEnCours + " is " + index);
// build list questions for html
//System.out.println("AAA question number : "+numEnCours);
......@@ -299,7 +299,6 @@ public class QuestionReponse {
Global.typeModele = index;
break;
case 19:
Global.decreasing_relationship = index;
break;
case 20: // Vide car traitement identique pour decisions 20 et 69.
......@@ -319,7 +318,7 @@ public class QuestionReponse {
case 70:
Global.stock_deja_effondre = index;
break;
case 23:;
case 23:
case 71:
Global.lifespan = index;
if (Global.lifespan < Global.nb_classes_exploitees) {
......@@ -470,7 +469,7 @@ public class QuestionReponse {
indexEnCours = -1;
}
System.out.println("IndexEnCours: " + indexEnCours);
System.out.println("IndexEnCours in QuestionReponse.java: " + indexEnCours);
}
/*
......
......@@ -393,6 +393,7 @@ public class RapportHtml extends JDialog {
System.out.println("Flag private String makeQuestionsAnswers() dans RapportHtml.java ligne 393, resultHTML = " + resultHTML); // Modif. 2020
// ugly way to make tings ordered
for (int i = 0; i < 200; i++){
//System.out.println("RapportHtml.java ligne 396; i = " + i + "Global.warningDic.get(i) = " + Global.warningDic.get(i));
if (Global.questionDic.containsKey(i)){
resultHTML += "<li>";
resultHTML += Global.questionDic.get(i).replace('²','2')+" ";
......@@ -400,8 +401,9 @@ public class RapportHtml extends JDialog {
if (Global.warningDic.containsKey(i)){
System.out.println("Flag if (Global.warningDic.containsKey(i)) dans RapportHtml.java ligne 400, i = " + i + " Global.warningDic.containsKey(i) = " + Global.warningDic.containsKey(i)); // Modif. 2020
if (!Global.warningDic.get(i).equals("")){
resultHTML += "<i style='color:red;'>("+Global.warningDic.get(i)+")</i>";
}
resultHTML += "<i style='color:red;'> (Warning:"+Global.warningDic.get(i)+")</i>";
}
}
resultHTML += "</li>\n";
}
......@@ -802,7 +804,7 @@ public class RapportHtml extends JDialog {
"Time plots", "Bivariate plots", "Observed-Fitted & Residual CPUE plots",
"Res f(E) vs V or Res f(V) vs E", "Jackknife plots", "CPUE=f() & Y=() plots",
"MSY & MS-E plots", "Modelization: Detailed results",
"Validation : Detailed results", "Questions, answers & warnings"};
"Validation: Detailed results", "Questions, answers & warnings"};
JPanel jPan = new JPanel();
JPanel jPanCombo = new JPanel();
......
......@@ -54,7 +54,7 @@ public class RechercheModele { //Variables dans fichier ListeModele.csv:
@param un String repr�sentant le nom "compl�t" du fichier listemodele.cvs.
*/
public static void initScript(InputStream file) //Lecture du fichier listeModeles.csvqui contient tous les modèles proposés par CLIMPROD
public static void initScript(InputStream file) //Lecture du fichier listeModeles.csv qui contient tous les modèles proposés par CLIMPROD
// public static void initScript(String file)
{
try
......@@ -175,25 +175,25 @@ public static void select(){
int newIndex=-1;
int i=0;
foundModel=false;
System.out.println("On recherche d'abord un modèle Global.relationCPU_E = " + Global.relationCPU_E+" Global.relationCPU_V = " +Global.relationCPU_V );
//System.out.println("On recherche d'abord un modèle Global.relationCPU_E = " + Global.relationCPU_E + " Global.relationCPU_V = " + Global.relationCPU_V );
if(Global.relationCPU_E!=2 && Global.relationCPU_E!=6 && Global.cpue_sous_sur_production==1 && Global.relationCPU_V!=0)
{
Global.relationCPU_E=7; // empêche de trouver un modèle si cpue_sous_sur_production lorsque surexploition et que CPUE=f(E) non-exponentile dans case 5: et 8: du fichier TexteRegles.java
System.out.println("Dans RechercheModele.java premier if, Global.relationCPU_E = "+Global.relationCPU_E);
//System.out.println("Dans RechercheModele.java premier if, Global.relationCPU_E = "+Global.relationCPU_E);
}
if(Global.relationCPU_E==2 && Global.cpue_sous_sur_production==1 && Global.relationCPU_V!=0)
{
Global.relationCPU_E=6; // force modèle exponentiel additif dans case 5: et 8: du fichier TexteRegles.java
System.out.println("Dans RechercheModele.java second if, Global.relationCPU_E = "+Global.relationCPU_E);
//System.out.println("Dans RechercheModele.java second if, Global.relationCPU_E = "+Global.relationCPU_E);
}
do
{
int j=ordre[i];
System.out.println(type[j]+" "+Global.typeModele+"***"+forme1[j]+" "+Global.relationCPU_E+"***"+forme2[j]+" "+Global.relationCPU_V+"***"+infl_Env[j]+" "+(Global.environmental_influence));
System.out.println(forme1[j]+" "+Global.relationCPU_E);
System.out.println(forme2[j]+" "+Global.relationCPU_V);
System.out.println(infl_Env[j]+" "+(Global.environmental_influence));
System.out.println("************************");
//System.out.println(type[j]+" "+Global.typeModele+"***"+forme1[j]+" "+Global.relationCPU_E+"***"+forme2[j]+" "+Global.relationCPU_V+"***"+infl_Env[j]+" "+(Global.environmental_influence));
//System.out.println(forme1[j]+" "+Global.relationCPU_E);
//System.out.println(forme2[j]+" "+Global.relationCPU_V);
//System.out.println(infl_Env[j]+" "+(Global.environmental_influence));
//System.out.println("************************");
if(teste[j]==false && type[j]==Global.typeModele && forme1[j]==Global.relationCPU_E && forme2[j]==Global.relationCPU_V && infl_Env[j].equals(Global.environmental_influence))
{
indexEnCours=j;//i;
......@@ -205,7 +205,7 @@ do
//System.out.println(foundModel+" "+ i+" "+nbData);
}
while(foundModel==false && i<nbData);
System.out.println("On a trouv� un mod�le dont CPUE=f(E) est " + RechercheModele.getCpue_ERelation()+" et CPUE=f(V) est " +RechercheModele.getCpue_VRelation() );
//System.out.println("On a trouv� un mod�le dont CPUE=f(E) est " + RechercheModele.getCpue_ERelation()+" et CPUE=f(V) est " +RechercheModele.getCpue_VRelation() );
}
/*
......@@ -214,7 +214,7 @@ System.out.println("On a trouv� un mod�le dont CPUE=f(E) est " + RechercheMo
*/
public static void select(String formule){
foundModel=false;
System.out.println("On recherche un mod�le " + Global.relationCPU_E+" " +Global.relationCPU_V );
//System.out.println("On recherche un mod�le " + Global.relationCPU_E+" " +Global.relationCPU_V );
for (int i=0;i<nbData;i++)
{
if(formule.equals(equation[i]))
......
......@@ -29,7 +29,7 @@ public class TexteRegles {
private static boolean R2limite=false;
//public static void initScript(String file,String fileComment)
public static void initScript(InputStream file,InputStream fileComment)
public static void initScript(InputStream file,InputStream fileComment) //Lecture des fichiers regles.csv et comment.csv.
{
try
{
......@@ -93,11 +93,13 @@ public class TexteRegles {
public static void loadRegles(int number)
{
numEnCours=number;
System.out.println("on charge la règle (dans TexteRegles, ligne 94) " + numEnCours );
System.out.println("on charge la règle (dans TexteRegles, ligne 96) " + numEnCours );
commentaireEnCours="";
if (numEnCours !=-1)
{
indexEnCours=Integer.parseInt((String)htNum.get(Integer.toString(numEnCours)));
//System.out.println("indexEnCours dans TexteRegles.java = " + indexEnCours);
if (indexEnCours == 56) indexEnCours = 18; // Patch 2020 pour empêcher plantage sur lignes suivantes.
scriptEnCours=script[indexEnCours];
itemEnCours=new String[item[indexEnCours].length];
for (int i=0;i<itemEnCours.length;i++)
......@@ -180,13 +182,13 @@ public static boolean isTrue(){
case 45:
result = (Global.stock_unique!=1 && Global.metapopulation==1 && Global.sous_stock_isole!=1); // Global.metapopulation==1
if(!result){
commentaireEnCours="Your case is a borderline one either because you deal only with a sub-stock or with a full metapopulation \n(and the lower is the connectivity between sub-stocks, the more borderline you are).";
commentaireEnCours="Your case is a borderline one either because you deal only with a sub-stock or with a full metapopulation \n(and the lower is the connectivity between sub-stocks, the more borderline you are).\nYou must not extrapolate your results beyond the interval of observation of the different variables (effort and/orenvironment), ;when using the model for predictions.\nMoreover, any surplus production model using effort will implicitly make the assumption that \nno variation in recruitment due to other sub-stocks will occur.";
}
break;
case 34:
/* case 34:
result = (Global.stock_unique!=1 && Global.metapopulation==1 && Global.sous_stock_isole==1); // Pas trouvé de solution pour afficher un message associé à cette règle lorsque result = true. Modif. 2020
break;
case 35:
*/ case 35:
result = (Global.under_and_over_exploited!=1);// Avant Global.under_and_over_exploited!=1 && Global.under_and_optimaly==1). Modif 2020.
break;
case 49:
......@@ -219,27 +221,27 @@ public static boolean isTrue(){
case 10:
//System.out.println(Global.relationCPU_E+" "+Global.pessimiste+" "+Global.stock_deja_effondre+" "+Global.lifespan+" "+Global.fecondite_faible);
result = (Global.relationCPU_E==RechercheModele.exponentiel && Global.pessimiste!=1 && Global.stock_deja_effondre!=1 && Global.lifespan>10 && Global.fecondite_faible!=1);
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
break;
case 11:
result = (Global.relationCPU_E==RechercheModele.exponentiel && Global.pessimiste!=1 && Global.stock_deja_effondre!=1 && Global.lifespan>4 && Global.lifespan<11 && Global.fecondite_faible!=1 && Global.rapport_vie_exploitee_inferieur_deux==2);
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
break;
case 12:
result = (Global.relationCPU_E==RechercheModele.exponentiel && Global.pessimiste!=1 && Global.stock_deja_effondre!=1 && Global.lifespan>4 && Global.lifespan<11 && Global.fecondite_faible!=1 && Global.premiere_reproduction_avant_recrutement==1);
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
break;
case 13:
result = (Global.relationCPU_E==RechercheModele.exponentiel && Global.pessimiste!=1 && Global.stock_deja_effondre!=1 && Global.lifespan>4 && Global.lifespan<11 && Global.fecondite_faible!=1 && Global.reserves_naturelles==1);
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
break;
case 14:
result = (Global.relationCPU_E==RechercheModele.exponentiel && Global.pessimiste!=1 && Global.stock_deja_effondre!=1 && Global.lifespan>4 && Global.lifespan<11 && Global.fecondite_faible!=1 && Global.metapopulation==1); // metapopulation remplace ici stock_subdivise car redondant. Modif 2020.
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
break;
case 16:
result = (Global.relationCPU_E==RechercheModele.exponentiel && Global.pessimiste!=1 && Global.stock_deja_effondre!=1 && Global.rapport_vie_exploitee_inferieur_deux==2 && Global.premiere_reproduction_avant_recrutement==1 && Global.fecondite_faible!=1 && Global.reserves_naturelles==1 && Global.metapopulation==1); // metapopulation remplace ici stock_subdivise car redondant. Modif 2020.
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
break;
case 17:
result = (Global.relationCPU_E==RechercheModele.lineaire);
......@@ -250,11 +252,11 @@ public static boolean isTrue(){
if(result)
{
Flag_Modele_Lineaire_deja_recherche=1;
Global.relationCPU_E=RechercheModele.lineaire;
Global.relationCPU_E=RechercheModele.lineaire;
}
else
{
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
Global.relationCPU_E=RechercheModele.exponentiel;
}
break;
......@@ -263,11 +265,11 @@ public static boolean isTrue(){
if(result)
{
Flag_Modele_Lineaire_deja_recherche=1;
Global.relationCPU_E=RechercheModele.lineaire;
Global.relationCPU_E=RechercheModele.lineaire;
}
else
{
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
{
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
Global.relationCPU_E=RechercheModele.exponentiel;
}
break;
......@@ -276,11 +278,11 @@ public static boolean isTrue(){
if(result)
{
Flag_Modele_Lineaire_deja_recherche=1;
Global.relationCPU_E=RechercheModele.lineaire;
Global.relationCPU_E=RechercheModele.lineaire;
}
else
{
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
Global.relationCPU_E=RechercheModele.exponentiel;
}
break;
......@@ -289,25 +291,25 @@ public static boolean isTrue(){
if(result)
{
Flag_Modele_Lineaire_deja_recherche=1;
Global.relationCPU_E=RechercheModele.lineaire;
Global.relationCPU_E=RechercheModele.lineaire;
}
else
{
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
Global.relationCPU_E=RechercheModele.exponentiel;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
Global.relationCPU_E=RechercheModele.exponentiel;
}
break;
case 22:
result = (Global.lifespan<5 && Global.rapport_vie_exploitee_inferieur_deux==1 && Global.reserves_naturelles==2 && Global.metapopulation==2 && Global.cpue_unstable==2); // metapopulation remplace ici stock_subdivise car redondant. Modif 2020.
if(result)
{
{
Flag_Modele_Lineaire_deja_recherche=1;
Global.relationCPU_E=RechercheModele.lineaire;
Global.relationCPU_E=RechercheModele.lineaire;
}
else
{
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
if(result) Flag_Modele_Exponentiel_deja_recherche=1;
Global.relationCPU_E=RechercheModele.exponentiel;
}
break;
......@@ -320,8 +322,8 @@ public static boolean isTrue(){
result=(Global.relationCPU_E==RechercheModele.lineaire && Global.coeff_determination<0.4);
if(result)
{
Global.relationCPU_E=RechercheModele.general;
Flag_Modele_General_deja_recherche=1;
Global.relationCPU_E=RechercheModele.general;
Flag_Modele_General_deja_recherche=1;
commentaireEnCours="The coefficient of determination of the model " + RechercheModele.getEquation()+ " is " + Global.coeff_determination+"\n";
commentaireEnCours=commentaireEnCours+"A generalized model is going to be fitted";
}
......@@ -329,10 +331,10 @@ public static boolean isTrue(){
case 25:
result=(Global.relationCPU_E==RechercheModele.exponentiel && Global.coeff_determination<0.4);
if(result)
{
Global.relationCPU_E=RechercheModele.general;
Flag_Modele_General_deja_recherche=1;
commentaireEnCours="The coefficient of determination of the model " + RechercheModele.getEquation()+ " is " + Global.coeff_determination+"\n";
{
Global.relationCPU_E=RechercheModele.general;
Flag_Modele_General_deja_recherche=1;
commentaireEnCours="The coefficient of determination of the model " + RechercheModele.getEquation()+ " is " + Global.coeff_determination+"\n";
commentaireEnCours=commentaireEnCours+"A generalized model is going to be fitted";
}
break;
......@@ -357,7 +359,7 @@ public static boolean isTrue(){
Global.relationCPU_E=RechercheModele.lineaire;
R2limite=true; // Pas utilisé? Commentaire 2020.
}
System.out.println("Dans TexteRegle Global.val_param[2]: " + Global.val_param[2] + " commentaireEnCours: " + commentaireEnCours);
//System.out.println("Dans TexteRegle Global.val_param[2]: " + Global.val_param[2] + " commentaireEnCours: " + commentaireEnCours);
commentaireEnCours="Coefficient c (m in the Pella and Tomlinson notation) value is :" + Global.val_param[2];
break;
case 52:
......@@ -423,7 +425,10 @@ public static boolean isTrue(){
commentaireEnCours="There is no possibility of drawing MSY and MS-E graphs for the selected model\n";
}
break;
/* case 56:
case 59:
result=(Global.environmental_influence.equals("catchability"));
break;
/*case 56:
result = (Global.relationCPU_E==RechercheModele.general && Global.coeff_determination>0.4);
Flag_Modele_General_deja_recherche=1;
// commentaireEnCours="Oui le modèle est généralisé";
......@@ -523,10 +528,11 @@ public static boolean isTrue(){
result= (Global.environmental_influence.equals(Global.influenceEnv[2]));
break;
}
if (result && commentaireEnCours.equals(""))
{ commentaireEnCours=(String)htComment.get(Integer.toString(numEnCours));
System.out.println("On teste la règle (dans TexteRegles.java ligne 469) " + numEnCours + " elle est "+ result );
// System.out.println("On teste la règle (dans TexteRegles.java ligne 529) " + numEnCours + " elle est "+ result );
if (commentaireEnCours == null) commentaireEnCours = "";
}
return result;
}
......
This diff is collapsed.
......@@ -5,13 +5,13 @@
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 ;
7;8;-1;45;1;sous_stock_isole;Does the data applies to the full metapopulation or at least to only one of its sub-stock with limited connectivity?; isostock.hlp ;
7;9;-1;45;1;sous_stock_isole;Does the data applies to the full metapopulation or at least to only one of its sub-stock with limited connectivity?; isostock.hlp ;
8;9;-1;34;1;;;;
9;11;10;35;1;under_and_over_exploited;Do you think that the data-set covers periods of both overexploitation and of underexploitation?; undover.hlp ;
10;11;-1;49;1;under_and_optimaly;Do you think that the data-set cover periods of both underexploitation and optimal exploitation?; undopt.hlp ;
11;12;12;37;1;statistiques_anormales;Do you see any abnormal statistics in the statistical data table?(see the second table in the Climprod frame); abnormal.hlp ;
12;13;13;36;1;unstability;Is interannual variability too large?; unstabil.hlp ;
13;14;14;38;1;abnormal_points_dist;Do you see outlier points?; outlier.hlp ;
13;14;14;38;1;abnormal_points_dist;Do you see abnormal yearly values in the histograms?; outlier.hlp ;
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 ;;;;;;;;;;;
......@@ -47,17 +47,18 @@
46;102;48;-1;1;environmental_influence;Does the environment influence:; Influenc.hlp ;abundance;catchability;both
102;47;48;56;1;;;;;;
47;50;48;-1;1;cpue_sous_sur_production;May the stock present large fluctuations in CPUE when overexploited?; additif.hlp ;;;;;;;;;;;;
48;51;49;17;1;linear_relationship;Does this plot look linear; linear.hlp ;;;;;;;;;;;;
49;51;51;-1;1;monotonic_relationship;Does this plot look monotonic?; monotoni.hlp ;;;;;;;;;;;;
50;51;-1;57;1;linear_relationship;Does this plot look linear?; linear.hlp ;;;;;;;;;;;;
51;52;52;-1;1;recruitment_age;Age at recruitment; Agerec.hlp ;1;2;3;4;5;6;7;8;9;10;>10;
52;53;53;-1;1;begin_influence_period;Age at the begining of environmental influence; begin.hlp ;0;1;2;3;4;5;6;7;8;9;10;>10
53;54;54;-1;1;end_influence_period;Age at the end of environmental influence; end.hlp ;0;1;2;3;4;5;6;7;8;9;10;>10
48;104;49;17;1;linear_relationship;Does this plot look linear; linear.hlp ;;;;;;;;;;;;
49;104;104;-1;1;monotonic_relationship;Does this plot look monotonic?; monotoni.hlp ;;;;;;;;;;;;
50;104;-1;57;1;linear_relationship;Does this plot look linear?; linear.hlp ;;;;;;;;;;;;
104;54;51;59;1;;;;;;
51;52;52;-1;1;recruitment_age;Age at recruitment; Agerec.hlp ;1;2;3;4;5;6;7;8;>8;;;;
52;53;53;-1;1;begin_influence_period;Age at the begining of environmental influence; begin.hlp ;0;1;2;3;4;5;6;7;8;>8;;;;
53;54;54;-1;1;end_influence_period;Age at the end of environmental influence; end.hlp ;0;1;2;3;4;5;6;7;8;>8;;;;
54;95;55;4;2;;;;;;;;;;;;;;;
55;95;-2;5;2;;;;;;;;;;;;;;;
56;57;57;-1;1;recruitment_age;Age at recruitment; Agerec.hlp ;1;2;3;4;5;6;7;8;9;10;>10;
57;58;58;-1;1;begin_influence_period;Age at the begining of environmental influence; begin.hlp ;0;1;2;3;4;5;6;7;8;9;10;>10
58;59;59;-1;1;end_influence_period;Age at the end of environmental influence; end.hlp ;0;1;2;3;4;5;6;7;8;9;10;>10
57;58;58;-1;1;begin_influence_period;Age at the begining of environmental influence; begin.hlp ;0;1;2;3;4;5;6;7;8;>8;;;;
58;59;59;-1;1;end_influence_period;Age at the end of environmental influence; end.hlp ;0;1;2;3;4;5;6;7;8;>8;;;;
59;62;60;-1;1;linear_relationship;Does_this_plot_look_linear?; linear.hlp ;;;;;;;;;;;;
60;62;63;-1;1;monotonic_relationship;Does this plot look monotonic?; monotoni.hlp ;;;;;;;;;;;;
61;64;62;26;1;;;;;;;;;;;;;;;
......
34;Your case is a borderline case for use with these models because you deal with a sub-stock or a metapopulation.;You must not extrapolate your results beyond the interval of observation of the different variables (effort and/orenvironment), when using the model for predictions.;Moreover, any surplus production model using effort will implicitly make the assumption that novariation in recruitment due to other sub-stocks will occur.
35;Surplus production models results are sensitive to the location of the higher level exploitation reached with respect of the Maximum Sustainable Effort (MSE).; According to your assessment of the maximum level of exploitation reached, modelization might be borderline or not recommended as you will see after answering the next question.
36;When the time-series is unstable, especially when effort or environment is concerned, the models are unable to take into account the transitional situations because the past-effort-averaging and the past-environment-averaging approaches are used in this software.;Of course this comment does not apply in the case of short lived species where effort and environment only concern one year of a single year-class.
35;Surplus production models results are sensitive to the location of the higher level exploitation reached ;with respect of the Maximum Sustainable Effort (MSE).; According to your assessment of the maximum level of exploitation reached, modelization might be borderline or not recommended, ;as you will see after answering the next question.
36;When the time-series is unstable, especially when effort or environment is concerned, ;the models are unable to take into account the transitional situations because the past-effort-averaging ;and the past-environment-averaging approaches are used in this software.;Of course this comment does not apply in the case of short lived species where effort and environment only concern one year of a single year-class.
37;Modelization will not be reliable owing to the data-series structure.
38;Your case is a borderline case for use with these models because your data-set probably contains a few outlier points which may strongly force the structure of any model. The jackknife results will probably confirm of the model (if any selected by the software) will be poor.
39;Check your data to confirm that the outlier point(s) is (are) not an error. If not this (these) point(s) may hinder the analysis, especially if the program has to use the concerned point(s) when applying the past-averaging approach to solve the problem of transitional situation. This comment does not apply in the case of short-lived species where the effort and environment only concern one year of a single year-class.
40;If the two explanatory variables, environment and fishing effort, are not independent (co-linearity or shaped relationship), it will be difficult to recognize the difference between the influence of these two variables on the CPUE, and therefore the model will be imprecise. If the mentioned relationship seems very important, it may be recommended to use a model with a single dependent variable.
41;Your data-set is too short for use with these models. ;At least 12 years of observation are required in order to limit the problem; of the low degrees of freedom when fitting a model (providing that after taking into account; possible lags and the number of parameters of the retained model will not reduce it further down).; Sorry, I stop the model selection routine here.
42;Your data-set is not appropriate except if the fishing effort used takes account of these changes.;Sorry, I stop the model selection routine here.
43;Your data-set is not appropriate because you have first to standardize your fishing effort unit.;Sorry, I stop the model selection routine here.
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 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.
38;Your case is a borderline case for using these models because your data-set probably contains; a few outlier points which may strongly force the structure of any model. ;The jackknife results will probably confirm of the model (if any selected by the software) will be poor.
39;Check your data to confirm that the outlier point(s) is (are) not an error. ;If not this (these) point(s) may hinder the analysis, especially if the program has to use the concerned point(s) ;when applying the past-averaging approach to solve the problem of transitional situation. ;This comment does not apply in the case of short-lived species where the effort and environment only concern one year of a single year-class.