[galib] referencing gene values from external functions

Steve Borst borstsf at yahoo.com
Wed Jan 19 13:55:29 EST 2005

I have a question about how one references an individual member of a population, and that individual's gene values in a function external to the GA code.
I am working with GASteadyStateGA, and GA1DArraryAlleleGenome. I have built some simple examples to get a basic understanding of the GALib and to make sure I'm using the library correctly. 
In the experiment that I am setting up, I am working with a program external to the GA as a simulation. I want the GA to optimize a particular parameter for the simulation. The interface between the two is a simple ASCII file. I have written the routine to create this file, what I am having trouble doing is writing the allele values that the GA has chosen for the genes to this file. I believe that I am not casting the Genome properly within the function that writes the file. 
The objective function reads an log file generated from the simulation and returns appropriate values for the fitness of each individual it has evaluated.
Some options that I have tried have been:
In GASteadtStateGA.C, in the initialize function between 
this was an attempt to not add my Experiment function to the population object, and to attempt to keep the changes to the GALib to a minimum.
I have also tried within the runExperiment function to do external references to the main GA function where I have my GA and Genome defined. Again, it appears that i am not doing this correctly either.
I have also tried a number of different ways to cast a variable as a Genome object within the runExperiment function as well. 
I know that this is largely a gap in my knowledge of the programming language. I am seeking some suggestions, or examples, of any scenarios where people have referenced an individual's genes in the population and what they did to bring that data into context of their functions. If anyone has an example where they have used the GALib to build an external file to be run on a simulation that would be most helpful.
Thank you so much for your time and assistance
Steve Borst

Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20050119/9a5e6639/attachment.htm

More information about the galib mailing list