race.init: Initialization function

Description Arguments Details Value Author(s) See Also Examples

Description

The function

1

may be provided by the user for initializing the computation of the slave processes. It's definition has to be given in the same file in which the functions race.wrapper and race.info are defined. The name of such file has to be passed as first argument to the function race.

Arguments

The function race.init has to be called with no arguments.

Details

This function should be used for initializing the computation on each slave, e.g. loading libraries or data needed by race.wrapper, race.info, and/or race.describe. The output of race.init will be passed to these functions.

Value

The function race.init is expected to return an object of mode list.

Author(s)

Mauro Birattari

See Also

race, race.wrapper, race.info, race.describe

Examples

1
2
3
4
5
6
# Please have a look at the function `race.init'
# defined in the file `example-wrapper.R':
local({
  source(file.path(system.file(package="race"),
                           "examples","example-wrapper.R"),local=TRUE);
  print(race.init)})

Example output

function () 
{
    library(nnet)
    data(iris)
    k <- 15
    n <- nrow(iris)
    if (exists(".Random.seed")) 
        save.seed <- .Random.seed
    set.seed(0)
    smpl <- sample(n)
    if (exists("save.seed", inherits = FALSE)) 
        assign(".Random.seed", save.seed, envir = globalenv())
    else rm(".Random.seed", envir = globalenv())
    msk <- k * c(0:(ceiling(n/k) - 1))
    candidates <- expand.grid(size = c(1:10), decay = c(1:5) * 
        1e-04)
    return(list(no.candidates = nrow(candidates), no.tasks = k, 
        msk = msk, smpl = smpl, iris = iris, candidates = candidates))
}
<environment: 0x1c46540>

race documentation built on May 29, 2017, 12:03 p.m.

Related to race.init in race...