Print

Print


Alan, SPEA2 uses its own idiosyncratic fitness class
SPEA2MultiobjectiveFitness, as well as its own idiosyncratic approach
to evolutionary computation.  You're correct, there's no setFitness()
method per se: instead, when you evaluate an individual i in your
problem, then i.fitness.multifitness is a float[] which holds the
various fitnesses, ranging from 0 to 1 inclusive.  0 is worst.  Just
set those values directly.

The other "fitness" stuff in SPEA2MultiobjectiveFitness are used
internally only to maintain its cache.  SPEA2 is a great algorithm, but
it's got weird names for its subpieces.

Sean

On Jun 17, 2004, at 2:43 PM, Alan Ryan wrote:

> Hi, I'm new to this list and ECJ.  I need to use the spea2 solution
> for a
> problem I am trying to research.  My problem is in the evaluation of
> the
> individuals, I don't know where to do this as MultiObjectiveFitness
> does not
> have a setFitness() method such as KozaFitness and SimpleFitness.  So I
> cannot place it in the evaluate() method of my eval.Problem
> parameter/object.
>
> I read in the docs that
>
> "The evaluator is also responsible for calculating the SPEA2Fitness
> function. This function depends on the entire population and so cannot
> be
> calculated in the Problem class."
>
> does the answer lie somewhere here, I cannot find where I would
> implement
> this .  Please excuse me if I am off the mark here, I am new EP.
>
> Thanks,
> Alan