nlrx icon indicating copy to clipboard operation
nlrx copied to clipboard

Netlogo R analysis (nlrx)

Open sogolnezhadi opened this issue 1 year ago • 0 comments

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"))

sogolnezhadi avatar Dec 17 '23 17:12 sogolnezhadi