AI-ParticleSwarmOptimization-MCE
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
example/PSOTest-MultiCore.pl view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use lib '../lib/';
#-----------------------------------------------------------------------
#use AI::ParticleSwarmOptimization;
use AI::ParticleSwarmOptimization::MCE;
#use AI::ParticleSwarmOptimization::Pmap;
use Data::Dumper; $::Data::Dumper::Sortkeys = 1;
#=======================================================================
sub calcFit {
my @values = @_;
my $offset = int (-@values / 2);
my $sum;
select( undef, undef, undef, 0.01 ); # Simulation of heavy processing...
$sum += ($_ - $offset++) ** 2 for @values;
return $sum;
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.166 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )