Primera página Regresar Siguiente Última página Resumen Imagen
Algorithm::Evolutionary:
Canonical GA: XML
#!perl
use strict;
use warnings;
use Algorithm::Evolutionary::Experiment;
my $xmlDoc = join("",<>);
my $e =
Algorithm::Evolutionary::Experiment->fromXML($xmlDoc);
my $populationRef = $e->go();
print "Final\n", $e->asXML();
Notas:
Cool things: perl can serialize code from a pointer.
I use XML::Simple, which is, after all, not so simple and predictable. That will be the first thing to fall in the next iteration.
Just change the fitness function if you want to use the algorithm for anything else