<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4207.2601" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I am using the GALib for nonpoint source pollution
prediction. <FONT face="Times New Roman"><FONT size=3>I am using the <SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"><EM>GA1DarrayAlleleGenome</EM>
class with steady state, tournament selection. I create the first genome by
sequentially adding allelesets for each gene to the allele array (this is the
<EM>CreateGenomeTemplate</EM> function refered to below). I then initialize the
population using the a baseline genome. this all works fine but
results in the initial population consisting of identical genomes (i.e., the
baselione genome). </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman"><FONT size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">I
want the initial population to be random within the constraints of the
allelesets. I can figure out how to do this.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">Can
anyone advise me?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">here
are my functions:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">/*
----------------------------------------------------------------------------<BR>BaselineInitializer
function<BR> This initializer fills the values from the baseline into the
genome
template.<BR>----------------------------------------------------------------------------
*/<BR>void<BR>BaselineInitializer(GAGenome
&g)<BR>{<BR> GA1DArrayAlleleGenome<int>
&genome=(GA1DArrayAlleleGenome<int> &)g;<BR> for(int i=0;
i<genome.size(); i++)<BR> {<BR> genome.gene(i,
iBaseArray[i]);<BR> } //end for<BR>}<BR>/* end BaselineInitializer
function----------------------------------------- */</SPAN></FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">
<DIV>/*
----------------------------------------------------------------------------<BR>PopInitializer
function<BR> // This function initializes the poplulation based on the
first genome. This<BR> // is done so that the ga can run on the population
and not the
indivual.<BR>----------------------------------------------------------------------------
*/<BR>void <BR>PopInitializer(GAPopulation & p)<BR>{<BR> for (int i =
0; i<p.size() ;
i++)<BR> { p.individual(i).initialize();<BR> }<BR>}<BR>/*
end PopInitializer function---------------------------------------------------
*/<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">//and
from the main function-----------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"> //Create
genome template from Baseline, <BR> GA1DArrayAlleleGenome<int>
genome(CreateGenomeTemplate(), Objective);</SPAN></FONT></DIV><FONT face=Arial
size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">
<DIV><FONT face=Arial size=2></FONT><BR>//initialize GA using allele
set<BR> //Assign the initialization operator.<BR>
genome.initializer(BaselineInitializer);<BR> //Intialize first genome to
match baseline scenario.<BR> genome.initialize();<BR> //Keep
inital genome, gBase, for future use.<BR>
GA1DArrayAlleleGenome<int> gBase(genome);<BR> //Assign the mutation
operator.<BR>
genome.mutator(GA1DArrayAlleleGenome<int>::FlipMutator);<BR> //Assign
the evaluation operator.<BR> genome.evaluator(Objective);</DIV>
<DIV> </DIV>
<DIV>//create the population<BR> GAPopulation
gaPop(genome,readPopSize);<BR>
gaPop.initializer(PopInitializer);<BR>
gaPop.initialize();<BR>
gaPop.evaluator(PopEvaluator);<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">Tamie</SPAN></FONT></DIV></BODY></HTML>