<!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.&nbsp;&nbsp; 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>&nbsp;</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&nbsp;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>&nbsp;</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>&nbsp;</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>&nbsp; This initializer fills the values from the baseline into the 
genome 
template.<BR>---------------------------------------------------------------------------- 
*/<BR>void<BR>BaselineInitializer(GAGenome 
&amp;g)<BR>{<BR>&nbsp;GA1DArrayAlleleGenome&lt;int&gt; 
&amp;genome=(GA1DArrayAlleleGenome&lt;int&gt; &amp;)g;<BR>&nbsp;for(int i=0; 
i&lt;genome.size(); i++)<BR>&nbsp;{<BR>&nbsp;&nbsp;genome.gene(i, 
iBaseArray[i]);<BR>&nbsp;} //end for<BR>}<BR>/* end BaselineInitializer 
function----------------------------------------- */</SPAN></FONT></DIV>
<DIV>&nbsp;</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>&nbsp; // This function initializes the poplulation based on the 
first genome. This<BR>&nbsp; // is done so that the ga can run on the population 
and not the 
indivual.<BR>---------------------------------------------------------------------------- 
*/<BR>void <BR>PopInitializer(GAPopulation &amp; p)<BR>{<BR>&nbsp;for (int i = 
0; i&lt;p.size() ; 
i++)<BR>&nbsp;{&nbsp;&nbsp;p.individual(i).initialize();<BR>&nbsp;}<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">&nbsp;//Create 
genome template from Baseline, <BR>&nbsp;&nbsp; GA1DArrayAlleleGenome&lt;int&gt; 
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>&nbsp;//Assign the initialization operator.<BR>&nbsp;&nbsp; 
genome.initializer(BaselineInitializer);<BR>&nbsp;//Intialize first genome to 
match baseline scenario.<BR>&nbsp;&nbsp; genome.initialize();<BR>&nbsp;//Keep 
inital genome, gBase, for future use.<BR>&nbsp;&nbsp; 
GA1DArrayAlleleGenome&lt;int&gt; gBase(genome);<BR>&nbsp;//Assign the mutation 
operator.<BR>&nbsp;&nbsp; 
genome.mutator(GA1DArrayAlleleGenome&lt;int&gt;::FlipMutator);<BR>&nbsp;//Assign 
the evaluation operator.<BR>&nbsp;&nbsp; genome.evaluator(Objective);</DIV>
<DIV>&nbsp;</DIV>
<DIV>//create the population<BR>&nbsp;&nbsp; GAPopulation 
gaPop(genome,readPopSize);<BR>&nbsp;&nbsp; 
gaPop.initializer(PopInitializer);<BR>&nbsp;&nbsp; 
gaPop.initialize();<BR>&nbsp;&nbsp; 
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>&nbsp;</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>