This is a dummy algorithm routine to test the sampling procedures, in
combination with dummyinstance()
.
dummyalgo()
receives two parameters that determine the distribution of
performances it will exhibit on a hypothetical problem class:
distribution.fun
(with the name of a random number generation function,
e.g. rnorm
, runif
, rexp
etc.); and distribution.pars
, a named list of
parameters to be passed on to distribution.fun
.
The third parameter is an instance object (see calc_nreps()
for details),
which is a named list with the following fields:
FUN = "dummyinstance"
- must always be "dummyinstance" (will
be ignored otherwise).
distr
- the name of a random number generation function.
...
- other named fields with parameters to be passed down
to the function in distr
.
name of a function that generates random values according to a given distribution, e.g., "rnorm", "runif", "rexp" etc.
list of named parameters required by the function
in distribution.fun
. Parameter n
(number of points to
generate) is unnecessary (this routine always forces n = 1
).
instance parameters (see Details
).
a list object with a single field $value
, containing a scalar
numerical value distributed as described at the end of Details
.
distribution.fun
and distribution.pars
regulate the mean performance of
the dummy algorithm on a given (hypothetical) problem class, and the
between-instances variance of performance. The instance specification in
instance
regulates the within-instance variability of results. Ideally the
distribution parameters passed to the instance
should result in a
within-instance distribution of values with zero mean, so that the mean of
the values returned by dummyalgo
is regulated only by distribution.fun
and distribution.pars
.
The value returned by dummyalgo is sampled as follows:
# Make a dummy instance with a centered (zero-mean) exponential distribution:
instance = list(FUN = "dummyinstance", distr = "rexp", rate = 5, bias = -1/5)
# Simulate a dummy algorithm that has a uniform distribution of expected
# performance values, between -25 and 50.
dummyalgo(distribution.fun = "runif",
distribution.pars = list(min = -25, max = 50),
instance = instance)
#> $value
#> [1] -7.523163
#>