Learn R Programming

xegaPopulation (version 1.0.0.12)

PparLapply: uses parLapply of library parallel for using workers on machines in a local network.

Description

uses parLapply of library parallel for using workers on machines in a local network.

Usage

PparLapply(pop, EvalGene, lF)

Value

Fitness vector.

Arguments

pop

a population of genes.

EvalGene

the function for evaluating a gene.

lF

the local function factory which provides all functions needed in EvalGene.

Warning

This section has not been properly tested. Random number generation? Examples?

See Also

Other Execution Model: MClapply(), MClapplyHet(), PparLapplyHet(), futureLapply(), futureLapplyHet()

Examples

Run this code
parm<-function(x) {function() {x}}
pop<-xegaInitPopulation(1000, lFxegaGaGene)
library(parallel)
clus<-makeCluster(2)
lFxegaGaGene$cluster<-parm(clus)
popnew<-PparLapply(pop, lFxegaGaGene$EvalGene, lFxegaGaGene)
stopCluster(clus)

Run the code above in your browser using DataLab