A paradox::ParamSet defining the codomain of a function.
The parameter set must contain at least one target parameter tagged with "minimize"
or "maximize"
.
The codomain may contain extra parameters which are ignored when calling the Archive methods $best()
, $nds_selection()
and $cols_y
.
This class is usually constructed internally from a paradox::ParamSet when Objective is initialized.
Super class
paradox::ParamSet
-> Codomain
Active bindings
is_target
(named
logical()
)
Position isTRUE
for target parameters.target_length
(
integer()
)
Returns number of target parameters.target_ids
(
character()
)
IDs of contained target parameters.target_tags
(named
list()
ofcharacter()
)
Tags of target parameters.maximization_to_minimization
(
integer()
)
Returns a numeric vector with values -1 and 1. Multiply with the outcome of a maximization problem to turn it into a minimization problem.direction
(
integer()
)
Returns1
for minimization and-1
for maximization. If the codomain contains multiple parameters an integer vector is returned. Multiply with the outcome of a maximization problem to turn it into a minimization problem.
Methods
Inherited methods
paradox::ParamSet$add_dep()
paradox::ParamSet$aggr_internal_tuned_values()
paradox::ParamSet$assert()
paradox::ParamSet$assert_dt()
paradox::ParamSet$check()
paradox::ParamSet$check_dependencies()
paradox::ParamSet$check_dt()
paradox::ParamSet$convert_internal_search_space()
paradox::ParamSet$disable_internal_tuning()
paradox::ParamSet$flatten()
paradox::ParamSet$format()
paradox::ParamSet$get_domain()
paradox::ParamSet$get_values()
paradox::ParamSet$ids()
paradox::ParamSet$print()
paradox::ParamSet$qunif()
paradox::ParamSet$search_space()
paradox::ParamSet$set_values()
paradox::ParamSet$subset()
paradox::ParamSet$subspaces()
paradox::ParamSet$test()
paradox::ParamSet$test_constraint()
paradox::ParamSet$test_constraint_dt()
paradox::ParamSet$test_dt()
paradox::ParamSet$trafo()
Method new()
Creates a new instance of this R6 class.
Usage
Codomain$new(params)
Arguments
params
(
list()
)
Named list with which to initialize the codomain. This argument is analogous to paradox::ParamSet's$initialize()
params
argument.
Examples
# define objective function
fun = function(xs) {
c(y = -(xs[[1]] - 2)^2 - (xs[[2]] + 3)^2 + 10)
}
# set domain
domain = ps(
x1 = p_dbl(-10, 10),
x2 = p_dbl(-5, 5)
)
# set codomain
codomain = ps(
y = p_dbl(tags = "maximize"),
time = p_dbl()
)
# create Objective object
objective = ObjectiveRFun$new(
fun = fun,
domain = domain,
codomain = codomain,
properties = "deterministic"
)