Bonsoir,
J’espère que votre confinement se passe bien !
Une petite question java : je voudrais calculer le nombre d’œufs produits pendant la période de fraye d’un seul mois sur une seule zone de pop avec le calcul suivant (champ ‘équation de reproduction’ dans
le panneau ‘Reproductions’)
// nombre d'oeufs produits = somme sur les groupes 4 à 7 du calcul sexRatio*fecondite*[nombre de poissons dans le groupe]*[leur poids]
Je suis complètement nouveau en java donc je ne sais trop comment obtenir les valeurs entre crochets, mais je pensais à un truc comme ça :
//double prodOeufs = 0;
//
//for(PopulationGroup g : pop.getPopulationGroup().get()){
// if (g < 4) {
// return 0;
// } else {
// double res = sexRatio * 2*fecParGonade * pop.getPopulationGroup(g).getMeanWeight() * pop.getPopulationGroup(g).getAboundance().sumAll();
// prodOeufs = prodOeufs + res;
// }
//}
//return prodOeufs;
Mais j’obtiens les erreurs suivantes :
1. ERROR in D:\DATA\a.bach\isis-fish-4\isis-temp\tmp-20200319112700-1491086668\checkPopulationReproductionEquation1429431846243759405Equation.java (at line 23)
if (g < 4) {
^^^^^
The operator < is undefined for the argument type(s) PopulationGroup, int
----------
2. ERROR in D:\DATA\a.bach\isis-fish-4\isis-temp\tmp-20200319112700-1491086668\checkPopulationReproductionEquation1429431846243759405Equation.java (at line 26)
double res = sexRatio * 2*fecParGonade * pop.getPopulationGroup(g).getMeanWeight() * pop.getPopulationGroup(g).getAboundance().sumAll();
^^^^^^^^^^^^^^^^^^
The method getPopulationGroup() in the type Population is not applicable for the arguments (PopulationGroup)
----------
3. ERROR in D:\DATA\a.bach\isis-fish-4\isis-temp\tmp-20200319112700-1491086668\checkPopulationReproductionEquation1429431846243759405Equation.java (at line 26)
double res = sexRatio * 2*fecParGonade * pop.getPopulationGroup(g).getMeanWeight() * pop.getPopulationGroup(g).getAboundance().sumAll();
^^^^^^^^^^^^^^^^^^
The method getPopulationGroup() in the type Population is not applicable for the arguments (PopulationGroup)
----------
3 problems (3 errors)
Pourriez-vous me donner un petit coup de main ou partager un script faisant sensiblement le même calcul ?
Merci et bonne soirée,
Adrian