Andrew Culham

Andrew,
after you sent me your example, things got clearer to
me. Your fitness function writes:
if (x == 0 && y ==
0){
fun = Math.pow(10,7); } else{ fun = Math.min(1 / (Math.exp(x*x + y*y)  1), Math.pow(10,6)); } it returns the highest values (best fitness in your
case) for x and y equalling zero.
Using integer genes with a range from 10 to 10 means
21 (10+10+1, the 1 for the zero) possibilities in total per
gene.
Using a double gene with the same range means endlees
possibilities per gene.
This is number one. Number two is that in your fitness
function there is a discontinuity, namely at (0,0). Thou, if a tuple of double
genes does not hit the (0,0) then it optimizes the elsepart of your
function!
Thouh, the problem here lies in the problem to solve..
It is a problem that could not be solved with an evolutionary algorithm (nor
with most other approaches). Try to use a fitness function with continuous
Also see the example in class
examples.functionFinder.FormulaFinder (maybe you need to download the
3rdpartypackage of JGAP for that).
Best
Klaus

Free forum by Nabble  Edit this page 