Risk {criticality} | R Documentation |
Risk Function
Description
This function estimates process criticality accident risk (imports Sample function).
Usage
Risk(
bn,
code = "mcnp",
cores = parallel::detectCores()/2,
dist = "gamma",
facility.data,
keff.cutoff = 0.9,
metamodel,
risk.pool = 100,
sample.size = 1e+09,
usl = 0.95,
ext.dir,
training.dir = NULL
)
Arguments
bn |
Bayesian network |
code |
Monte Carlo radiation transport code (e.g., "cog", "mcnp") |
cores |
Number of CPU cores to use for generating Bayesian network samples |
dist |
Truncated probability distribution (e.g., "gamma", "normal") |
facility.data |
.csv file name |
keff.cutoff |
keff cutoff value (e.g., keff >= 0.9) |
metamodel |
List of deep neural network metamodels and weights |
risk.pool |
Number of times risk is calculated |
sample.size |
Number of samples used to calculate risk |
usl |
Upper subcritical limit (e.g., keff >= 0.95) |
ext.dir |
External directory (full path) |
training.dir |
Training directory (full path) |
Value
A list of lists containing process criticality accident risk estimates and Bayesian network samples
Examples
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
)
})
[Package criticality version 0.9.3 Index]