File: isForbidden.R

package info (click to toggle)
r-cran-paramhelpers 1.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 992 kB
  • sloc: ansic: 102; sh: 13; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#' @title Check whether parameter setting lies in forbidden region of parameter
#'   set.
#'
#' @description Parameter sets without a forbidden region always return `FALSE`.
#'
#' @template arg_parset
#' @param x (named `list`) \cr
#'   Parameter setting to check.
#' @return `logical(1)`.
#' @export
isForbidden = function(par.set, x) {
  assertClass(par.set, "ParamSet")
  # FIXME: check for correct names here
  assertList(x)
  if (!hasForbidden(par.set)) {
    return(FALSE)
  }
  return(eval(par.set$forbidden, envir = x))
}