ropensci / nlrx

nlrx NetLogo R
https://docs.ropensci.org/nlrx
GNU General Public License v3.0
77 stars 12 forks source link

NetLogo 6.2.2 not supported #71

Closed AndreMBellve closed 2 years ago

AndreMBellve commented 2 years ago

Hi there,

I just updated from NetLogo 6.2.0 which I had an experiment running for, to version 6.2.2. When I tried to execute run_nl_all() with my nl object I got the error:

Error in util_gather_results(nl, outfile, seed, siminputrow) : 
  Temporary simulation output file not found: C:\Users\abel122\AppData\Local\Temp\Rtmp04MvQt\nlrx_seed_866182572_row_1_427446211d3d.csv.

Either the simulation did not run or crashed, check the debugging section in ??run_nl_all() for help.

Naturally, I looked at the ??run_nl_all() help page and tried the debugging options. Both java () and NetLogo were correctly installed as far as I could see (some output listed below). My Java version had not changed since the R script was last working, with the only change being NetLogo 6.2.2.

I tried debug option number two and got the following summary:

supported nlversion: ✗
nlpath exists on local system: ✓
modelpath exists on local system: ✓
valid jvm memory: ✓
valid experiment name: ✓
outpath exists on local system: ✓
setup and go defined: ✓
variables defined: ✓
variables present in model: ✓
constants defined: ✓
constants present in model: ✗
metrics defined: ✓
spatial Metrics defined: ✓
simdesign attached: ✓
siminput parameter matrix: ✓
number of siminputrows: 3
number of random seeds: 6
estimated number of runs: 18
simoutput results attached: ✗
number of runs calculated: ✗

TL;DR It looks like nlrx needs to be patched to work with the latest version of NetLogo (6.2.2 at the time of writing). Partly, I am putting this to save other future users the potential headache if they hit this error.

Some of my session info in case it helps:

java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_New Zealand.utf8 
[2] LC_CTYPE=English_New Zealand.utf8   
[3] LC_MONETARY=English_New Zealand.utf8
[4] LC_NUMERIC=C                        
[5] LC_TIME=English_New Zealand.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] future_1.28.0 dplyr_1.0.10  nlrx_0.4.3   

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13   parallelly_1.32.1 knitr_1.39       
 [4] magrittr_2.0.3    tidyselect_1.1.2  R6_2.5.1         
 [7] rlang_1.0.5       fansi_1.0.3       highr_0.9        
[10] stringr_1.4.1     globals_0.16.1    tools_4.2.1      
[13] parallel_4.2.1    xfun_0.32         utf8_1.2.2       
[16] cli_3.3.0         DBI_1.1.2         assertthat_0.2.1 
[19] digest_0.6.29     tibble_3.1.8      lifecycle_1.0.1  
[22] crayon_1.5.1      furrr_0.3.1       progressr_0.11.0 
[25] purrr_0.3.4       vctrs_0.4.1       codetools_0.2-18 
[28] evaluate_0.16     glue_1.6.2        stringi_1.7.8    
[31] compiler_4.2.1    pillar_1.8.1      generics_0.1.3   
[34] listenv_0.8.0     pkgconfig_2.0.3 

P.s. This is a great package - I really hope you folks keep it going as it is extremely useful!!!

AndreMBellve commented 2 years ago

Turns out it was an sneaky little issue with rJava and had nothing to do with nlrx. Sorry for the trouble!