Algorithm-MasterMind
view release on metacpan or search on metacpan
lib/Algorithm/MasterMind/Evo.pm view on Meta::CPAN
$partitions->{(keys %consistent )[0]} = { "allblacks" => 1}; # I know, this is a hack
}
}
for my $c ( keys %consistent ) {
for my $p ( @{$consistent{$c}}) {
$p->{'_partitions'} = scalar (keys %{$partitions->{$c}});
}
}
if ($generations_equal == MAX_GENERATIONS_RESET ) { #reset pop
# Print for debugging
my %population;
for my $p ( @$pop ) {
$population{$p->{'_str'}}++;
}
for my $s ( sort { $population{$b} <=> $population{$a} } keys %population ) {
print $s, ": ", $population{$s}, " C\n";
}
print "Reset\n\n";
#Do the thing
$ga->reset( $pop );
( run in 1.294 second using v1.01-cache-2.11-cpan-49f99fa48dc )