Jump to content

Particle swarm optimization: Difference between revisions

m
→‎{{header|Perl}}: oops, print results
(Added Perl example)
m (→‎{{header|Perl}}: oops, print results)
Line 1,680:
sub report {
my($function_name, %state) = @_;
push @res,say $function_name;
push @res,say 'Global best position: ' . sprintfprintf '"%.5f %.5f'\n", @{$state{'gbpos'}};
push @res,say 'Global best value: ' . sprintfprintf '"%.5f'\n", $state{'gbval'};
push @res,say '';
}
 
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.