[galib] R: Re: (no subject)

hneil@fastwebnet.it hneil at fastwebnet.it
Sat Jan 5 04:18:54 EST 2008


Perhaps you could rearrange the problem so that all your program does 
is maximize or minimize.  Take one of the fitness methods and use its 
inverse values as input to the program.

That is to say, if you're trying to maximize a number X for fitness A 
and minimize a number X for fitness B, run fitness method A to maximize 
with value from the genome X and fitness B to maximize with value 
MAX_VAL - value from the genome X.

In this sense, trying to maximize is like trying to minimize fitness 
B.  At this point, values for fitness B will lower rather than raise, 
since a 'high' fitness value means returning a lower value.  

As for calling both fitness methods, write a single fitness method 
which calls both these functions for fitnesses A and B.  If the fitness 
is the same (but one trying to maximize and the other minimize), I'd 
write a single fitness method which takes as input the value of the 
genome, and simply pass MAX_VAL - genome X in the second call.  

Good luck,
Neil Harmon


-----------------------------
 For a long time it puzzled me how something so expensive, so leading edge, could be so useless, and then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match. 
    --Bill Bryson



More information about the galib mailing list