ropensci / nlrx

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

GenAlg results saving #88

Open all-the-way-down-turtles opened 1 year ago

all-the-way-down-turtles commented 1 year ago

Hi, I tried to follow the Optimization vignette, but the genSA procedure has been running for two weeks now, although I tried to set the control parameter control=list(maxit = 10) for testing. The genAlg procedure did work, but I am not able to save the results of the procedure. I atttached it to the nl object and tried to save it as suggested in the vignette.

setsim(nl, "simoutput") <- tibble::enframe(results)
saveRDS(nl, file.path(nl@experiment@outpath, "genAlg.rds"))

I am running the script from bash, since it kept crashing otherwise and I get this error:

Error in `tibble::enframe()`:
! The `x` argument to `enframe()` must be a vector, not rbga.
Backtrace:
    ▆
 1. └─tibble::enframe(results)
 2.   └─tibble:::abort_enframe_must_be_vector(x)
 3.     └─tibble:::tibble_abort(...)
 4.       └─rlang::abort(x, class, ..., call = call, parent = parent, use_cli_format = TRUE)

Can someone help me how to save the results?

all-the-way-down-turtles commented 1 year ago

Hi, I still haven't solved the genSA problem. The algorithm never comes to an end.

However, if someone also has problems adapting the code of the vignette to genAlg: to save the results of genAlg, the code should be without the enframe argument.

setsim(nl, "simoutput") <- results saveRDS(nl, file.path(nl@experiment@outpath, "genAlg.rds"))