NAME

Algorithm::Evolutionary::Fitness::ONEMAX - Fitness function for the knapsack problem

SYNOPSIS

my $n_max=100;  #Max. number of elements to choose
my $capacity=286; #Max. Capacity of the knapsack
my $rho=5.0625; #Penalty coeficient
my @profits = qw( 1..100 );
my @weights = qw( 2.. 101 );

my $knapsack = Algorithm::Evolutionary::Fitness::Knapsack->new( $n_max, $capacity, $rho, \@profits, \@weights ); 

DESCRIPTION

Knapsack function with penalties applied in a particular way.

METHODS

_apply

Applies the instantiated problem to a chromosome

onemax

Computes the number of ones

cached_evals

Returns the number of keys in the evaluation cache

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

CVS Info: $Date: 2008/06/21 11:15:16 $ 
$Header: /cvsroot/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Fitness/ONEMAX.pm,v 1.1 2008/06/21 11:15:16 jmerelo Exp $ 
$Author: jmerelo $ 
$Revision: 1.1 $
$Name $