ext.dir <- paste0(tempdir(), "/criticality/extdata")
dir.create(ext.dir, recursive = TRUE, showWarnings = FALSE)
extdata <- paste0(.libPaths()[1], "/criticality/extdata")
file.copy(paste0(extdata, "/facility.csv"), ext.dir, recursive = TRUE)
file.copy(paste0(extdata, "/mcnp-dataset.RData"), ext.dir, recursive = TRUE)
config <- FALSE
try(config <- reticulate::py_config()$available)
try(if (config == TRUE) {
Risk(
bn = BN(
facility.data = "facility.csv",
ext.dir = ext.dir),
code = "mcnp",
cores = 1,
facility.data = "facility.csv",
keff.cutoff = 0.5,
metamodel = NN(
batch.size = 128,
ensemble.size = 1,
epochs = 10,
layers = "256-256-16",
replot = FALSE,
ext.dir = ext.dir),
risk.pool = 10,
sample.size = 1e+04,
ext.dir = ext.dir,
training.dir = NULL
)
})
Run the code above in your browser using DataLab