MClapplyHet | R Documentation |
The evaluation of the fitness of the genes of the population
is distributed to one worker on each core of the CPU of the
local machine.
The package parallel
of base R is used.
The number of cores is provided by lF$Cores
.
MClapplyHet(pop, EvalGene, lF)
pop |
Population of genes. |
EvalGene |
Function for evaluating a gene. |
lF |
Local function configuration which provides
all functions needed in |
Be aware that
parallel::mclapply()
assumes that each function evaluation
needs approximately the same time.
Best results are obtained if
popsize
modulo cores-1
is 0
.
Does not work on Windows.
Fitness vector.
Other Execution Model:
MClapply()
,
PparLapply()
,
PparLapplyHet()
,
futureLapply()
,
futureLapplyHet()
library(parallelly)
if (supportsMulticore()){
lFxegaGaGene$Cores<-function() {2}
pop<-xegaInitPopulation(10, lFxegaGaGene)
popnew<-MClapplyHet(pop, lFxegaGaGene$EvalGene, lFxegaGaGene)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.