Check if a parameter value satisfies the constraints of the
parameter description. This includes the requires
expressions and the
forbidden
expression, if par
is a ParamSet()
. If requires
is not
satisfied, the parameter value must be set to scalar NA
to be still
feasible, a single scalar even in a case of a vector parameter. If the result
is FALSE
the attribute "warning"
is attached which gives the reason for
the negative result.
If the parameter has cnames
, these are also checked.
isFeasible(par, x, use.defaults = FALSE, filter = FALSE)
par | |
---|---|
x | (any) |
use.defaults | ( |
filter | ( |
#> [1] TRUEisFeasible(p, 2) # False, out of bounds#> [1] FALSEisFeasible(p, "a") # False, wrong type#> [1] FALSE# now for parameter sets ps = makeParamSet( makeNumericParam("x", lower = -1, upper = 1), makeDiscreteParam("y", values = c("a", "b")) ) isFeasible(ps, list(0, "a")) # True#> [1] TRUE#> [1] FALSE #> attr(,"warning") #> [1] "The parameter setting x=a does not meet constraints"