Commit 93a790b2 authored by pfreon's avatar pfreon
Browse files

Major changes related to test of consistancy between answers reltated to age...

Major changes related to test of consistancy between answers reltated to age and renumbering of cases (decisions)

Major changes related to test of consistancy between answers reltated to age and renumbering of cases (decisions).
Declaration of new variables related to jackknife in Global.java
parent bc1fc19b
......@@ -85,9 +85,14 @@ public class Global {
static int cpue_sous_sur_production; // May the stock present large fluctuations in CPUE when overexploited
static double jackknife; // Reasonable jackknife coefficient R2 (>65% recommended), no extreme yearly coefficient, and acceptable MSY graph
static double jackknife;
static boolean test_jackknife;
static int coeff_determination_instable;
static String [] param$={"a","b","c","d"}; // Rajout 2020.
static String[] Test_Jackknife_Param$={" (good)"," (bad)"}; // Rajout 2020.
static int Res_Test_Jackknife_Param; // Rajout 2020.
static int[] Res_Test_Jackknife_Par = new int[5]; // Rajout 2020. int[] a = new int[1];
static int coeff_determination_instable; // Reasonable jackknife coefficient R2 (>65% recommended), no extreme yearly coefficient, and acceptable MSY graph
static int acceptable_graphs; // Graphs MSY & MSE acceptable
/**
* *******Variables de travail ********
*/
......@@ -119,6 +124,7 @@ public class Global {
static int[] Nb_years_lower100; // Rajout 2020.
static int [] Nb_years_greater100; // Rajout 2020.
static String Texte_erreur_jackknife$; // Rajout 2020.
/**
* *********** Plots ************************
*/
......
......@@ -146,6 +146,7 @@ public class QuestionReponse {
@return un entier le num�ro de r�gle, ou -1 si pas de question associ�e.
*/
public static int getNumRegle() {
System.out.println("Dans QuestionReponse.java numEnCours = " + numEnCours + " indexEnCours = " + indexEnCours);
if (numEnCours >= 0) {
return regle[indexEnCours];
} else {
......@@ -229,9 +230,9 @@ public class QuestionReponse {
//System.out.println("BBB i guess answer is : "+reptxt);
Global.questionDic.put(numEnCours, questxt); // Texte de la question.
Global.answerDic.put(numEnCours, reptxt); // Réponse à la question.
System.out.println("Dans QuestionReponse.java ligne 232, numEnCours: " + numEnCours + " questxt: " + questxt + " reptxt: " + reptxt + " commentTxt: " + commentTxt);
//System.out.println("Dans QuestionReponse.java ligne 232, numEnCours: " + numEnCours + " questxt: " + questxt + " reptxt: " + reptxt + " commentTxt: " + commentTxt);
Global.warningDic.put(numEnCours, commentTxt);
// System.out.println("Dans QuestionReponse.java ligne 234, Global.warningDic: " + Global.warningDic + " commentTxt: " + commentTxt);
//System.out.println("Dans QuestionReponse.java ligne 234, Global.warningDic: " + Global.warningDic + " commentTxt: " + commentTxt);
try {
switch (numEnCours) {
case 2: // Suite à réorganisation ordre des questions posées. Modif. 2020.
......@@ -299,8 +300,8 @@ public class QuestionReponse {
Global.decreasing_relationship = index;
break;
case 20:
case 69:
case 20: // Vide car traitement identique pour decisions 20 et 69.
case 68:
// Global.relationCPU_E=index;
if (index == 1) {
Global.relationCPU_E = RechercheModele.lineaire;
......@@ -309,63 +310,81 @@ public class QuestionReponse {
}
break;
case 21:
case 70:
case 69:
Global.pessimiste = index;
break;
case 22:
case 71:
case 70:
Global.stock_deja_effondre = index;
break;
case 23:
case 72:
case 23:;
case 71:
Global.lifespan = index;
//System.out.println("lifespan " +Global.lifespan );
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).");
}
break;
case 24:
case 73:
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).");
}
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).");
}
}
break;
// case 25: // Cas supprimé car doublon avec metapopulation
// case 74: // Cas supprimé car doublon avec metapopulation
// Global.stock_divise = index;
// break;
case 26:
case 75:
case 25:
case 73:
Global.reserves_naturelles = index;
break;
case 27:
case 76:
case 26:
case 74:
Global.premiere_reproduction_avant_recrutement = index;
break;
case 28:
case 77:
case 27:
case 75:
Global.fecondite_faible = index;
break;
case 29:
case 78:
case 28:
case 76:
Global.cpue_unstable = index;
break;
case 47:
case 67:
case 46:
case 66:
//String[] influence={"abundance","catchability","both"};//probl�me du both
Global.environmental_influence = Global.influenceEnv[index];
Global.typeModele = RechercheModele.mixte;
break;
case 48:
case 68:
case 47:
case 67:
Global.cpue_sous_sur_production = index;
break;
case 49:
case 51:
case 60:
case 48:
case 50:
case 59:
Global.linear_relationship = index;
if (index == 1) {
Global.relationCPU_V = RechercheModele.lineaire;
}
break;
case 50:
case 61:
/* case 50:
Global.linear_relationship = index;
if (index == 1) {
Global.relationCPU_V = RechercheModele.lineaire;
}
else
throw new OnError(\n(that is age at recruitment + number of significantly exploited year classes - 1) \nthen there is no point in using a model incorporating an environmental variable. \nPlease modify your age selection(s)");
break;
*/
case 49:
case 60:
Global.monotonic_relationship = index;
if (index == 1) {
Global.relationCPU_V = RechercheModele.general;
......@@ -374,19 +393,19 @@ public class QuestionReponse {
}
break;
case 52:
case 57:
case 51:
case 56:
Global.recruitment_age = index;
break;
case 53:
case 58:
case 52:
case 57:
Global.begin_influence_period = index - 1;
if (Global.begin_influence_period > (Global.recruitment_age + Global.nb_classes_exploitees)) {
throw new OnError("If the age at the begining of environmental influence occurs \nafter the age of the last exploited year class \n(that is age at recruitment + number of significantly exploited year classes - 1) \nthen there is no point in using a model incorporating an environmental variable. \nPlease modify your age selection(s)");
}
break;
case 54:
case 59:
case 53:
case 58:
Global.end_influence_period = index - 1;
if (Global.end_influence_period < Global.begin_influence_period) {
throw new OnError("Age at the end of environmental influence must be larger than or equal to \nage at the begining of environmental influence. \nPlease use the 'Previous' button to modify your answer(s)");
......@@ -396,16 +415,18 @@ public class QuestionReponse {
}
Data.init_val();
break;
case 97:
case 95:
Global.good_results = index;
break;
case 98:
case 96:
Global.trend_residuals = index;
break;
case 100:
case 98:
Global.coeff_determination_instable = index;
break;
case 99:
Global.acceptable_graphs = index;
break;
}
}catch (Exception e) {
new MsgDialogBox(0, e.getMessage(), 0, Global.CadreMain);
......@@ -423,7 +444,6 @@ public class QuestionReponse {
public static void nextQuestion(int index) {
raisonnement.add(numEnCours);
//indexEnCours=Integer.parseInt((String)htNum.get(Integer.toString(numEnCours)));
// System.out.println(indexEnCours+ " "+numEnCours );
if (index == 0) //MODIF ICI 0
{
numEnCours = rTrue[indexEnCours];
......@@ -519,7 +539,7 @@ public class QuestionReponse {
@return boolean
*/
public static boolean displayQuestion() {
String tc = TexteRegles.getComment(); // Commentaire dans "Current known facts" de la fenêtre principale.
String tc = TexteRegles.getComment(); // Commentaire dans "Current known facts" de la fenêtre principale.
if (scriptEnCours != null) {
return true;
} else return (type[indexEnCours] == Global.fixationM && (!(tc == null) && !tc.equals("")));
......
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