ropensci / nlrx

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

Netlogo R analysis (nlrx) #92

Closed sogolnezhadi closed 1 month ago

sogolnezhadi commented 9 months ago

I write nlrx codes in R to analysis my NetLogo model. the codes works propely in NetLogo but the result in csv file released ib R different. I can not find the issue. could you plesae help me.

netlogopath <- file.path("C:/Program Files/NetLogo 6.3.0") modelpath <- file.path("C:/Users/nezhadi/Documents/Documenti/BTU University_PHD/Netlogo/Sensivity_analysis/Final_conversion.nlogo")

outpath <- file.path("C:/Users/nezhadi/Documents/Documenti/BTU University_PHD/Netlogo/Sensivity_analysis/out_4_conversion") nl <- nl(nlversion = "6.3.0", nlpath = netlogopath, modelpath = modelpath, jvmmem = 1024) nl@experiment <- experiment(expname="pest-enemy", outpath=outpath, repetition=1, tickmetrics="true", idsetup="setup", idgo="go", runtime=500, evalticks=seq(150,500,50), metrics=c( "treatment-level" , "total-number-enemies" ,"total-number-pests" , "total-relised-C-profit" ," total-relised-NCH-profit" , "mean-re-C-pro" , "mean-re-NCH-pro" , " aggregation" , "number-conserved", "total-land-NCH", "total-land-C","Ration_gain_profit"), variables = list('base-payment' = list(values= c(0,150,250,300)), 'bonus' =list(values= c(0,15,30,50))), constants = list("alpha"= 0.3333, "soil_factor_sigma"= 0.3, "pesticide-rate"= 0.0277, "pest_growth_rate"= 0.1842, "soil_factor_mu"= 0.5, "conversion_cost"= 0, "pesticide-treatment?" ="true", "land-use-view?"= "true" )) nl@simdesign <- simdesign_ff(nl = nl, nseeds = 1) plan(multisession) results <- run_nl_all(nl)

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

nldoc commented 1 month ago

Hi @sogolnezhadi , Unfortunately, I am not able to assist with debugging your NetLogo model output. If you provide a minimal reproducible example (including a NetLogo model file) which replicates your observed behaviour I might help if it shows that your issue is caused by a bug in the nlrx code. I will close this issue for now, feel free to re-open if you have more detailed information.