Function spherical_cow::pack_spheres
[−]
[src]
pub fn pack_spheres<C: Container, R: IndependentSample<f64>>(
container: &C,
size_distribution: &mut R
) -> Vec<Sphere>
Packs all habitat spheres to be as dense as possible.
Requires a containter
and a distribution of radii sizes.
Generally, a uniform distribution is chosen, although this library
accepts any distribution implementing rand
s IndependentSample
trait.
This example
uses a normally distributed radii range. Note that the packing is sub optimal in this case, and
attention must be paid when using such distributions that radii values do not become negagive.