<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hello everyone,<div><br></div><div>I am fairly&nbsp;new to GAlib and I was wondering if you could help me with something.</div><div><br></div><div>I created a&nbsp;GARealGenome:</div><div><br></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="GRcorrect" id="GRmark_90df04c359634eb27dc63c4ea244fcccc26b9d4c_GARealAlleleSet:0" grphrase="90df04c359634eb27dc63c4ea244fcccc26b9d4c" grtype="null">GARealAlleleSet</span> alleles<span class="GRcorrect" id="GRmark_90df04c359634eb27dc63c4ea244fcccc26b9d4c_(:1" grphrase="90df04c359634eb27dc63c4ea244fcccc26b9d4c" grtype="null">(</span>MIN_VALUE, MAX_VALUE);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; GARealGenome genome<span class="GRcorrect" id="GRmark_435343aef46e42aa0fe9ca07835547c2f4d10e12_(:0" grphrase="435343aef46e42aa0fe9ca07835547c2f4d10e12" grtype="null">(</span>1, alleles, Objective);</div><div><span style="font-size: 10pt; ">&nbsp; &nbsp; &nbsp; &nbsp; GASimpleGA </span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; ">ga</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_ab71f277c8a494045f1fbe740cb235fc93b882ea_(:0" grphrase="ab71f277c8a494045f1fbe740cb235fc93b882ea" grtype="null">(</span></span><span style="font-size: 10pt; ">genome);</span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span></div></div><div><br></div><div><span style="font-size: 10pt; ">After the GA has finished I would like to further work with the best individual.</span></div><div><span style="font-size: 10pt; ">I can print it out with the following command:</span></div><div><span style="font-size: 10pt; ">&nbsp; &nbsp;&nbsp;</span><span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_cout:0" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">cout</span> &lt;&lt; <span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_ga:1" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">ga</span><span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_.:2" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">.</span>statistics<span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_(:3" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">(</span>)<span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_.:4" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">.</span><span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_bestIndividual:5" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">bestIndividual</span><span class="GRcorrect" id="GRmark_2da6c455721f998c40f23cb7da51bd06518b365e_(:6" grphrase="2da6c455721f998c40f23cb7da51bd06518b365e" grtype="null">(</span>);</div><div><br></div><div><br></div><div>My question is the following :&nbsp;</div><div>&nbsp; &nbsp; &nbsp;How can I assign&nbsp;the value to a variable for example a double (each individual has just a value which is a real).</div><div>&nbsp; &nbsp; &nbsp;I tried to do something like this: &nbsp; &nbsp;double test =&nbsp;<span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_ga:0" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">ga</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_.:1" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">.</span></span><span style="font-size: 10pt; ">statistics</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_(:2" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">(</span></span><span style="font-size: 10pt; ">)</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_.:3" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">.</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_bestIndividual:4" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">bestIndividual</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_(:5" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">(</span></span><span style="font-size: 10pt; ">);</span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; ">&nbsp; &nbsp; &nbsp;(this obviously doesn't work since the type&nbsp;</span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_ga:6" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">ga</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_.:7" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">.</span></span><span style="font-size: 10pt; ">statistics</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_(:8" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">(</span></span><span style="font-size: 10pt; ">)</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_.:9" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">.</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_bestIndividual:10" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">bestIndividual</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_(:11" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">(</span></span><span style="font-size: 10pt; ">)</span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; ">&nbsp;is&nbsp;</span><span style="background-color: rgb(239, 239, 239); font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_const:12" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">const</span> GAGenome&amp; </span><b style="font-size: 10pt; "></b><b style="font-size: 10pt; "></b><b style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_bestIndividual:13" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">bestIndividual</span></b><span style="background-color: rgb(239, 239, 239); font-size: 10pt; "><span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_(:14" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">(</span>unsigned</span><span style="background-color: rgb(239, 239, 239); font-size: 10pt; "></span><span style="background-color: rgb(239, 239, 239); font-size: 10pt; "> <span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_int:15" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">int</span> n=0) <span class="GRcorrect" id="GRmark_9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a_const:16" grphrase="9f4ec52aa93afcd19cafcdd3ce0a0a0f50e7c71a" grtype="null">const</span></span><span style="font-size: 10pt; ">&nbsp;&nbsp;</span><span style="font-size: 10pt; ">)</span></div><div><br></div><div><br></div><div>Can you please tell me how I can get the value from&nbsp;<span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_f60820bc3cad4c04b769f0be02f98c0e6b79a2cc_ga:0" grphrase="f60820bc3cad4c04b769f0be02f98c0e6b79a2cc" grtype="null">ga</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_f60820bc3cad4c04b769f0be02f98c0e6b79a2cc_.:1" grphrase="f60820bc3cad4c04b769f0be02f98c0e6b79a2cc" grtype="null">.</span></span><span style="font-size: 10pt; ">statistics</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_f60820bc3cad4c04b769f0be02f98c0e6b79a2cc_(:2" grphrase="f60820bc3cad4c04b769f0be02f98c0e6b79a2cc" grtype="null">(</span></span><span style="font-size: 10pt; ">)</span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_f60820bc3cad4c04b769f0be02f98c0e6b79a2cc_.:3" grphrase="f60820bc3cad4c04b769f0be02f98c0e6b79a2cc" grtype="null">.</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_f60820bc3cad4c04b769f0be02f98c0e6b79a2cc_bestIndividual:4" grphrase="f60820bc3cad4c04b769f0be02f98c0e6b79a2cc" grtype="null">bestIndividual</span></span><span style="font-size: 10pt; "><span class="GRcorrect" id="GRmark_f60820bc3cad4c04b769f0be02f98c0e6b79a2cc_(:5" grphrase="f60820bc3cad4c04b769f0be02f98c0e6b79a2cc" grtype="null">(</span></span><span style="font-size: 10pt; ">)</span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; "></span><span style="font-size: 10pt; ">&nbsp;into a double variable.</span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; ">Thanks,</span></div><div><span style="font-size: 10pt; ">Alin</span></div><div><br></div>                                               </div></body>
</html>