tests/testthat/test_multiobj_helpers.R

context("multi-objective helpers")

test_that("multi-objective helpers", {
  # we had a bug here
  m = matrix(c(1, 2, 3, 4), 2, 2, byrow = TRUE)
  e = getWorstExtremePoint(m, minimize = c(TRUE, TRUE))
  expect_equal(e, c(3, 4))

  e = getWorstExtremePoint(m, minimize = c(FALSE, TRUE))
  expect_equal(e, c(1, 4))

  # we had a bug here
  m = matrix(c(1, 2, 3, 4, -10, 2), 3, 2, byrow = TRUE)

  e = getWorstExtremePoint(m, minimize = c(TRUE, TRUE))
  expect_equal(e, c(3, 4))
  e = getWorstExtremePoint(m, minimize = c(FALSE, FALSE))
  expect_equal(e, c(-10, 2))
})

Try the mlrMBO package in your browser

Any scripts or data that you put into this service are public.

mlrMBO documentation built on July 4, 2022, 9:05 a.m.