.end.results.base.col.types <- c("character",
"character",
"character",
"real",
"real",
"real",
"real",
"real",
"integer",
"real",
"real",
"real");
.end.results.base.col.names <- c("algorithm",
"instance",
"seed",
"best.f",
"total.time",
"total.fes",
"last.improvement.time",
"last.improvement.fes",
"n.improvements",
"budget.time",
"budget.FEs",
"goal.f");
.check.end.results <- function(data) {
stopifnot(is.data.frame(data),
nrow(data) > 0L,
all(colnames(data) == .end.results.base.col.names),
!any(is.na(data$instance)),
all(nchar(data$instance) > 0L),
!any(is.na(data$algorithm)),
all(nchar(data$algorithm) > 0L),
!any(is.na(data$seed)),
all(nchar(data$seed) > 0L),
all(is.finite(data$best.f)),
all(is.finite(data$total.time)),
all(data$total.time >= 0),
all(is.finite(data$total.fes)),
all(data$total.fes > 0),
all(is.finite(data$last.improvement.time)),
all(data$last.improvement.time >= 0),
all(data$last.improvement.time <= data$total.time),
all(is.finite(data$last.improvement.fe)),
all(data$last.improvement.fe > 0),
all(data$last.improvement.fe <= data$total.fes),
all(is.finite(data$n.improvements)),
all(data$n.improvements > 0L),
all(data$n.improvements <= data$last.improvement.fe),
all(is.finite(data$budget.time)),
all(data$budget.time >= 0),
all(is.finite(data$budget.fes)),
all(data$budget.fes >= 0),
!any(is.na(data$goal.f))
);
}
#' @title Load the End Results from a File
#' @description Load the end results from a file generated by the
#' aitoa log processing.
#' @param file the file to load
#' @return the data frame with the end results
#' @export aitoa.load.end.results
#' @importFrom utils read.csv
#' @include utils.R
aitoa.load.end.results <- function(file) {
file <- .file.exists(file);
data <- read.csv(file,
header=TRUE,
sep=";",
stringsAsFactors = FALSE,
check.names = TRUE,
blank.lines.skip = TRUE,
comment.char = '#',
col.names = .end.results.base.col.names,
colClasses = .end.results.base.col.types);
.check.end.results(data);
return(data);
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.