Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Algorithm::EvolutionarUseriContributedAPgorithm::Evolutionary::Fitness::Any(3)

NAME
       Algorithm::Evolutionary::Fitness::Any - FaA<section>ade for any
       function	so that	it can be used as fitness

SYNOPSIS
	  use Algorithm::Evolutionary::Utils qw( string_decode )

	  sub squares {
	    my $chrom =	shift;
	    my @values = string_decode(	$chrom,	10, -1,	1 );
	    return $values[0] *	$values[1];
	  }

	  my $any_eval = new Algorithm::Evolutionary::Fitness::Any \&squares;

DESCRIPTION
       Turns any subroutine or closure into a fitness function.	Useful mainly
       if you want results cached; it's	not really needed otherwise.

METHODS
   new(	$function )
       Assigns default variables

   apply( $individual )
       Applies the instantiated	problem	to a chromosome. It is actually	a
       wrapper around "_apply".

   _apply( $individual )
       This is the one that really does	the stuff. It applies the defined
       function	to each	individual. Itis cached	for efficiency.

Copyright
	 This file is released under the GPL. See the LICENSE file included in this distribution,
	 or go to http://www.fsf.org/licenses/gpl.txt

perl v5.32.0			  2014Algorithm::Evolutionary::Fitness::Any(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | Copyright

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Algorithm::Evolutionary::Fitness::Any&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help