Set::Associate::RefillItems - Pool repopulation methods
version 0.002000
This class implements the mechanism which controls how the main pool populates.
The part you're mostly interested in are the "CLASS METHODS", which return the right populator.
This is more or less a wrapper for passing around subs with an implict interface.
my $populator = Set::Associate::RefillItems->new( name => 'linear', code => sub { my ( $self, $sa ) = @_; .... }, ); my ( @new_pool ) = $populator->run( $set_associate_object );
required Str
required CodeRef
required ArrayRef
Populate from items each time.
items
my $sa = Set::Associate->new( ... on_items_empty => Set::Associate::RefillItems->linear( items => [ ... ]) );
Populate with a shuffled version of items
my $sa = Set::Associate->new( ... on_items_empty => Set::Associate::RefillItems->shuffle( items => [ ... ]); );
runs code attached via "code"
my ( @list ) = $object->run( $set_associate_object );
Where <@list> is the new pool contents.
Kent Fredric <kentfredric@gmail.com>
This software is copyright (c) 2013 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Set::Associate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Set::Associate
CPAN shell
perl -MCPAN -e shell install Set::Associate
For more information on module installation, please visit the detailed CPAN module installation guide.