diff --git a/DESCRIPTION b/DESCRIPTION index 960df685d..8360756d2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,6 @@ Suggests: cmaesr (>= 1.0.3), ggplot2, DiceKriging, - DiceOptim, earth, emoa, GGally, @@ -52,6 +51,7 @@ Suggests: nnet, party, randomForest, + reshape2, rmarkdown, rgenoud, rpart, @@ -60,5 +60,5 @@ Suggests: LazyData: yes Encoding: UTF-8 ByteCompile: yes -RoxygenNote: 7.0.2 +RoxygenNote: 7.1.0 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 390bc12d5..7acb91e9e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,6 +12,7 @@ S3method(print,MBOExampleRunMultiObj) S3method(print,MBOInfillCrit) S3method(print,MBOMultiObjResult) S3method(print,MBOResult) +S3method(print,OptState) S3method(renderExampleRunPlot,MBOExampleRun) S3method(renderExampleRunPlot,MBOExampleRunMultiObj) export(crit.aei) diff --git a/R/OptState.R b/R/OptState.R index d0f676b49..517739a82 100644 --- a/R/OptState.R +++ b/R/OptState.R @@ -71,7 +71,7 @@ makeOptState = function(opt.problem, loop = 0L, tasks = NULL, models = NULL, opt.state$random.seed = getRandomSeed() opt.state$time.created = time.created - class(opt.state) = append(class(opt.state), "OptState") + class(opt.state) = append("OptState", class(opt.state)) opt.state } @@ -122,6 +122,7 @@ makeOptStateMboResult = function(opt.state) { mbo.result } +#' @export print.OptState = function(x, ...) { catf("OptSate") catf("Actual state: %s", getOptStateState(x)) diff --git a/man/trafos.Rd b/man/trafos.Rd index ac2ab3805..0d6374cf9 100644 --- a/man/trafos.Rd +++ b/man/trafos.Rd @@ -5,7 +5,9 @@ \alias{trafoLog} \alias{trafoSqrt} \title{Transformation methods.} -\format{None} +\format{ +None +} \usage{ trafoLog(base = 10, handle.violations = "warn") diff --git a/tests/testthat/test_check_design.R b/tests/testthat/test_check_design.R index 723614c8c..c9a991da1 100644 --- a/tests/testthat/test_check_design.R +++ b/tests/testthat/test_check_design.R @@ -19,8 +19,8 @@ test_that("test checks for initial design and new design", { expect_true(any(checked)) expect_true(any(!checked)) - design = data.frame(x = c("a", "b")) - new.design = data.frame(x = c("a", "c", "b", "d", "a", NA)) + design = data.frame(x = c("a", "b"), stringsAsFactors = TRUE) + new.design = data.frame(x = c("a", "c", "b", "d", "a", NA), stringsAsFactors = TRUE) expect_equal(checkPredictionData(new.design, design), c(TRUE, FALSE, TRUE, FALSE, TRUE, FALSE)) }) diff --git a/tests/testthat/test_smbo.R b/tests/testthat/test_smbo.R index 1d8b6e309..02f353240 100644 --- a/tests/testthat/test_smbo.R +++ b/tests/testthat/test_smbo.R @@ -8,6 +8,7 @@ test_that("human in the loop smbo works", { ctrl = makeMBOControl() opt.state = initSMBO(par.set = ps, design = des, control = ctrl) + expect_output(print(opt.state), "init") prop = proposePoints(opt.state) expect_list(prop) expect_data_frame(prop$prop.points)