NAME
Algorithm::Evolutionary::Fitness::Knapsack - 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
new
Creates a new instance of the problem,
with
the said number of bits and peaks
knapsack
Applies the knapsack problem to the string, using a penalty function
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