Allocates tgt
of something to length(bucketLims)
different "buckets" subject to the constraint that each bucket has a maximum value of bucketLims
that cannot be exceeded. By default counts are distributed equally between buckets, but weights can be provided using ws
to have the redistribution prefer certain buckets over others.
alloc(tgt, bucketLims, ws = rep(1/length(bucketLims), length(bucketLims)))
A vector of the same length as bucketLims
containing values distributed into buckets.
Value to distribute between buckets.
The maximum value that each bucket can take. Must be a vector of positive values.
Weights to be used for each bucket. Default value makes all buckets equally likely.