collapse {SIMplyBee}R Documentation

Collapse

Description

Level 2 function that collapses a Colony or MultiColony object by setting the collapse event slot to TRUE. The production status slot is also changed (to FALSE).

Usage

collapse(x)

Arguments

x

Colony-class or MultiColony-class

Details

You should use this function in an edge-case when you want to indicate that the colony has collapsed, but you still want to collect some values from the colony for a retrospective analysis. It resembles a situation where the colony has collapsed, but dead bees are still in the hive.

Value

Colony-class or MultiColony-class with the collapse event set to TRUE

Examples

founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(basePop[1], n = 1000)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = 10)

# Create Colony and MultiColony class
colony <- createColony(x = basePop[1])
colony <- cross(colony, drones = droneGroups[[1]])
apiary <- createMultiColony(x = basePop[2:10], n = 9)
apiary <- cross(apiary, drones = droneGroups[2:10])

# Collapse
hasCollapsed(colony)
colony <- collapse(colony)
hasCollapsed(colony)

hasCollapsed(apiary)
tmp <- pullColonies(apiary, n = 2)
tmp
apiaryLost <- collapse(tmp$pulled)
hasCollapsed(apiaryLost)
apiaryLeft <- tmp$remnant
hasCollapsed(apiaryLeft)

[Package SIMplyBee version 0.3.0 Index]