<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Windows Mail 17.5.9600.20279">
<style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, 
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, 
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style>
</head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Microsoft YaHei UI', 'Segoe UI', 'Meiryo', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;">
<div>Hi, all,&nbsp;I need to randomly generate a set of RealGenome (say 30) in order to use SimpleGA to do the evolution. Each genome contains 5 alleles, and the sum&nbsp;of the 5 allele values (each is in the interval (0,1))&nbsp;need to be equal to 1.&nbsp;So I checked example
 21 in the GAlib package, the code that is&nbsp;close to what I require is the following:</div>
<div><br>
</div>
<font face="Consolas" size="2"><font face="Consolas" size="2">
<p class="defaultFont">GARealAlleleSetArray alleles2a;</p>
</font></font>
<div><font face="Consolas" size="2"><font face="Consolas" size="2"></font></font></div>
<p class="defaultFont"><font face="Consolas" size="2"><font face="Consolas" size="2"></font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">for</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">(</font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">int</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">
 i=0; i&lt;length; i&#43;&#43;)</font></font></p>
<div><font face="Consolas" size="2"><font face="Consolas" size="2"></font></font></div>
<font face="Consolas" size="2"><font face="Consolas" size="2">
<p class="defaultFont">alleles2a.add(0, 1, GAAllele::EXCLUSIVE, GAAllele::EXCLUSIVE);</p>
<div></div>
<p class="defaultFont">GARealGenome genome2a(alleles2a, Objective2);</p>
</font></font>
<div><font face="Consolas" size="2"><font face="Consolas" size="2"></font></font>&nbsp;</div>
<div>but it only created a RealGenome which contains alleles having&nbsp;bounded continuous&nbsp;values (0,1). Also, later in the code:</div>
<div><br>
</div>
<font face="Consolas" size="2"><font face="Consolas" size="2">
<p class="defaultFont">GAParameterList params;</p>
<div></div>
<p class="defaultFont">GASteadyStateGA::registerDefaultParameters(params);</p>
<div></div>
<p class="defaultFont">params.set(gaNpopulationSize, 110);</p>
<div><br>
</div>
</font></font>
<div>It just replicated the RealGenome 110 times, but not randomly generated 110 RealGenomes. So how can I achieve my goal, point me some directions.</div>
<font face="Consolas" size="2">
<div><br>
</div>
</font>
<div>cheers</div>
<div><br>
</div>
<div data-signatureblock="true">
<div>Sent from Windows Mail</div>
<div><br>
</div>
</div>
</div>
</body>
</html>