Algorithm-Genetic-Diploid
view release on metacpan or search on metacpan
lib/Algorithm/Genetic/Diploid/Base.pm view on Meta::CPAN
$self{'id'} = $id++;
# experiment is provided as an argument
if ( $self{'experiment'} ) {
$experiment = $self{'experiment'};
delete $self{'experiment'};
}
# create the object
my $obj = \%self;
bless $obj, $package;
# maybe the object was the experiment?
if ( $obj->isa('Algorithm::Genetic::Diploid::Experiment') ) {
$experiment = $obj;
}
return $obj;
}
=item logger
lib/Algorithm/Genetic/Diploid/Factory.pm view on Meta::CPAN
my $class = shift;
my %self = ( %defaults, @_ );
for my $class ( values %self ) {
if ( not $::{ $class . '::' } ) {
eval "require $class";
if ( $@ ) {
die $@;
}
}
}
return bless \%self, $class;
}
=item create
Given a short hand name, instantiates an object whose package name is associated with
that short name.
=cut
sub create {
lib/Algorithm/Genetic/Diploid/Logger.pm view on Meta::CPAN
=item new
This singleton constructor always returns reference to same object
=cut
my $SINGLETON;
sub new {
my $class = shift;
if ( not $SINGLETON ) {
$SINGLETON = bless \$class, $class;
}
$SINGLETON->level(@_) if @_;
return $SINGLETON;
}
=item level
Alters log level. Takes named arguments: C<method> provides a scalar or array of fully
qualified method names whose verbosity to alter. C<class> provides a scalar or array of
package names whose verbosity to alter. C<level> sets the verbosity to one of the levels
( run in 0.933 second using v1.01-cache-2.11-cpan-de7293f3b23 )