[jgap-users] Re: jgap fitness function
Brought to you by:
klausikm
From: Neil R. <ne...@bl...> - 2003-06-18 00:32:11
|
Hi Michelle, The fitness function is where you want to rate the desirability of the various solutions, whether this desirability is computed via some algorithm or determined through user input of some kind. The fitness value that is returned should reflect the desirability of the solution. One key point about the genetic algorithm is that solutions are chosen statistically based on their fitness values. This means that there's a chance that even the best solution won't be chosen for the next generation and that even the worst solution might be chosen (however slim the odds might be). JGAP does all of this work for you--you simply need to return fitness values from your fitness function that indicate the desirability of particular solutions. At present, there is no special identifier or way to attach additional meta-data to Chromosomes. Some work has been done on adding this, but I'm not sure of the present state of that work. I hope that helps! Neil On Tue, 17 Jun 2003, Kam, Michelle C wrote: > Hello, > > I'm using the jgap package in a scenario in which a user is given a set of > spreadsheet cells with different visualizations of data and the user selects > which data representations from a set of 16 that he/she likes best. Those > selected cells will live to the next generation when it evolves. > > Currently, I'm pre-specifying the cell # chosen for the next generation at > the command prompt as a simple case. For example, cell # 2 and 5. I would > like to create a "for" loop that iterates through my set of chromosomes > (where each chromosome is set up as an array of IntegerGenes) and checks to > see if the chromosome # is 2 or 5 and if it is, that chrom will be added to > a "bestSoFar" array. I think this for loop should be in the fitness function > so that it can be called from evolve() but getFitnessValue returns an int. > I'm not sure if the set up of an array holding the chrom's that will > progress to the next generation belongs in getFitnessValue(). Is there a > more appropriate place where this "for" loop should be? The bestSoFar array > will be in a separate class I created so that the chromosomes in this array > will be used in the next generation. > > Also, is there a way to specify which chromosome it is within its generation > such as a chromosome ID #? I'm not sure if a field like this exists already. > > Thank you! > Michelle Kam > > Michelle Kam (408) 742-2881 > Lockheed Martin Space Systems Co. SSM/ATC/MSIS > B/153 O/L922 > 1111 Lockheed Martin Way, Sunnyvale, CA 94089 > > > |