Sample the swarm proportion - the proportion of workers that swarm - used when p = NULL (see SimParamBee$swarmP).

This is just an example. You can provide your own functions that satisfy your needs!

swarmPUnif(colony, n = 1, min = 0.4, max = 0.6)

Arguments

colony

Colony-class

n

integer, number of samples

min

numeric, lower limit for swarmPUnif

max

numeric, upper limit for swarmPUnif

Value

numeric, swarm proportion

Details

swarmPUnif samples from a uniform distribution between values 0.4 and 0.6 irrespective of colony strength.

The nWorkersFull default value used in this function is geared towards a situation where we simulate ~100 workers per colony (down-scaled simulation for efficiency). If you simulate more workers, you should change the default accordingly.

See also

SimParamBee field swarmP

Examples

swarmPUnif()
#> [1] 0.592287
swarmPUnif()
#> [1] 0.4715171
p <- swarmPUnif(n = 1000)
hist(p, breaks = seq(from = 0, to = 1, by = 0.01), xlim = c(0, 1))