[galib] How can I integrate My own scaling in GAlib for minmizing positive objective function?

Essam Almasri masryesam at yahoo.com
Fri Mar 18 11:42:01 EST 2005

I have treid to minimize an objective function (f_obj) using SigmaTruncationScaling by puting multiplying the objective function by -1. It goes OK. 
I like to use my own scaling which I think it will better for minimization of my objective function. The scaling I propose is that:
fittness(i)= exp[ [max( f_obj(i)) - f_obj(i))] * 5 / [max( f_obj(i)) - min( f_obj(i)) ] ]
I use this scaling, because I expect to work better than SigmaTruncationScaling 
the follwoing c++ prototype (code)  was added to GAScaling.c file, however the results was not satisfied. The result shows divergence contradicting of what expected. I s there any thing wrong? What are the steps of writing my own scaling. 
/* ----------------------------------------------------------------------------
---------------------------------------------------------------------------- */
// This is an a test scaling
void  GAExponScaling::evaluate(const GAPopulation & p) {
 for(int i=0; i<p.size(); i++){
  double ffup = (double)(p.max())-(double)(p.individual(i).score());
  double ffdown = (double)(p.max())-(double)(p.min());
  double f= exp(ffup*5.0/ffdown);
  if(f < 0) f = 0.0;

Do you Yahoo!?
 Yahoo! Sports -  Sign up for Fantasy Baseball.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20050318/6d00687c/attachment.htm

More information about the galib mailing list