library(stockassessment)
load("run/model.RData")
simdata <- simulate(fit, nsim=10)
SIMS <- parallel::mclapply(simdata, function(x)sam.fit(x, fit$conf, fit$obj$env$par, silent=TRUE))
attr(SIMS, "fit") <- fit
class(SIMS)<-"samset"
save(SIMS, file="run/sims.RData")












