hello une aide ? merci Stephanie 1. ERROR in C:\Users\smahevas\C-ISISFish\isis-fish-4\isis-temp\tmp-20221201094535-853357926\checkPopulationReproductionEquation10797508798142475965Equation.java (at line 52) case 5,6,7,8,9,10,11,12,13,14 : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Multi-constant case labels supported from Java 14 onwards only avec java version "17.0.2" 2022-01-18 LTS Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86) Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing) et le script reproduction complet : double Ktemp = context.getValueAndCompute("nephrops.reproductionEquation.Ktemp", 1); int Kint = (int)Ktemp; TimeStep step = context.getSimulationControl().getStep(); int y = step.getYear(); MatrixND Biom = context.getResultManager().getMatrix(step,pop,"matrixBiomass"); for (MatrixIterator i=Biom.iterator(); i.hasNext();) { i.next(); Object [] sems = i.getSemanticsCoordinates(); PopulationGroup group = (PopulationGroup)sems[0]; i.setValue(i.getValue()* group.getMaturityOgive()); } MatrixND prop = Biom.sumOverDim(0).reduceDims(0); double ssb = Biom.sumAll(); prop = prop.divs(ssb); double Rtot=0.0; switch(Kint){ case 1 : // Beverton & Holt double abv = 1; double bbv = 1; Rtot = abv*ssb/(bbv+ssb); break; case 2 : // a*ssb*exp(-b*ssb) - Ricker double ar=0.5; double br=0.005; Rtot = ar*ssb*Math.exp(-br*ssb); break; case 3 : // Hockey Stick double ahs=10; double ssbt = 7.3E7 ; if (ssb < ssbt) {Rtot = ahs*ssb;} else {Rtot = ahs*ssbt;} break; case 4 : // repro fecondite double compt=0; for (Zone zone : zoneRepro){ compt=0; for (PopulationGroup group : groups){ double cf = Ktemp * group.getReproductionRate(); compt += N.getValue(group, zone) * cf; } result.setValue(zone, compt*prepro); } break; case 5,6,7,8,9,10,11,12,13,14 : // aleatoire unif[min-max] double [][] matrixR = {{0.11178995, 0.95123978, 0.05388496, 0.30427033, 0.88097277}, {0.61318827, 0.86325772, 0.59521774, 0.97951352, 0.39522985}, {0.84762444, 0.81945931, 0.17035498, 0.98107093, 0.30626818}, {0.73545519, 0.52408773, 0.56679328, 0.90386484, 0.94130219}, {0.84378708, 0.14061830, 0.23156422, 0.71417364, 0.54878101}, {0.64332233, 0.01433846, 0.22262234, 0.65167476, 0.22910183}, {0.06130198, 0.40996938, 0.97397125, 0.69185333, 0.29951089}, {0.67789114, 0.43629884, 0.52475169, 0.14057724, 0.98577644}, {0.90164408, 0.68106970, 0.85784589, 0.20025039, 0.97989699}, {0.54700931, 0.07277969, 0.04077778, 0.37232379, 0.95016336} }; double ssbtmin = 7.3E7; double ssbtmax = 9.0E7; Rtot = matrixR[Kint][y]*(ssbtmax-ssbtmin)+ssbtmin; break; } // fin du switch if (Kint!=4) { for(Zone zone:zoneRepro){ double propZone=prop.getValue(zone); result.setValue(zone,propZone*Rtot); } } return 0; -- ...................................................................... Stephanie MAHEVAS UMR DECOD (Dynamique et durabilité des écosystèmes : de la source à l'océan) IFREMER/HALGO/EMH (Ecologie et Modèles pour l'Halieutique) https://annuaire.ifremer.fr/cv/16343/ Tel: (33) 2 40 37 41 81 - 06 75 83 59 33 o \ o / _ o __| \ / |__ o _ \ o / o /|\ | /\ ___\o \o | o/ o/__ /\ | /|\ / \ / \ | \ /) | ( \ /o\ / ) | (\ / | / \ / \ ......................................................................
Bonjour, Les versions 4.4.x tournent toujours avec java 8 minimum, donc les scripts sont toujours compilés avec la syntaxe java 8. Cela changera en version 4.5.x qui imposera un minimum de java 17, mais on ne l'a toujours pas sorti Donc pour l'instant, la syntaxe est: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: // aleatoire unif[min-max ... break; Le 01/12/2022 à 12:48, Stephanie MAHEVAS a écrit :
hello
une aide ? merci Stephanie
1. ERROR in C:\Users\smahevas\C-ISISFish\isis-fish-4\isis-temp\tmp-20221201094535-853357926\checkPopulationReproductionEquation10797508798142475965Equation.java (at line 52) case 5,6,7,8,9,10,11,12,13,14 : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Multi-constant case labels supported from Java 14 onwards only
avec java version "17.0.2" 2022-01-18 LTS Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86) Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)
et le script reproduction complet : double Ktemp = context.getValueAndCompute("nephrops.reproductionEquation.Ktemp", 1); int Kint = (int)Ktemp; TimeStep step = context.getSimulationControl().getStep(); int y = step.getYear();
MatrixND Biom = context.getResultManager().getMatrix(step,pop,"matrixBiomass");
for (MatrixIterator i=Biom.iterator(); i.hasNext();) { i.next(); Object [] sems = i.getSemanticsCoordinates(); PopulationGroup group = (PopulationGroup)sems[0]; i.setValue(i.getValue()* group.getMaturityOgive()); } MatrixND prop = Biom.sumOverDim(0).reduceDims(0); double ssb = Biom.sumAll(); prop = prop.divs(ssb);
double Rtot=0.0;
switch(Kint){
case 1 : // Beverton & Holt double abv = 1; double bbv = 1; Rtot = abv*ssb/(bbv+ssb); break; case 2 : // a*ssb*exp(-b*ssb) - Ricker double ar=0.5; double br=0.005; Rtot = ar*ssb*Math.exp(-br*ssb); break; case 3 : // Hockey Stick double ahs=10; double ssbt = 7.3E7 ; if (ssb < ssbt) {Rtot = ahs*ssb;} else {Rtot = ahs*ssbt;} break; case 4 : // repro fecondite double compt=0; for (Zone zone : zoneRepro){ compt=0; for (PopulationGroup group : groups){ double cf = Ktemp * group.getReproductionRate(); compt += N.getValue(group, zone) * cf; } result.setValue(zone, compt*prepro); } break; case 5,6,7,8,9,10,11,12,13,14 : // aleatoire unif[min-max] double [][] matrixR = {{0.11178995, 0.95123978, 0.05388496, 0.30427033, 0.88097277}, {0.61318827, 0.86325772, 0.59521774, 0.97951352, 0.39522985}, {0.84762444, 0.81945931, 0.17035498, 0.98107093, 0.30626818}, {0.73545519, 0.52408773, 0.56679328, 0.90386484, 0.94130219}, {0.84378708, 0.14061830, 0.23156422, 0.71417364, 0.54878101}, {0.64332233, 0.01433846, 0.22262234, 0.65167476, 0.22910183}, {0.06130198, 0.40996938, 0.97397125, 0.69185333, 0.29951089}, {0.67789114, 0.43629884, 0.52475169, 0.14057724, 0.98577644}, {0.90164408, 0.68106970, 0.85784589, 0.20025039, 0.97989699}, {0.54700931, 0.07277969, 0.04077778, 0.37232379, 0.95016336} }; double ssbtmin = 7.3E7; double ssbtmax = 9.0E7; Rtot = matrixR[Kint][y]*(ssbtmax-ssbtmin)+ssbtmin; break;
} // fin du switch if (Kint!=4) { for(Zone zone:zoneRepro){ double propZone=prop.getValue(zone); result.setValue(zone,propZone*Rtot); } } return 0;
-- Éric Chatellier - www.codelutin.com - 02.40.50.29.28
Merci Eric maintenant j'ai une erreur à la simulation avec une matrice null dans l'équation de repro MatrixND Biom = context.getResultManager().getMatrix(step,pop,"matrixBiomass"); Une idée ? merci Stephanie PS : log de la simu ci-dessous et Base attachée INFO|16:55:43,373|InProcessSimulatorLauncher.java|338|localSimulateSameThread|02/12/2022 16:55 Java version: 17.0.2+8-LTS-86 Isis-fish version: 4.4.7.1 INFO|16:55:44,037|InProcessSimulatorLauncher.java|199|message|Mise en place des aspects Cache INFO|16:55:44,037|SimulationControl.java|206|setText|Mise en place des aspects Cache INFO|16:55:46,046|DataStorage.java|163|getMemStorage|Create new memory storage for sim_test_Ktemp=1_NlleParam_2022-12-02-16-55 INFO|16:55:46,187|DataStorage.java|206|getStorage|Create new storage for sim_test_Ktemp=1_NlleParam_2022-12-02-16-55 INFO|16:55:47,185|InProcessSimulatorLauncher.java|199|message|Simulation execution INFO|16:55:47,185|SimulationControl.java|206|setText|Simulation execution INFO|16:55:47,187|SimulationContext.java|497|message|Ex�cution des scripts de Presimulation INFO|16:55:47,187|SimulationControl.java|206|setText|Ex�cution des scripts de Presimulation INFO|16:55:49,988|InProcessSimulatorLauncher.java|431|localSimulateSameThread|Matrix backend: org.nuiton.math.matrix.DoubleBigVector and org.nuiton.math.matrix.DoubleSparseHashVector threshold: 1000 INFO|16:55:50,538|IsisCacheBackendOnGuava.java|238|adjustedCache|Cache size ajusted to 524Mo (equivalent to 0 step need) INFO|16:55:51,008|SimulationControl.java|206|setText|Rules initialisation:[] INFO|16:55:51,012|SimulationControl.java|206|setText|begin step janvier 0 INFO|16:55:51,013|SimulationControl.java|206|setText|Reloading parameters INFO|16:56:07,573|ResultManager.java|199|isEnabled|Enabled result: [MatrixCatchWeightPerStrategyMetPerZoneMet, MatrixGrossValueOfLandingsPerSpeciesPerStrategyMet, MatrixFishingMortalityPerGroup, MatrixTotalFishingMortality, MatrixCatchPerStrategyMetPerZonePop, MatrixEffortPerStrategyMet, MatrixBiomassBeginMonth, MatrixDiscardsWeightPerStrMetPerZonePop, MatrixEffortNominalPerStrategyMet, MatrixAbundanceBeginMonth, MatrixLandingWeight, MatrixCatchWeightPerStrategyMetPerZonePop, MatrixDiscardsPerStrMetPerZonePop, MatrixRecruitment, MatrixBiomass, MatrixLandingPerMet, MatrixPrice, MatrixCatchPerStrategyMetPerZoneMet] INFO|16:56:07,574|SimulationControl.java|206|setText|Evaluate rules conditions (0 rules) INFO|16:56:07,574|SimulationControl.java|206|setText|Do pre action Rules INFO|16:56:07,575|SimulationControl.java|206|setText|Simulate one month INFO|16:56:07,577|DefaultSimulator.java|402|computeMonth|====================== begin janvier 0 - nephrops =========================== 1669996567577 INFO|16:56:07,577|DefaultSimulator.java|405|computeMonth|N: MatrixAbundance matrix2D [ 0.0,1.4309089265317112E7,7408039.342961735,3173610.116658289,6297.974759062383,677.7632347561727,211.04112908742843,111.83383370116178,161.2681928010814,247.9781172579105, 0.0,2.1106035031292573E7,8600855.628066646,2.6293558773127336E7,1296807.2106219255,611209.2665056415,249066.86359242332,103943.38399820005,52402.38390875806,30133.25227944562, 0.0,1.026196970261589E7,5691248.463187074,76737.91797476102,0.5361540353623373,0.004352362374553068,8.603141807195775E-4,6.985288078552666E-4,0.006372616501029472,0.05513066190270489, 0.0,1.9655470749045126E7,8444816.903044727,2.128009484847606E7,759843.5665006133,315451.9446560562,130012.25302502007,56263.84189846605,31313.11931975157,19772.932753028832, 0.0,1.1477452429911006E7,6251218.318484662,288611.4087666268,15.092471899148997,0.30609868159017134,0.0704200756339407,0.0489636036896702,0.23192539906010923,1.085903442482766, 0.0,1.0777655700247124E7,5950318.498288406,155405.81810392698,3.100237701386537,0.0431832478828525,0.010407627751915087,0.00808104654065995,0.0512705259764884,0.3163827476422317, 0.0,1.784557838389384E7,8206753.35786263,1.4895384480270365E7,304578.56984081166,101850.87635706845,43238.883792837165,19958.66200854029,13146.788055953859,9734.074889365587, 0.0,1.0777655700247124E7,5950318.498288406,155405.81810392698,3.100237701386537,0.0431832478828525,0.010407627751915087,0.00808104654065995,0.0512705259764884,0.3163827476422317, 0.0,1.0777655700247124E7,5950318.498288406,155405.81810392698,3.100237701386537,0.0431832478828525,0.010407627751915087,0.00808104654065995,0.0512705259764884,0.3163827476422317,] INFO|16:56:08,271|SimulationControl.java|206|setText|Add some results INFO|16:56:08,282|SimulationControl.java|206|setText|Do post action Rules INFO|16:56:08,284|SimulationControl.java|206|setText|Compute discard and landing INFO|16:56:08,343|SimulationControl.java|206|setText|Add economics results INFO|16:56:08,358|SimulationControl.java|206|setText|Rollback rules changes INFO|16:56:08,368|SimulationControl.java|206|setText|Export des r�sultats INFO|16:56:08,497|SimulationControl.java|206|setText|begin step f�vrier 0 INFO|16:56:08,498|SimulationControl.java|206|setText|Reloading parameters INFO|16:56:08,510|IsisCacheBackendOnGuava.java|238|adjustedCache|Cache size ajusted to 3,333Mo (equivalent to 2 step need) INFO|16:56:08,510|SimulationControl.java|206|setText|Evaluate rules conditions (0 rules) INFO|16:56:08,512|SimulationControl.java|206|setText|Do pre action Rules INFO|16:56:08,524|SimulationControl.java|206|setText|Simulate one month INFO|16:56:08,586|DefaultSimulator.java|402|computeMonth|====================== begin f�vrier 0 - nephrops =========================== 1669996568586 INFO|16:56:08,587|DefaultSimulator.java|405|computeMonth|N: MatrixAbundance matrix2D [ 0.0,1.3862657042934775E7,6874348.92187028,2949099.62826639,5919.425350361074,649.3923190884658,202.58153314898726,108.30122083421656,157.00314317310762,242.54655020851845, 0.0,2.0618847603013273E7,8345444.874652748,2.5521027694851536E7,1262033.4841971623,597478.9777956854,243576.3293107575,101860.05317765649,51415.20251982311,29597.540630538006, 0.0,9791673.466702582,4868445.251947599,65864.50016191117,0.4729304232765572,0.004020500563746465,7.982545887098715E-4,6.61998841000312E-4,0.006116615306267112,0.05351076577119068, 0.0,1.9170715906569693E7,8123417.05403776,2.0481112504609343E7,734492.2674172159,307169.1222964608,126687.79739490227,55009.539949441605,30676.86694263013,19405.557708797325, 0.0,1.1012271045246081E7,5508229.219195674,254982.11453934407,13.623947261211732,0.2865458775419276,0.0661528799474664,0.046769520701073396,0.22376182839440317,1.0569454047042408, 0.0,1.0296113577772098E7,5122941.224435438,134226.33914525638,2.7484255994391136,0.04000610620705799,0.009682844007941501,0.007671551425034608,0.049266193463097345,0.30727307748397203, 0.0,1.7361970346529514E7,7789481.845196106,1.4150125906383542E7,291359.586285763,98582.35537353044,41898.658800095734,19444.494372776877,12849.626688976778,9541.169247063492, 0.0,1.0296113577772098E7,5122941.224435438,134226.33914525638,2.7484255994391136,0.04000610620705799,0.009682844007941501,0.007671551425034608,0.049266193463097345,0.30727307748397203, 0.0,1.0296113577772098E7,5122941.224435438,134226.33914525638,2.7484255994391136,0.04000610620705799,0.009682844007941501,0.007671551425034608,0.049266193463097345,0.30727307748397203,] ERROR|16:56:08,609|InProcessSimulatorLauncher.java|483|localSimulateSameThread|Error during simulation fr.ifremer.isisfish.IsisFishRuntimeException: Can't evaluate equation at fr.ifremer.isisfish.util.EvaluatorHelper.catchEvaluateException(EvaluatorHelper.java:296) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl.getReproductionMatrix(PopulationSeasonInfoImpl.java:820) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at simulators.DefaultSimulator.computeMonth(DefaultSimulator.java:458) ~[?:?] at simulators.DefaultSimulator.simulate(DefaultSimulator.java:242) ~[?:?] at fr.ifremer.isisfish.simulator.launcher.InProcessSimulatorLauncher.localSimulateSameThread(InProcessSimulatorLauncher.java:432) [isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.simulator.launcher.InProcessSimulatorLauncher$SimThread.run(InProcessSimulatorLauncher.java:260) [isis-fish-4.4.7.1.jar:4.4.7.1] Caused by: fr.ifremer.isisfish.IsisFishRuntimeException: Impossible d'�valuer l'�quation: double Ktemp = context.getValueAndCompute("nephrops.reproductionEquation.Ktemp", 1); int Kint = (int) Ktemp; TimeStep step = context.getSimulationControl().getStep(); int y = step.getYear(); MatrixND Biom = context.getResultManager().getMatrix(step,pop,"matrixBiomass"); for (MatrixIterator i=Biom.iterator(); i.hasNext();) { i.next(); Object [] sems = i.getSemanticsCoordinates(); PopulationGroup group = (PopulationGroup)sems[0]; i.setValue(i.getValue()* group.getMaturityOgive()); } MatrixND prop = Biom.sumOverDim(0).reduceDims(0); double ssb = Biom.sumAll(); prop = prop.divs(ssb); double Rtot =0.0; switch(Kint){ case 1 : // Beverton & Holt double abv = 1; double bbv = 1; Rtot = abv*ssb/(bbv+ssb); break; case 2 : // a*ssb*exp(-b*ssb) - Ricker double ar=0.5; double br=0.005; Rtot = ar*ssb*Math.exp(-br*ssb); break; case 3 : // Hockey Stick double ahs=10; double ssbt = 7.3E7 ; if (ssb < ssbt) {Rtot = ahs*ssb;} else {Rtot = ahs*ssbt;} break; case 4 : // repro fecondite double compt=0; for (Zone zone : zoneRepro){ compt=0; for (PopulationGroup group : groups){ double cf = Ktemp * group.getReproductionRate(); compt += N.getValue(group, zone) * cf; } result.setValue(zone, compt*prepro); } break; case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12 : case 13: case 14 : // aleatoire unif[min-max] double [][] matrixR = {{0.11178995, 0.95123978, 0.05388496, 0.30427033, 0.88097277}, {0.61318827, 0.86325772, 0.59521774, 0.97951352, 0.39522985}, {0.84762444, 0.81945931, 0.17035498, 0.98107093, 0.30626818}, {0.73545519, 0.52408773, 0.56679328, 0.90386484, 0.94130219}, {0.84378708, 0.14061830, 0.23156422, 0.71417364, 0.54878101}, {0.64332233, 0.01433846, 0.22262234, 0.65167476, 0.22910183}, {0.06130198, 0.40996938, 0.97397125, 0.69185333, 0.29951089}, {0.67789114, 0.43629884, 0.52475169, 0.14057724, 0.98577644}, {0.90164408, 0.68106970, 0.85784589, 0.20025039, 0.97989699}, {0.54700931, 0.07277969, 0.04077778, 0.37232379, 0.95016336} }; double ssbtmin = 7.3E7; double ssbtmax = 9.0E7; Rtot = matrixR[Kint][y]*(ssbtmax-ssbtmin)+ssbtmin; break; } // fin du switch if (Ktemp!=4) { for(Zone zone:zoneRepro){ double propZone=prop.getValue(zone); result.setValue(zone,propZone*Rtot); } } return 0; at fr.ifremer.isisfish.entities.EquationImpl.evaluate(EquationImpl.java:89) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept(ByteBuddyInterceptor.java:56) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:95) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at fr.ifremer.isisfish.entities.EquationImpl$HibernateProxy$iXB1NVO9.evaluate(Unknown Source) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl.getReproductionMatrix(PopulationSeasonInfoImpl.java:816) ~[isis-fish-4.4.7.1.jar:4.4.7.1] ... 4 more Caused by: fr.ifremer.isisfish.IsisFishRuntimeException: Can't invoke method 'public abstract double fr.ifremer.isisfish.equation.PopulationReproductionEquation.compute(fr.ifremer.isisfish.simulator.SimulationContext,org.nuiton.math.matrix.MatrixND,fr.ifremer.isisfish.entities.Population,fr.ifremer.isisfish.types.Month,double,java.util.List,java.util.List,java.util.List,org.nuiton.math.matrix.MatrixND) throws java.lang.Exception' for class formules.PopulationReproductionEquationfr_ifremer_isisfish_entities_Equation_1223471368823_0_9686449729478345 at fr.ifremer.isisfish.util.EvaluatorHelper.invoke(EvaluatorHelper.java:479) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.util.EvaluatorHelper.evaluate(EvaluatorHelper.java:319) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.EquationImpl.evaluate(EquationImpl.java:74) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept(ByteBuddyInterceptor.java:56) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:95) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at fr.ifremer.isisfish.entities.EquationImpl$HibernateProxy$iXB1NVO9.evaluate(Unknown Source) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl.getReproductionMatrix(PopulationSeasonInfoImpl.java:816) ~[isis-fish-4.4.7.1.jar:4.4.7.1] ... 4 more Caused by: java.lang.reflect.InvocationTargetException at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at fr.ifremer.isisfish.util.EvaluatorHelper.invoke(EvaluatorHelper.java:476) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.util.EvaluatorHelper.evaluate(EvaluatorHelper.java:319) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.EquationImpl.evaluate(EquationImpl.java:74) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept(ByteBuddyInterceptor.java:56) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:95) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at fr.ifremer.isisfish.entities.EquationImpl$HibernateProxy$iXB1NVO9.evaluate(Unknown Source) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl.getReproductionMatrix(PopulationSeasonInfoImpl.java:816) ~[isis-fish-4.4.7.1.jar:4.4.7.1] ... 4 more Caused by: java.lang.NullPointerException: Cannot invoke "org.nuiton.math.matrix.MatrixND.iterator()" because "Biom" is null at formules.PopulationReproductionEquationfr_ifremer_isisfish_entities_Equation_1223471368823_0_9686449729478345.compute(PopulationReproductionEquationfr_ifremer_isisfish_entities_Equation_1223471368823_0_9686449729478345.java:9) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at fr.ifremer.isisfish.util.EvaluatorHelper.invoke(EvaluatorHelper.java:476) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.util.EvaluatorHelper.evaluate(EvaluatorHelper.java:319) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.EquationImpl.evaluate(EquationImpl.java:74) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept(ByteBuddyInterceptor.java:56) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:95) ~[hibernate-core-5.6.5.Final.jar:5.6.5.Final] at fr.ifremer.isisfish.entities.EquationImpl$HibernateProxy$iXB1NVO9.evaluate(Unknown Source) ~[isis-fish-4.4.7.1.jar:4.4.7.1] at fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl.getReproductionMatrix(PopulationSeasonInfoImpl.java:816) ~[isis-fish-4.4.7.1.jar:4.4.7.1] ... 4 more INFO|16:56:08,642|InProcessSimulatorLauncher.java|512|localSimulateSameThread|Simulation time: 25.260 INFO|16:56:08,747|InProcessSimulatorLauncher.java|199|message|Simulation termin�e INFO|16:56:08,747|SimulationControl.java|206|setText|Simulation termin�e Le 02/12/2022 à 09:16, Eric Chatellier a écrit :
Bonjour,
Les versions 4.4.x tournent toujours avec java 8 minimum, donc les scripts sont toujours compilés avec la syntaxe java 8. Cela changera en version 4.5.x qui imposera un minimum de java 17, mais on ne l'a toujours pas sorti
Donc pour l'instant, la syntaxe est:
case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: // aleatoire unif[min-max ... break;
Le 01/12/2022 à 12:48, Stephanie MAHEVAS a écrit :
hello
une aide ? merci Stephanie
1. ERROR in C:\Users\smahevas\C-ISISFish\isis-fish-4\isis-temp\tmp-20221201094535-853357926\checkPopulationReproductionEquation10797508798142475965Equation.java (at line 52) case 5,6,7,8,9,10,11,12,13,14 : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Multi-constant case labels supported from Java 14 onwards only
avec java version "17.0.2" 2022-01-18 LTS Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86) Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)
et le script reproduction complet : double Ktemp = context.getValueAndCompute("nephrops.reproductionEquation.Ktemp", 1); int Kint = (int)Ktemp; TimeStep step = context.getSimulationControl().getStep(); int y = step.getYear();
MatrixND Biom = context.getResultManager().getMatrix(step,pop,"matrixBiomass");
for (MatrixIterator i=Biom.iterator(); i.hasNext();) { i.next(); Object [] sems = i.getSemanticsCoordinates(); PopulationGroup group = (PopulationGroup)sems[0]; i.setValue(i.getValue()* group.getMaturityOgive()); } MatrixND prop = Biom.sumOverDim(0).reduceDims(0); double ssb = Biom.sumAll(); prop = prop.divs(ssb);
double Rtot=0.0;
switch(Kint){
case 1 : // Beverton & Holt double abv = 1; double bbv = 1; Rtot = abv*ssb/(bbv+ssb); break; case 2 : // a*ssb*exp(-b*ssb) - Ricker double ar=0.5; double br=0.005; Rtot = ar*ssb*Math.exp(-br*ssb); break; case 3 : // Hockey Stick double ahs=10; double ssbt = 7.3E7 ; if (ssb < ssbt) {Rtot = ahs*ssb;} else {Rtot = ahs*ssbt;} break; case 4 : // repro fecondite double compt=0; for (Zone zone : zoneRepro){ compt=0; for (PopulationGroup group : groups){ double cf = Ktemp * group.getReproductionRate(); compt += N.getValue(group, zone) * cf; } result.setValue(zone, compt*prepro); } break; case 5,6,7,8,9,10,11,12,13,14 : // aleatoire unif[min-max] double [][] matrixR = {{0.11178995, 0.95123978, 0.05388496, 0.30427033, 0.88097277}, {0.61318827, 0.86325772, 0.59521774, 0.97951352, 0.39522985}, {0.84762444, 0.81945931, 0.17035498, 0.98107093, 0.30626818}, {0.73545519, 0.52408773, 0.56679328, 0.90386484, 0.94130219}, {0.84378708, 0.14061830, 0.23156422, 0.71417364, 0.54878101}, {0.64332233, 0.01433846, 0.22262234, 0.65167476, 0.22910183}, {0.06130198, 0.40996938, 0.97397125, 0.69185333, 0.29951089}, {0.67789114, 0.43629884, 0.52475169, 0.14057724, 0.98577644}, {0.90164408, 0.68106970, 0.85784589, 0.20025039, 0.97989699}, {0.54700931, 0.07277969, 0.04077778, 0.37232379, 0.95016336} }; double ssbtmin = 7.3E7; double ssbtmax = 9.0E7; Rtot = matrixR[Kint][y]*(ssbtmax-ssbtmin)+ssbtmin; break;
} // fin du switch if (Kint!=4) { for(Zone zone:zoneRepro){ double propZone=prop.getValue(zone); result.setValue(zone,propZone*Rtot); } } return 0;
-- ...................................................................... Stephanie MAHEVAS UMR DECOD (Dynamique et durabilité des écosystèmes : de la source à l'océan) IFREMER/HALGO/EMH (Ecologie et Modèles pour l'Halieutique) https://annuaire.ifremer.fr/cv/16343/ Tel: (33) 2 40 37 41 81 - 06 75 83 59 33 o \ o / _ o __| \ / |__ o _ \ o / o /|\ | /\ ___\o \o | o/ o/__ /\ | /|\ / \ / \ | \ /) | ( \ /o\ / ) | (\ / | / \ / \ ......................................................................
Je pense que le résultat "matrixBiomass" est calculé, mais pas sauvegardé dans les resultats de simulation. Il faut: - soit le sélectionner lors du lancement de la simulation - soit le déclarer comme résultat requis pas l'equation, en ajoutant, au debut: String[] necessaryResult = {"matrixBiomass"}; Le 02/12/2022 à 17:13, Stephanie MAHEVAS a écrit :
Merci Eric maintenant j'ai une erreur à la simulation avec une matrice null dans l'équation de repro MatrixND Biom = context.getResultManager().getMatrix(step,pop,"matrixBiomass");
Une idée ? merci Stephanie
PS : log de la simu ci-dessous et Base attachée
-- Éric Chatellier - www.codelutin.com - 02.40.50.29.28
participants (2)
-
Eric Chatellier -
Stephanie MAHEVAS