Level 3 function that creates a set of colonies. Usually to start a simulation.
createMultiColony(x = NULL, n = NULL, simParamBee = NULL)
Pop-class
, virgin queens or queens for the colonies
(selected at random if there are more than n
in Pop
, while
all are used when n
is NULL
)
integer, number of colonies to create (if only n
is
given then MultiColony-class
is created with n
NULL
) individual colony - this is mostly useful for programming)
SimParamBee
, global simulation parameters
When both x
and n
are NULL
, then a
MultiColony-class
with 0 colonies is created.
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Create 2 empty (NULL) colonies
apiary <- createMultiColony(n = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary
#> Error in eval(expr, envir, enclos): object 'apiary' not found
apiary[[1]]
#> Error in eval(expr, envir, enclos): object 'apiary' not found
apiary[[2]]
#> Error in eval(expr, envir, enclos): object 'apiary' not found
# Create 3 virgin colonies
apiary <- createMultiColony(x = basePop, n = 3) # specify n
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- createMultiColony(x = basePop[1:3]) # take all provided
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary
#> Error in eval(expr, envir, enclos): object 'apiary' not found
apiary[[1]]
#> Error in eval(expr, envir, enclos): object 'apiary' not found
apiary[[2]]
#> Error in eval(expr, envir, enclos): object 'apiary' not found
# Create mated colonies by crossing
apiary <- createMultiColony(x = basePop[1:2], n = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
drones <- createDrones(x = basePop[3], n = 30)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
droneGroups <- pullDroneGroupsFromDCA(drones, n = 2, nDrones = 15)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- cross(apiary, drones = droneGroups)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary
#> Error in eval(expr, envir, enclos): object 'apiary' not found
apiary[[1]]
#> Error in eval(expr, envir, enclos): object 'apiary' not found
apiary[[2]]
#> Error in eval(expr, envir, enclos): object 'apiary' not found