<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2722.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>In the current project I'm working on, we wanted to
be able to seed the population with a previous or artificial population from a
file. The file was created using:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>for(int i=0; i<ga.populationSize();
i++)//.size(); i++)<BR> for(int j=0; j<num_param;
j++)<BR> {<BR> genname<<((GABin2DecGenome&)(ga.population().individual(i))).phenotype(j);<BR> genname
<< "\t";<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>where genname is the ofstream... pretty straight
forward. The problem is when reopening the file and reseeding the
population with this code:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>for(int i=0; i<ga.populationSize();
i++)//.size();
i++)<BR> { <BR> for(int j=0;
j<num_param; j++)<BR> { double
temp;<BR> genname>>temp;<BR> ((GABin2DecGenome&)(ga.population().individual(i))).phenotype(j,temp);<BR> }<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I get a whole monster amount of debug output
of:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>GACheckEncoding:</FONT></DIV>
<DIV><FONT face=Arial size=2> specified value cannot be exactly represented
with these bits.</FONT></DIV>
<DIV><FONT face=Arial size=2> desired: -4.569390 actual:
-4.569390 discretization: 0.000153 nbits:
16 min: -5.00000 max: 5.00000</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Now I'm not doing this in an Initializer (which I
probably should) but I didn't think that it was exactly necessary especially
since filling the population this way wasn't going to be mandatory.
Anyway. Any suggestions to cut out all of this extra output? And
does this point to any detrimental effect that this may have?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks for your time,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>John Schloman</FONT></DIV></BODY></HTML>