Commit b002150e authored by pfreon's avatar pfreon
Browse files

Minor changes name of variable and messages

Changes in different flies of the name of variable Global.effort_preponderant to Global.envir_preponderant to be consistent with earlier modification in the wording of the associated question.
Improvement of the content of model.txt and help files.
Addition of new test files .CLI.
parent 9c1f6cc2
......@@ -7,7 +7,7 @@
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Climprod6" default="default" basedir=".">
<project name="Climprod 2.0" default="default" basedir=".">
<description>Builds, tests, and runs the project Climprod5.</description>
<import file="nbproject/build-impl.xml"/>
<!--
......
......@@ -17,35 +17,35 @@ Years; Production; Effort; Environment
2000; 5.45701954; 1.159143822; 2.03112945
2002; 5.4617011; 0.911885889; 2.15818843
2004; 5.28226433; 0.797525207; 0.88759862
2006; 5.52218131; 1.042487388; 0.95112811
2008; 5.43374845; 1.180521232; 2.18995318
2010; 4.43340431; 0.54762925; 0.3793627
2012; 4.85289541; 0.647810068; 1.17348133
2014; 5.49762453; 1.109752816; 0.98289286
2016; 4.67850426; 0.602920806; 1.93583521
2018; 5.18386863; 0.75516743; 3.49230773
2020; 0.53860867; 2.5; 2.41230639
2022; 4.17790975; 0.496820336; 1.3640698
2024; 5.22531858; 0.772093307; 2.85701282
2026; 3.94483616; 0.454916205; 0.18877423
2006; 5.5; 1.042487388; 0.95112811
2008; 5.4; 1.180521232; 2.18995318
2010; 4.3; 0.54762925; 0.3793627
2012; 4.8; 0.647810068; 1.17348133
2014; 5.4; 1.109752816; 0.98289286
2016; 4.6; 0.602920806; 1.93583521
2018; 5.1; 0.75516743; 3.49230773
2020; 0.5; 2.5; 2.41230639
2022; 4.1; 0.496820336; 1.3640698
2024; 5.1; 0.772093307; 2.85701282
2026; 3.9; 0.454916205; 0.18877423
2028; 4.67192032; 1.516540705; 2.47583588
2030; 4.78158408; 1.481670426; 3.17466028
2032; 3.92067875; 0.450773452; 0.56995117
2034; 4.14324324; 0.490348182; 1.0781871
2036; 0.03978754; 2.7; 0.12524474
2038; 2.37759713; 2.067003964; 2.09465894
2040; 5.51961114; 1.004058491; 0.82406913
2036; 0.05; 2.7; 0.12524474
2038; 1.0; 2.067003964; 2.09465894
2040; 6.0; 1.004058491; 0.82406913
2042; 5.47365452; 0.924056217; 2.53936537
2044; 4.60408679; 1.537206915; 2.25348267
2044; 4.0; 1.537206915; 2.25348267
2046; 5.21710516; 1.313171882; 1.52289353
2048; 4.85188449; 1.458195275; 3.42877824
2050; 5.34726166; 1.242707747; 1.30054031
2052; 5.42022414; 0.877196649; 2.47583588
2054; 4.91100138; 1.43764689; 3.39701349
2056; 5.435865; 1.178697734; 2.6981891
2058; 1.4844104; 2.262313505; 1.14171659
2058; 1.0; 2.262313505; 1.14171659
2060; 5.47294582; 1.142309993; 3.07936604
2062; 5.38253558; 0.851639341; 3.20642502
2064; 5.47658932; 1.138105815; 1.61818776
2066; 3.39390975; 1.844663915; 1.87230572
2066; 2.5; 1.844663915; 1.87230572
2068; 5.43092716; 0.885318656; 2.60289486
This diff is collapsed.
......@@ -19,7 +19,7 @@ is divided into following sections:
- cleanup
-->
<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="Climprod6-impl">
<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="Climprod 5.0-impl">
<fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
......@@ -609,7 +609,7 @@ is divided into following sections:
</condition>
<union id="test.set"/>
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Climprod6" testname="TestNG tests" workingDir="${work.dir}">
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Climprod 5.0" testname="TestNG tests" workingDir="${work.dir}">
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
<propertyset>
<propertyref prefix="test-sys-prop."/>
......@@ -706,7 +706,7 @@ is divided into following sections:
<condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
<isset property="test.method"/>
</condition>
<condition else="-suitename Climprod6 -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
<condition else="-suitename Climprod 5.0 -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
<matches pattern=".*\.xml" string="@{testClass}"/>
</condition>
<delete dir="${build.test.results.dir}" quiet="true"/>
......@@ -1047,7 +1047,7 @@ is divided into following sections:
<delete file="${built-jar.properties}" quiet="true"/>
</target>
<target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
<echo level="warn" message="Cycle detected: Climprod6 was already built"/>
<echo level="warn" message="Cycle detected: Climprod 5.0 was already built"/>
</target>
<target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
<mkdir dir="${build.dir}"/>
......@@ -1713,7 +1713,7 @@ is divided into following sections:
<delete file="${built-clean.properties}" quiet="true"/>
</target>
<target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
<echo level="warn" message="Cycle detected: Climprod6 was already built"/>
<echo level="warn" message="Cycle detected: Climprod 5.0 was already built"/>
</target>
<target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
<mkdir dir="${build.dir}"/>
......
......@@ -3,6 +3,6 @@ build.xml.script.CRC32=09205104
build.xml.stylesheet.CRC32=f85dc8f2@1.94.0.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=b7ca6f13
nbproject/build-impl.xml.script.CRC32=3d437f05
nbproject/build-impl.xml.data.CRC32=1a05adef
nbproject/build-impl.xml.script.CRC32=35acbde1
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.96.0.48
......@@ -3,7 +3,7 @@
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Climprod6</name>
<name>Climprod2.0</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
......
......@@ -65,6 +65,8 @@ public class CadreMain extends JFrame {
GridBagLayout gridBagLayout1 = new GridBagLayout();
JTextArea jTextAreaFaits = new JTextArea();
static public String[] cpu_relation_E = {"Unknown yet", "Linear (Graham-Schaefer model)", "Exponential (Fox model)", "Generalized (Pella & Tomlinson model)", "", "", "Exponential_additive", "Not exponential with high variability of CPUE when overexploitation"};
static public String[] cpu_relation_V = {"Unknown yet", "Linear", "Exponential", "Power", "Power", "Dome-shaped", "", ""};
private String workingDirectory = "";
private String userDir = "";
private String userHome = "";
......@@ -142,7 +144,7 @@ public class CadreMain extends JFrame {
this.setIconImage(Toolkit.getDefaultToolkit().createImage(CadreMain.class.getResource("resources/images/Climprod.jpg")));
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(new GridLayout(1, 2));
this.setTitle("Climprod 2.0");
this.setTitle("Climprod 5.0 beta");
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(WindowEvent e) {
......@@ -197,7 +199,7 @@ public class CadreMain extends JFrame {
}
});
menuFileFolder.setText("Make a history html & plots folder");
menuFileFolder.setText("Build a history html & plots folder");
menuFileFolder.setMnemonic(KeyEvent.VK_M);
menuFileFolder.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M,InputEvent.CTRL_DOWN_MASK));
menuFileFolder.addActionListener(new java.awt.event.ActionListener() {
......@@ -552,7 +554,7 @@ public class CadreMain extends JFrame {
void menuFileFolder_actionPerformed(ActionEvent e) {
RapportHtml dlg = new RapportHtml(this, this.makeFaits());
dlg.setTitle("Climprod: Build an html & plots folder ");
dlg.setTitle("Climprod: Build a html & plots folder ");
dlg.setModal(true);
dlg.setVisible(true);
int d = dlg.getResult();
......@@ -820,15 +822,15 @@ public class CadreMain extends JFrame {
faits = faits + "Number of observed data (years): " + Data.getNbYears() + s;
Global.temp=Global.RangeEffort();
faits = faits + "The relative range of fishing effort variation is " + nf.format(Global.temp*100) + "%" + s + s;
//System.out.println("Flag (makeFaits()) ligne 823 CadreMain.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
//System.out.println("Flag (makeFaits()) ligne 823 CadreMain.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
//WARNING: THE UPDATE OF THE COMMENTS RELATIVE TO THE PREDOMINENCE OF V OR E ON CPUE
//AS WELL AS THE COMMENTS RELATIVE TO TYPE OF ENVIRONMENTAL INFLUENCE AND TO THE
//KIND OF RELATIONSHIP BETWEEN CPUE & E OR CPUE & V ARE ONLY PERFORMED WHEN CLICKING
//ON THE TYPE OF MODEL AND ON THE SELECTED MODEL ITSELF WHEN USING THE "FIT A MODEL DIRECTLY" OPTION.
if (Global.effort_preponderant != -1 || Global.environmental_influence != "") { // Simple models
if (Global.effort_preponderant == 1) {
if (Global.envir_preponderant != -1 || Global.environmental_influence != "") { // Simple models
if (Global.envir_preponderant == 1) {
faits = faits + "Influence of fishing effort on CPUE is preponderant" + s; // Models CPUE = f(E)
} else if (Global.effort_preponderant == 2) {
} else if (Global.envir_preponderant == 2) {
faits = faits + "Influence of Environment on CPUE is preponderant" + s; // Models CPUE = f(V)
}
}
......@@ -843,8 +845,6 @@ public class CadreMain extends JFrame {
faits = faits + "Age at the end of environmental influence: " + Global.end_influence_period + s;
}
String[] cpu_relation_E = {"", "Linear (Graham-Schaefer model)", "Exponential (Fox model)", "Generalized (Pella & Tomlinson model)", "", "", "Exponential_additive", "not Exponential with high variability of CPUE when overexploitation"};
String[] cpu_relation_V = {"", "Linear", "Exponential", "Power", "Power", "Non-monotonic", "", ""};
//System.out.println("In CadreMain.java Global.relationCPU_E = " + Global.relationCPU_E);
if (Global.relationCPU_E != 0) {
faits = faits + s + "Relationship between CPUE and E: " + cpu_relation_E[Global.relationCPU_E] + s;
......@@ -852,7 +852,7 @@ public class CadreMain extends JFrame {
//String[] cpu_v ={"Linear [CPUE=a+b.V]","General [CPUE=a+b.V^c]","Power [CPUE=a.V^b]","Quadratic: [CPUE=a.V+b.V^2+c]"};
//System.out.println("In CadreMain.java Global.relationCPU_V = " + Global.relationCPU_V);
if (Global.relationCPU_V != 0 && Global.relationCPU_E != 0) {
faits = faits + "Relation between CPUE and V: " + cpu_relation_V[Global.relationCPU_V] + s;
faits = faits + "Relationship between CPUE and V: " + cpu_relation_V[Global.relationCPU_V] + s;
}
else if (Global.relationCPU_V != 0) {
faits = faits + s + "Relation between CPUE and V: " + cpu_relation_V[Global.relationCPU_V] + s;
......@@ -907,8 +907,8 @@ public class CadreMain extends JFrame {
faits=faits+s+"***Jackknife R² estimate was negative and consequently set to zero.\nThis result is due to a poor fitting by the Marquart algorithm\nand it is commonly observed when the model does not include\nan intercept parameter or when the model includes a non-linear function.\nConsequently the display of the jackknife R² graph is not available." + s;
}
}
if (Global.message$[12] != "") // The estimate of the initial value of at least one of the parameter is equal to infinity.
faits=faits + s + Global.message$[12];
if (Global.message$[13] != "") // The estimate of the initial value of at least one of the parameter is equal to infinity.
faits=faits + s + Global.message$[13];
if (Global.message$[6] != "") // At least one of the noteworthy values of MSE is negative or \nlarger than 1.0E10
faits=faits + s + Global.message$[6];
else if (Global.message$[10] != "") // At least one of the central values of MSE is negative for noteworthy V values
......@@ -934,6 +934,8 @@ public class CadreMain extends JFrame {
faits=faits + s + Global.message$[9];
if (Global.message$[11] != "") // Please note that the MSY central value for the mean V value is 10 times larger than the maximum observed catch value.
faits=faits + s + Global.message$[11];
if (Global.message$[12] != "") // Please note that the MSE central value for the mean V value is 5 times larger than the maximum observed fishing effort value.
faits=faits + s + Global.message$[12];
}
}
}
......
......@@ -57,13 +57,13 @@ public class Cadre_Faits extends JFrame {
faits= "Data file path: " + Global.nom_fichier+s+s;
faits=faits + "Number of observed data (years): " +Data.getNbYears() + s+s;
//System.out.println("Flag ligne 60 Cadre_Faits.java Global.effort_preponderant = " + Global.effort_preponderant);
//System.out.println("Flag ligne 60 Cadre_Faits.java Global.envir_preponderant = " + Global.envir_preponderant);
if(Global.effort_preponderant !=-1 || Global.environmental_influence!="")
if(Global.envir_preponderant !=-1 || Global.environmental_influence!="")
{
if(Global.effort_preponderant ==1 )
if(Global.envir_preponderant ==1 )
faits=faits+ "Influence of fishing effort on CPUE is preponderant"+s;
else if(Global.effort_preponderant ==2)
else if(Global.envir_preponderant ==2)
faits=faits+"Influence of Environment on CPUE is preponderant"+s;
if(Global.nb_classes_exploitees!=-1)
{
......
......@@ -137,32 +137,32 @@ public class Cadre_Modele extends JDialog {
switch (RechercheModele.getType()) {
case RechercheModele.effort:
jTextAreaModele.setText("Knowing the relationship between CPUE and E is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.setText("Knowing that the relationship between CPUE and E is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("A possible conventional models CPUE=f(E) could be " + RechercheModele.getEquation());
jTextAreaModele.append("A possible conventional models CPUE=f(E) could be: " + RechercheModele.getEquation());
break;
case RechercheModele.climat:
jTextAreaModele.setText("Knowing the relationship between CPUE and V is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.setText("Knowing that the relationship between CPUE and V is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("A possible conventional models CPUE=f(V) could be " + RechercheModele.getEquation());
jTextAreaModele.append("A possible conventional models CPUE=f(V) could be: " + RechercheModele.getEquation());
break;
case RechercheModele.mixte:
if (Global.effort_preponderant == 1) {
if (Global.envir_preponderant == 1) {
jTextAreaModele.setText("Knowing that the model CPUE = f(E) is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.append("\n");
jTextAreaModele.append("Knowing the environment influences " + Global.environmental_influence);
jTextAreaModele.append("\n");
jTextAreaModele.append("Knowing that the relationship between residual CPUE and V is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("A possible mixed model could be " + RechercheModele.getEquation());
jTextAreaModele.append("A possible mixed model could be: " + RechercheModele.getEquation());
} else {
jTextAreaModele.setText("Knowing the relationship CPUE = f(V) is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.setText("Knowing that the relationship CPUE = f(V) is " + RechercheModele.getCpue_VRelation());
jTextAreaModele.append("\n");
jTextAreaModele.append("Knowing the environment influences " + Global.environmental_influence);
jTextAreaModele.append("Knowing that the environment influences " + Global.environmental_influence);
jTextAreaModele.append("\n");
jTextAreaModele.append("Knowing that the model CPUE resisudals = f(E) is " + RechercheModele.getCpue_ERelation());
jTextAreaModele.append("\n\t");
jTextAreaModele.append("A possible mixed model could be " + RechercheModele.getEquation());
jTextAreaModele.append("A possible mixed model could be: " + RechercheModele.getEquation());
}
break;
default:
......
......@@ -73,6 +73,11 @@ public class Cadre_ModeleDirect extends JFrame {
public Cadre_ModeleDirect() {
try {
Global.MSY_MSE_OK=false;
Modele.Flag_additive_model_fitted = false;
Global.environmental_influence = "";
Global.relationCPU_E=0;
Global.relationCPU_V=0;
nbFit = 0;
initWindow();
UtilCadre.Size(this, 60, 65); // 80, 85 -> 35, 40 Facteur de réduction fenetre "Fit a model directly" Test 2020
......@@ -324,18 +329,18 @@ public class Cadre_ModeleDirect extends JFrame {
/*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é.
et envir_preponderant en fonction du type de modèle selectioné.
ATTENTION, NE PASSE PAS PAR ICI (DONC PAS DE MISE A JOUR) SI ON NE RE-CLIQUE PAS SUR LA CATEGORIE
DE MODELE POUR METTRE A JOUR LE TYPE D'INFLUENCE DE L'ENVIRONNEMENT ET SUR LE MODELE POUR METTRE
A JOUR LA VARIABLE Global.effort_preponderant QUI NE DONNERA UN COMMENTAIRE QUE POUR LES MODELES
A JOUR LA VARIABLE Global.envir_preponderant QUI NE DONNERA UN COMMENTAIRE QUE POUR LES MODELES
CPUE=f(E) OU CPUE=f(V).
ejecutar al abrir la ventana.
*/
displayList(RechercheModele.getlisteModele(0));
EnvironmentsetEnabled(false);
Global.environmental_influence = Global.influenceEnv[0];
Global.effort_preponderant = 1;
//System.out.println("Flag 0 ModeleDirect.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
Global.envir_preponderant = 1;
//System.out.println("Flag 0 ModeleDirect.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
/*fin ejecutar*/
}
......@@ -343,40 +348,40 @@ public class Cadre_ModeleDirect extends JFrame {
displayList(RechercheModele.getlisteModele(0));
EnvironmentsetEnabled(false);
Global.environmental_influence = Global.influenceEnv[0];
Global.effort_preponderant = 1;
//System.out.println("Flag 1 ModeleDirect.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
Global.envir_preponderant = 1;
//System.out.println("Flag 1 ModeleDirect.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
}
void chkV_actionPerformed(ActionEvent e) { // Case CPUE=f(V).
displayList(RechercheModele.getlisteModele(1));
EnvironmentsetEnabled(true);
Global.environmental_influence = Global.influenceEnv[0];
Global.effort_preponderant = 2;
//System.out.println("Flag 2 ModeleDirect.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
Global.envir_preponderant = 2;
//System.out.println("Flag 2 ModeleDirect.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
}
void chkEVCatchability_actionPerformed(ActionEvent e) { // Case CPUE=f(E,V) effect on catchabilty.
displayList(RechercheModele.getlisteModele(2));
EnvironmentsetEnabled(false);
Global.environmental_influence = Global.influenceEnv[2];
Global.effort_preponderant = -1;
//System.out.println("Flag 3 ModeleDirect.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
Global.envir_preponderant = -1;
//System.out.println("Flag 3 ModeleDirect.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
}
void chkEVAbundance_actionPerformed(ActionEvent e) { // Case CPUE=f(E,V) effect on abundance.
displayList(RechercheModele.getlisteModele(3));
EnvironmentsetEnabled(true);
Global.effort_preponderant = -1;
Global.envir_preponderant = -1;
Global.environmental_influence = Global.influenceEnv[1];
//System.out.println("Flag 4 ModeleDirect.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
//System.out.println("Flag 4 ModeleDirect.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
}
void chkEVBoth_actionPerformed(ActionEvent e) { // Case CPUE=f(E,V) effect on both.
displayList(RechercheModele.getlisteModele(4));
EnvironmentsetEnabled(true);
Global.effort_preponderant = -1;
Global.envir_preponderant = -1;
Global.environmental_influence = Global.influenceEnv[3];
//System.out.println("Flag 5 ModeleDirect.java Global.effort_preponderant = " + Global.effort_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
//System.out.println("Flag 5 ModeleDirect.java Global.envir_preponderant = " + Global.envir_preponderant + " Global.environmental_influence = " + Global.environmental_influence);
}
void cmdFitted_actionPerformed(ActionEvent e) { // INUTILISE ????.
......@@ -628,8 +633,13 @@ repeated in the QuestionReponse.java file, cases 17, 52, 57 & 58.
nbFit++;
MsgDialogBox msg;
if (Global.message$[12] != "") // The estimate of the initial value of at least one of the parameter is equal to infinity.
msg = new MsgDialogBox(0, Global.message$[12], 0, Global.CadreMain);
if ((Global.numero_modele < 6 && Global.numero_modele > 1) || Global.numero_modele == 20 || Global.numero_modele == 33) {// Modèles CPUE=f(V) et modèle exponentiel additif
msg = new MsgDialogBox(0, "MSY and MS-E graphs are not justified or available for this model.\nPlease continue.", 0, this);
for (int n=1; n<5;n++) Global.message$[n] = "";
for (int n=6; n<14;n++) Global.message$[n] = "";
}
if (Global.message$[13] != "") // The estimate of the initial value of at least one of the parameter is equal to infinity.
msg = new MsgDialogBox(0, Global.message$[13], 0, Global.CadreMain);
if (Global.message$[0] != "") // Likely problem in Jackknife computation.
msg = new MsgDialogBox(0, Global.message$[0], 0, Global.CadreMain);
if (Global.message$[6] != "") // At least one of the central values of MSE is larger than 1.0E10 for noteworthy V values
......@@ -658,6 +668,8 @@ repeated in the QuestionReponse.java file, cases 17, 52, 57 & 58.
msg = new MsgDialogBox(0, Global.message$[9], 0, Global.CadreMain);
if (Global.message$[11] != "")// Please note that the MSY central value for the mean V value is 10 times larger than the maximum observed catch value.
msg = new MsgDialogBox(0, Global.message$[11], 0, Global.CadreMain);
if (Global.message$[12] != "")// Please note that the MSE central value for the mean V value is 5 times larger than the maximum observed fishing effort value.
msg = new MsgDialogBox(0, Global.message$[12], 0, Global.CadreMain);
}
}
}
......
......@@ -64,7 +64,7 @@ public class Global {
static int effort_increasing; // Constantly increasing effort
static int decreasing_relationship; // Does this plot appear to be decreasing
static int effort_preponderant; // Is the influence of fishing effort on CPUE more important than environmental influence
static int envir_preponderant; // Is the influence of fishing effort on CPUE more important than environmental influence
/*
* *********Réponses aux questions***************************
......@@ -98,7 +98,7 @@ public class Global {
*/
static double fF, r_jk;
static String fFsignif$;
static String [] message$ ={"","","","","","","","","","","","","",""};
static String [] message$ ={"","","","","","","","","","","","","","",""};
static int Min_95_Noteworthy_MSE;
static int Min_95_Noteworthy_MSY;
static int Max_95_Noteworthy_MSE;
......@@ -152,7 +152,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();
//WARNING: NE PAS REMPLACER R2 PAR R² DANS LIGNES SUIVANTES CAR SINON NON DE FICHIER PAR RECONNU PAR HTML.
static String[] titreG = {"Y Time Plot", "CPUE Time Plot", "E Time Plot", "V 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[] titreG = {"Y Time Plot (unlagged)", "CPUE Time Plot (unlagged)", "E Time Plot (unlagged)", "V Time Plot (unlagged)", "E Distribution (unlagged)", "V Distribution (unlagged)", "Y Distribution (unlagged)", "CPUE Distribution (unlagged)", "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 = {"Catches (Y)", "CPUE ", "Effort (E)", "Environment (V)", "Nb", "Nb", "Nb", "Nb", "Catches (Y)", "Catches (Y)", "CPUE", "CPUE", "CPUE", "CPUE", " Residual", "Residual", "Residual", "a (%)", "b (%)", "c (%)", "d (%)", "R² (%)", "Catches (Y)", "Catches (Y)", "CPUE", "CPUE", "MSY", "MSE"};
......@@ -227,7 +227,7 @@ public class Global {
effort_increasing = -1; // Constantly increasing effort
decreasing_relationship = -1; // Does this plot appear to be decreasing
effort_preponderant = -1; // Is the influence of fishing effort on CPUE more important than environmental influence
envir_preponderant = -1; // Is the influence of fishing the environment on CPUE more important than the influence of fishing effort influence
/**
* ************************************
......
......@@ -318,7 +318,7 @@ public static void ClickWarning() {
case 17:
Global.nb_classes_exploitees = index;
if (Global.nb_classes_exploitees > 5 && Global.nb_classes_exploitees < 9) {
throw new OnError("WARNING! \nA stock with more than 5 significantly exploited year-classes is not ideal for applying \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. \nYou can still continue by clickin on the Next(N) button.");
throw new OnError("WARNING! \nA stock with more than 5 significantly exploited year-classes is not ideal for applying \nsurplus production models that make use of the transition prediction approach (past-effort-averaging) of \nFox (1975) which constitues an improvent of Gulland (1961, 1969) methods. \nThis 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. \nYou can still continue by clickin on the Next(N) button.");
}
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) \nofFox (1975). This method is used in CLIMPROD to fit data on non-equilibrium conditions. It simulate the \nequilibrium by using a weighted average of fishing effort (E). \nIt is recommanded to stop here your research or revise your answer if necessary.");
......@@ -326,15 +326,15 @@ public static void ClickWarning() {
break;
case 18:
Global.relationCPU_E = 0; //Initialisations pour prendre
Global.relationCPU_V = 0; //en compte le changement
Global.recruitment_age = 0; // de la prpondrence
Global.relationCPU_V = 0; //en compte le changement (si usage touche 'Previous')
Global.recruitment_age = 0; // de la prépondérence
Global.begin_influence_period = 0; //de l'effort ou de l'environement
Global.end_influence_period = 0;
if (index == 1) { index = 2 ;} // Modif 2020 pour faire en sorte que reponse "I don't know" branche sur prépondérance effort sans devoir tout modifier.
else{
if (index == 2) index = 1;
}
Global.effort_preponderant = index;
Global.envir_preponderant = index;
if (index == 3) {
index = 1;
Global.typeModele = index;
......@@ -344,7 +344,6 @@ public static void ClickWarning() {
break;
case 19:
if(index==3) {
Global.decreasing_relationship = 2;
throw new OnError("It is compulsory to know the answer to this question. \nPlease have a look at the help file using the 'Help (H)' button if necessary.");
}
else Global.decreasing_relationship = index;
......@@ -372,18 +371,18 @@ public static void ClickWarning() {
case 71:
Global.lifespan = index;
if (Global.lifespan < Global.nb_classes_exploitees) {
throw new OnError("There is a contratiction between your answer. \nYou declared a life span of " + Global.lifespan + " years and a number of exploited year-classes of " + Global.nb_classes_exploitees + " years. \nPlease revise your answer(s).");
throw new OnError("There is a contradiction between your answer. \nYou declared a life span of " + Global.lifespan + " years and a number of exploited year-classes of " + Global.nb_classes_exploitees + " years. \nPlease revise your answer(s).");
}
break;
case 24:
case 72:
Global.rapport_vie_exploitee_inferieur_deux = index;
if (Global.rapport_vie_exploitee_inferieur_deux == 1 && (Global.lifespan / Global.nb_classes_exploitees) >= 2) {
throw new OnError("There is a contratiction between your answers. You declared: \n-a ratio lifespan / number of exploited year-classes < 2; \n-a life span of " + Global.lifespan + " years; \n-a number of exploited year-classes of " + Global.nb_classes_exploitees + " years. \nPlease revise your answer(s).");
throw new OnError("There is a contradiction between your answers. You declared: \n-a ratio lifespan / number of exploited year-classes < 2; \n-a life span of " + Global.lifespan + " years; \n-a number of exploited year-classes of " + Global.nb_classes_exploitees + " years. \nPlease revise your answer(s).");
}
else {
if (Global.rapport_vie_exploitee_inferieur_deux == 2 && (Global.lifespan / Global.nb_classes_exploitees) < 2) {
throw new OnError("There is a contratiction between your answers. You declared: \n-a ratio lifespan / number of exploited year-classes >= 2; \n-a life span of " + Global.lifespan + " years; \n-a number of exploited year-classes of " + Global.nb_classes_exploitees + " years. \nPlease revise your answer(s).");
throw new OnError("There is a contradiction between your answers. You declared: \n-a ratio lifespan / number of exploited year-classes >= 2; \n-a life span of " + Global.lifespan + " years; \n-a number of exploited year-classes of " + Global.nb_classes_exploitees + " years. \nPlease revise your answer(s).");
}
}
break;
......@@ -418,7 +417,6 @@ public static void ClickWarning() {
Global.cpue_sous_sur_production = index;
break;
case 48:
case 50:
case 59:
Global.linear_relationship = index;
if (index == 1) {
......@@ -500,7 +498,7 @@ public static void ClickWarning() {
throw new OnError("It is compulsory to know the answer to this question. \nPlease have a look at the help file using the 'Help (H)' button if necessary.");
}
break;
case 99:
case 99:
Global.acceptable_graphs = index;
if(Global.acceptable_graphs==3) {
Global.acceptable_graphs = 2;
......
......@@ -257,11 +257,11 @@ public static String getCpue_VRelation(){
case lineaire:
return "linear";
case general:
return "power with intersept";
return "power";
case power:
return "power";
case quadratique:
return "non-monotonic";
return "dome-shaped";
default:
return "";
}
......
May the stock present large fluctuations in CPUE when overexploited?
May the stock present large fluctuations in CPUE due to the environement when overexploited?
If you answer YES, the program will try to fit a particular model which
supposes that the relationship between fishing effort and CPUE is
......
Does this plot look monotonic ?
Does this plot look monotonic?
You have to answer YES if the relationship between the two variables
seems monotonic, permanently increasing or decreasing, but not dome-shaped.
......
Is interannual variability too large?
Is the interannual variability too large?
Answer YES if the time-plot of one of the two dependent variables, effort
(E) or environment (V) presents fluctuations of high amplitude without
......
Strong instability in the CPUE time-series?
Is there a strong instability in the cpue time series?
Answer YES if the CPUE time-series presents large fluctuations in a short
time (over 100%, not autocorrelated, providing an erratic aspect of the plot).
......
Do you validate the model from the graphical and statistical results that appear in the Jackknife plots window titles (p values of t-ratios of the parameters, R² values, p value of F)?
Do you validate the model from the graphical and statistical results that appear in the Jackknife plots window titles (p values of t-ratios of the parameters, R2 values, p value of F)?
You reached this step because the coefficient of determination R² of the retained model is over the empirical threshold of 0.70 if the software selected a mixed model CPUE=f(E,V), or 0.90 if a simple model CPUE=f(E) or CPUE=f(V) was selected. These threshold values are extremely conservative, even when the number of degrees of freedom of the fit is low. The reasons for this choice are as follows:
You reached this step because the coefficient of determination R2 of the retained model is over the empirical threshold of 0.70 if the software selected a mixed model CPUE=f(E,V), or 0.90 if a simple model CPUE=f(E) or CPUE=f(V) was selected. These threshold values are extremely conservative, even when the number of degrees of freedom of the fit is low. The reasons for this choice are as follows:
1) regardless of the type of model, all the time-series involved (CPUE, E and V) use to be autocorrelated, which artificially increase the R² value.
1) regardless of the type of model, all the time-series involved (CPUE, E and V) use to be autocorrelated, which artificially increase the R2 value.
2) regarding mixed models CPUE=f(E,V) and simple models CPUE=f(E), by construction the dependent variable CPUE and the independent variable E are correlated (CPUE=Catches/E), which also artificially increase the R² value.
2) regarding mixed models CPUE=f(E,V) and simple models CPUE=f(E), by construction the dependent variable CPUE and the independent variable E are correlated (CPUE=Catches/E), which also artificially increase the R2 value.
3) regarding simple models CPUE=f(E) or CPUE=f(V) the R² threshold value was even more conservative than for mixed models for different reasons. In the first case it is because the single independent variable E is not independent from CPUE (reason 2 above), whereas in the case of mixed model variable V is supposed to be independent from CPUE. In the second case it is because CPUE=f(V) is not a surplus production model but an empirical equation that can be used for prediction only if the R² value is high and if E does not vary significantly or remains at an extremely low value.
3) regarding simple models CPUE=f(E) or CPUE=f(V) the R2 threshold value was even more conservative than for mixed models for different reasons. In the first case it is because the single independent variable E is not independent from CPUE (reason 2 above), whereas in the case of mixed model variable V is supposed to be independent from CPUE. In the second case it is because CPUE=f(V) is not a surplus production model but an empirical equation that can be used for prediction only if the R2 value is high and if E does not vary significantly or remains at an extremely low value.
Despite the need of using empirical thresholds of conventional R² values to select a convenient model, we feel useful to provide the values of the jackknife coefficient R², the adjusted R² and the p value of the Fisher test (F). Indeed the conventional R² has problems that the jackknife coefficient R² and the adjusted R² are designed to address (predicted R² is another option with a principle of resampling similar to jackknife):
Despite the need of using empirical thresholds of conventional R2 values to select a convenient model, we feel useful to provide the values of the jackknife coefficient R2, the adjusted R2 and the p value of the Fisher test (F). Indeed the conventional R2 has problems that the jackknife coefficient R2 and the adjusted R2 are designed to address (predicted R2 is another option with a principle of resampling similar to jackknife):
1) If a model has too many predictors, too many parameters or higher order polynomials, it begins to model the random noise in the data. This condition is known as overfitting the model and it produces misleadingly high R-squared values and a lessened ability to make predictions.
2) Every time you add a predictor to a model, the R-squared increases, even if due to chance alone. It never decreases. Consequently, a model with more terms may appear to have a better fit simply because it has more terms.
But please note that the use of any R² expression is controversed in multiple regression which is the case of all mixed model CPUE = f(E,V).
But please note that the use of any R2 expression is controversed in multiple regression which is the case of all mixed model CPUE = f(E,V).
In conclusion there is no way to validate the fit of a surplus production model from statistical results only. We can only recommand to validate the model if:
a) the jackknife graphics show moderate variations around 100% and a fair distribution above and below this value;
b) the p values of t-ratios of the parameters are at least <0.05 (with a possible exception for the value of the intercept of the function, usually parameter 'a');
c) the the adjusted R² and the jackknife coefficient R² are respectively above 0.65 and 0.60;
c) the the adjusted R2 and the jackknife coefficient R2 are respectively above 0.65 and 0.60;
d) the p value of F is at least <0.05 (p<0.01 recommended).
If you are too far from the empirical thresholds indicated in b), c) and d) a warning will be displayed.
......