Hello everybody,
I am currently using a genetic algorithm thanks to the "ga" function in MatLab 2012a, and I am encountering an issue whom I have no idea how to solve...
I have my fitness function that i'm trying to minimize. Let's call her myfun :
function merit = myfun(x,...
A=x(1);
B=x(2);
C=x(3);
...
merit=...
param=[A B C merit];
save parameters.txt param -append -ascii
end
Until that point, everything is fine. Each individual is written in my txt file...
BUT: When I'm looking at my current best individual in my txt file, and I recompute the figure of merit of my function, I don't get the same value than the one in the txt file.
Example:
My best individual in my txt file:
A = 9.9488952e-01
B = 7.7381392e+01
C = 3.2928992e+07
merit = 3.9479605e+00
If I recompute the performance manually (with the same code, just evaluating the code line by line) and I write the result in my txt file, I get:
A = 9.9488952e-01
B = 7.7381392e+01
C = 3.2928992e+07
merit = 3.5089634e+00
The same problem occurs in the totally different program of one of my colleague... And I don't understand why... Hope that I was clear enough and I apologize for my weak english skills...
Thank you in advance