-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerformance.R
More file actions
31 lines (24 loc) · 800 Bytes
/
Performance.R
File metadata and controls
31 lines (24 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Performance test script
# Measures timing and memory use (Windows only)
# for a simulation modeling 100 generations of
# recurrent selection. Each generation consists
# of 1000 parents and 10,000 offspring. Each
# individual has 10 chromosomes with 10,000
# loci per chromosome.
# NOTE: memory.size only works on Windows
library(AlphaSimR)
system.time({
founderPop = quickHaplo(nInd = 1000,
nChr = 10,
segSites = 1000)
SP = SimParam$new(founderPop)$
addTraitA(nQtlPerChr = 1000)$
setVarE(h2 = 0.3)
pop = newPop(founderPop)
for(generation in 1:100){
pop = selectCross(pop = pop,
nInd = 1000,
nCrosses = 10000)
}
})
memory.size(TRUE)