## set seed for reproducibility
set.seed(14)
## Set prioriactions path
prioriactions_path <- system.file("extdata/example_input/", package = "prioriactions")
## Load in planning unit data
pu_data <- data.table::fread(paste0(prioriactions_path,"/pu.dat"),
data.table = FALSE)
head(pu_data)
## Load in feature data
features_data <- data.table::fread(paste0(prioriactions_path,"/features.dat"),
data.table = FALSE)
head(features_data)
## Load in planning unit vs feature data
dist_features_data <- data.table::fread(paste0(prioriactions_path,"/dist_features.dat"),
data.table = FALSE)
head(dist_features_data)
## Load in the threats data
threats_data <- data.table::fread(paste0(prioriactions_path,"/threats.dat"),
data.table = FALSE)
head(threats_data)
## Load in the threats distribution data
dist_threats_data <- data.table::fread(paste0(prioriactions_path,"/dist_threats.dat"),
data.table = FALSE)
head(dist_threats_data)
## Load in the sensitivity data
sensitivity_data <- data.table::fread(paste0(prioriactions_path,"/sensitivity.dat"),
data.table = FALSE)
head(sensitivity_data)
## Load in the boundary data
boundary_data <- data.table::fread(paste0(prioriactions_path,"/boundary.dat"),
data.table = FALSE)
head(boundary_data)
## Create instance
problem_data <- inputData(
pu = pu_data, features = features_data, dist_features = dist_features_data,
dist_threats = dist_threats_data, threats = threats_data, sensitivity = sensitivity_data,
boundary = boundary_data
)
## Summary
print(problem_data)
## Use class methods
problem_data$getData("features")
problem_data$getFeatureAmount()
problem_data$getFeatureNames()
problem_data$getMonitoringCosts()
problem_data$getPlanningUnitsAmount()
problem_data$getActionCosts()
problem_data$getThreatNames()
problem_data$getThreatsAmount()
problem_data$print()
Run the code above in your browser using DataLab