Algorithm-Bucketizer

 view release on metacpan or  search on metacpan

Bucketizer.pm  view on Meta::CPAN


    $b->optimize(
        algorithm  => $algorithm,
        maxtime    => $seconds,
        maxrounds  => $number_of_rounds 
       );

Optimize bucket distribution. Currently C<"random"> and C<"brute_force">
are implemented. Both can be (C<"random"> I<must> be) terminated
by either the maximum number of seconds (C<maxtime>) or 
iterations (C<maxrounds>).

=back

=head1 EXAMPLE

We've got buckets which hold a weight of 100 each, 
and we've got 10 items weighing 30, 31, 32, ... 39. Distribute 
them into buckets.

    use Algorithm::Bucketizer;

README  view on Meta::CPAN


    *
            $b->optimize(
                algorithm  => $algorithm,
                maxtime    => $seconds,
                maxrounds  => $number_of_rounds 
               );

        Optimize bucket distribution. Currently "random" and "brute_force"
        are implemented. Both can be ("random" *must* be) terminated by
        either the maximum number of seconds ("maxtime") or iterations
        ("maxrounds").

EXAMPLE
    We've got buckets which hold a weight of 100 each, and we've got 10
    items weighing 30, 31, 32, ... 39. Distribute them into buckets.

        use Algorithm::Bucketizer;

        my $b = Algorithm::Bucketizer->new( bucketsize => 100 );
        for my $i (1..10) {



( run in 1.195 second using v1.01-cache-2.11-cpan-96521ef73a4 )