ropensci / nlrx

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

Exception in thread "main" Can't find extension: gis at position * #77

Open erkinaiderkenbaeva opened 1 year ago

erkinaiderkenbaeva commented 1 year ago

As I tried to explain in this SO post, nlrx seems to have some directory problems regarding finding NetLogo extensions.

Everything runs smoothly until I reach run_nl_all. I think it looks like a java/NetLogo problem.

Could you please help? image

bitbacchus commented 1 year ago

Hi, thanks for your issue!

We had the same problem in our working group, and the problem was that the model was saved under NetLogo 6.3.0. When using e.g. 6.1.1 it worked with nlrx and the gis extension. Maybe that solves your issue?

nldoc commented 1 year ago

I added support for NetLogo 6.3.0 with #72. The directory structure was slightly updated in 6.3.0 compared to earlier versions. Due to time restrictions, I was not able to test the gis extension in particular, but I assume it is worth to re-run your tests. The new version is currently only available from github, but will be released via CRAN as soon as possible.

lsaravia commented 1 year ago

The simulations that worked previously didn't work anymore with this error:

nl@experiment <- experiment(expname="Amazon59years449PostRcp45_se",
                            outpath=outpath,
                            repetition=1,
                            tickmetrics="true",
                            idsetup="setup",
                            idgo="go",
                            #idrunnum="nlrx-experiment",
                            runtime=0,
                            evalticks= eval_times,          
                            metrics=c("Date", "burned-by-month","active-burned","Percent-forest","fire-probability","burned-clusters 365","median-fire-interval" ),
                            variables = list("forest-dispersal-distance" = list(values=disp_best),
                                             "Forest-growth" = list(values=grow_best),
                                             "Initial-forest-density" = list(values=ini_best)
                            ),
                            constants = list("world-width" = 449,
                                             "world-height" = 449,
                                               "fire-prob-filename"="\"Data/Predicted_bF_rcp45.csv\"",
                                               "Save-view" =  "false",
                                               "video" = "false",
                                               "end-simulation"= 28918,
                                               "Periodicity" = "false",
                                               "Fire-probability" = 1E-6,
                                               "eval-burned-clusters"=paste0("\"[",paste(eval_times,collapse=" "),"]\""),
                                               "use-fire-prob-se" = "true"
                                             ))

#
# Run 10 times 
#
nl@simdesign <- simdesign_distinct(nl=nl,
                               nseeds=10)

# run in Paralell 
#
plan(multisession)
results <- run_nl_all(nl,split = 4)
plan(sequential)

Exception in thread "main" Can't find extension: vid at position 13 in 
        at org.nlogo.core.ErrorSource.signalError(ErrorSource.scala:11)
        at org.nlogo.workspace.ExtensionManager.importExtension(ExtensionManager.scala:180)
        at org.nlogo.parse.StructureParser$.$anonfun$parsingWithExtensions$1(StructureParser.scala:74)
        at org.nlogo.parse.StructureParser$.$anonfun$parsingWithExtensions$1$adapted(StructureParser.scala:68)
        at scala.collection.immutable.List.foreach(List.scala:431)

I deleted the vid extension from the model but then the problem is with the csv extension, I copied the model to the "NetLogo/models" but I have the same problem, I installed the last version of nlrx from github and again the same problem, there is any other thing to try?

sessionInfo() R version 4.3.2 (2023-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.6 LTS

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

time zone: America/Argentina/Buenos_Aires tzcode source: system (glibc)

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

other attached packages: [1] future.apply_1.11.0 poweRlaw_0.70.6 future_1.33.0
[4] tictoc_1.2 nlrx_0.4.4 lubridate_1.9.3
[7] forcats_1.0.0 stringr_1.5.0 dplyr_1.1.3
[10] purrr_1.0.2 readr_2.1.4 tidyr_1.3.0
[13] tibble_3.2.1 ggplot2_3.4.4 tidyverse_1.3.1
[16] MASS_7.3-60

loaded via a namespace (and not attached): [1] tidyselect_1.2.0 fastmap_1.1.1 pracma_2.4.4 reprex_2.0.2
[5] digest_0.6.33 timechange_0.2.0 lifecycle_1.0.4 processx_3.8.2
[9] magrittr_2.0.3 compiler_4.3.2 rlang_1.1.1 sass_0.4.6
[13] tools_4.3.2 utf8_1.2.4 yaml_2.3.7 knitr_1.45
[17] prettyunits_1.2.0 pkgbuild_1.4.2 curl_5.0.0 xml2_1.3.5
[21] withr_2.5.2 desc_1.4.2 grid_4.3.2 fansi_1.0.5
[25] colorspace_2.1-0 progressr_0.13.0 globals_0.16.2 scales_1.2.1
[29] cli_3.6.1 rmarkdown_2.20 crayon_1.5.2 generics_0.1.3
[33] remotes_2.4.2.1 rstudioapi_0.15.0 httr_1.4.7 modelr_0.1.11
[37] tzdb_0.4.0 readxl_1.4.3 DBI_1.1.3 cachem_1.0.8
[41] rvest_1.0.3 parallel_4.3.2 cellranger_1.1.0 vctrs_0.6.4
[45] jsonlite_1.8.7 callr_3.7.3 hms_1.1.3 listenv_0.9.0
[49] jquerylib_0.1.4 glue_1.6.2 parallelly_1.36.0 codetools_0.2-19 [53] ps_1.7.5 stringi_1.7.12 gtable_0.3.4 munsell_0.5.0
[57] pillar_1.9.0 furrr_0.3.1 htmltools_0.5.7 R6_2.5.1
[61] dbplyr_2.4.0 rprojroot_2.0.3 evaluate_0.23 haven_2.5.3
[65] backports_1.4.1 broom_1.0.5 bslib_0.5.1 xfun_0.41
[69] fs_1.6.3 pkgconfig_2.0.3