ParamSetShadow {miesmuschel} | R Documentation |
ParamSetShadow
Description
Wraps another ParamSet
and shadows out a subset of its Param
s.
The original ParamSet
can still be accessed through the $origin
field;
otherwise, the ParamSetShadow
behaves like a ParamSet
where the shadowed
Param
s are not present.
Super class
paradox::ParamSet
-> ParamSetShadow
Active bindings
params
(named
list
ofParam
) List ofParam
that are members of the wrappedParamSet
with the shadowedParam
s removed.params_unid
(named
list
ofParam
) List ofParam
that are members of the wrappedParamSet
with the shadowedParam
s removed. This is a field mostly for internal usage that has the$id
s set to invalid values but avoids cloning overhead.deps
(
data.table
)
Table of dependencies, as inParamSet
. The dependencies that are related to shadowed parameters are not exposed. Thisdata.table
should be seen as read-only and not modified in-place; instead, the$origin
's$deps
should be modified.values
(named
list
)
List of values, as inParamSet
, with the shadowed values removed.set_id
(
data.table
)
Id of the wrappedParamSet
. Changing this value will also change the wrappedParamSet
's$set_id
accordingly.origin
(
ParamSet
)
ParamSet
being wrapped. This object can be modified by reference to influence theParamSetShadow
object itself.
Methods
Public methods
Inherited methods
paradox::ParamSet$assert()
paradox::ParamSet$assert_dt()
paradox::ParamSet$check()
paradox::ParamSet$check_dt()
paradox::ParamSet$format()
paradox::ParamSet$get_values()
paradox::ParamSet$ids()
paradox::ParamSet$print()
paradox::ParamSet$search_space()
paradox::ParamSet$set_values()
paradox::ParamSet$test()
paradox::ParamSet$test_dt()
Method new()
Initialize the ParamSetShadow
object.
Usage
ParamSetShadow$new(set, shadowed)
Arguments
Method add()
Adds a single param or another set to this set, all params are cloned.
This calls the underlying ParamSet
's $add()
function.
Param
with ids that also occur in the underlying ParamSet
but are shadowed can not be added and instead will result in an error.
Usage
ParamSetShadow$add(p)
Arguments
Returns
invisible(self)
.
Method subset()
Reduces the parameters to the ones of passed ids.
This calls the underlying ParamSet
's $subset()
function.
Usage
ParamSetShadow$subset(ids)
Arguments
ids
(
character
)
Returns
invisible(self)
.
Method add_dep()
Adds a dependency to the unterlying ParamSet
.
Usage
ParamSetShadow$add_dep(id, on, cond)
Arguments
id
(
character(1)
)on
(
character(1)
)cond
Returns
invisible(self)
.
Method clone()
The objects of this class are cloneable with this method.
Usage
ParamSetShadow$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
p1 = ps(x = p_dbl(0, 1), y = p_lgl())
p1$values = list(x = 0.5, y = TRUE)
print(p1)
p2 = ParamSetShadow$new(p1, "x")
print(p2$values)
p2$values$y = FALSE
print(p2)
print(p2$origin$values)