<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Hi </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Pete</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; You are right. in this function only one variable is there. I should make&nbsp;one gene. but when I did that there were some compilation error ( as I'm out of station now, I'm not able to write those exact errors). </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Secondly for "ga.minimize()", I saw an example in galib246 of maximum and minimum function, there I saw this function, and I thought it may be for some kind of minimization process.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thirdly, for&nbsp;&nbsp; "map..add(16, -3, -2)" this mapping I'm not sure what I should. as I know the two roots I filled it in maximum and minimum place. I think it's not the right concept.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Regards</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Somnath<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: "galib-request@mit.edu" &lt;galib-request@mit.edu&gt;<BR>To: galib@mit.edu<BR>Sent: Monday, 19 November, 2007 10:42:18 PM<BR>Subject: galib Digest, Vol 52, Issue 6<BR><BR>Send galib mailing list submissions to<BR>&nbsp;&nbsp;&nbsp; <A href="mailto:galib@mit.edu" ymailto="mailto:galib@mit.edu">galib@mit.edu</A><BR><BR>To subscribe or unsubscribe via the World Wide Web, visit<BR>&nbsp;&nbsp;&nbsp; <A href="http://mailman.mit.edu/mailman/listinfo/galib" target=_blank>http://mailman.mit.edu/mailman/listinfo/galib</A><BR>or, via email, send a message with subject or body 'help' to<BR>&nbsp;&nbsp;&nbsp; <A href="mailto:galib-request@mit.edu" ymailto="mailto:galib-request@mit.edu">galib-request@mit.edu</A><BR><BR>You can reach the person managing the list at<BR>&nbsp;&nbsp;&nbsp; <A href="mailto:galib-owner@mit.edu"
 ymailto="mailto:galib-owner@mit.edu">galib-owner@mit.edu</A><BR><BR>When replying, please edit your Subject line so it is more specific<BR>than "Re: Contents of galib digest..."<BR><BR><BR>Today's Topics:<BR><BR>&nbsp; 1. Re: GA program (Peter Jay Salzman)<BR><BR><BR>----------------------------------------------------------------------<BR><BR>Message: 1<BR>Date: Fri, 16 Nov 2007 16:45:11 -0500<BR>From: Peter Jay Salzman &lt;<A href="mailto:p@dirac.org" ymailto="mailto:p@dirac.org">p@dirac.org</A>&gt;<BR>Subject: Re: [galib] GA program<BR>To: GALib Mailing List &lt;<A href="mailto:galib@mit.edu" ymailto="mailto:galib@mit.edu">galib@mit.edu</A>&gt;<BR>Message-ID: &lt;<A href="mailto:20071116214511.GA24158@dirac.org" ymailto="mailto:20071116214511.GA24158@dirac.org">20071116214511.GA24158@dirac.org</A>&gt;<BR>Content-Type: text/plain; charset=iso-8859-1<BR><BR>Hi Somnath,<BR><BR><BR>On Sat 17 Nov 07, 12:17 AM, Somnath Bhattacharjee &lt;<A
 href="mailto:sn.bhattacharjee@yahoo.co.in" ymailto="mailto:sn.bhattacharjee@yahoo.co.in">sn.bhattacharjee@yahoo.co.in</A>&gt; said:<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I want to solve the Quadratic equation y= x*x+5*x+6.<BR>&gt;&nbsp; &nbsp; According to manual calculation the result will be two roots ( -3 and -2 ,<BR>&gt;&nbsp; &nbsp; for these values of x the function value will be ZERO ).<BR><BR>OK, that's what I suspected.<BR><BR>&gt;&nbsp; &nbsp; Now by GA the<BR>&gt;&nbsp; &nbsp; results (means the roots) should be nearly -3 and -2 (not exactly -3,-2).<BR>&gt;&nbsp; &nbsp; I'm not sure that&nbsp; it is right or not. I'm beginner in GA so your<BR>&gt;&nbsp; &nbsp; suggestion will be benchmark for me.<BR><BR>There's nothing wrong with being a beginner.&nbsp; I'm a beginner too, both with<BR>GAs in general and with GALib.&nbsp; Let me point out a few things that I noticed<BR>about your
 code.<BR><BR><BR>First off, you have the following line of code in your program:<BR><BR>&gt;&nbsp; &nbsp; &nbsp; ga.minimize();<BR><BR>What do you suppose this line of code does?&nbsp; Compare that with what you want<BR>to accomplish.<BR><BR><BR><BR>Secondly, look at your objective function:<BR><BR>&gt;&nbsp; &nbsp; &nbsp; GABin2DecPhenotype map;<BR>&gt;&nbsp; &nbsp; &nbsp; map.add(16, -3, -2);<BR>&gt;&nbsp; &nbsp; &nbsp; map.add(16, -3, -2);<BR>&gt;<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; ...<BR>&gt;&nbsp; &nbsp; <BR>&gt;&nbsp; &nbsp; float<BR>&gt;&nbsp; &nbsp; objective(GAGenome &amp; c)<BR>&gt;&nbsp; &nbsp; {<BR>&gt;&nbsp; &nbsp; &nbsp; GABin2DecGenome &amp; genome = (GABin2DecGenome &amp;)c;<BR>&gt;&nbsp; &nbsp; &nbsp; float y=6.0;<BR>&gt;&nbsp; &nbsp; &nbsp; y&nbsp; += genome.phenotype(0) * genome.phenotype(0);<BR>&gt;&nbsp; &nbsp; &nbsp; y += 5 * genome.phenotype(0);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; return y;<BR>&gt;&nbsp; &nbsp; }<BR><BR>You have
 two genes in your genome.<BR><BR>Your objective function is a function of only one variable.&nbsp; It says a whole<BR>lot about genome.phenotype(0).&nbsp; What does it have to say about<BR>genome.phenotype(1)?&nbsp; GALib knows how fit phenotype(0) is because<BR>objective() returns a fitness score that's a function of phenotype(0).<BR><BR>But the objective is not a function of phenotype(1).&nbsp; How does GALib know<BR>how fit phenotype(1) is?<BR><BR><BR>Thirdly, look at the "roots" that GALib is giving to you.&nbsp; You have two<BR>numbers (note: increase the number of generations to see the "root values"<BR>more clearly.)&nbsp; Now focus on the meaning of this:<BR><BR>&gt;&nbsp; &nbsp; &nbsp; ga.minimize();<BR><BR>Notice anything?&nbsp; If so, you've just discovered what genome.phenotype(0)<BR>really is.&nbsp; Now the question is, what is genome.phenotype(1)?<BR><BR>To find out what phenotype(1) is, turn your mutation and crossover<BR>probabilities
 way, way down to almost zero.&nbsp; Take a look at what the<BR>starting values are for your two genes, before you evolve the system. &nbsp; Now<BR>evolve the system and look at the final values.<BR><BR>You should be able to guess what genome.phenotype(1) is from this.<BR><BR><BR>Lastly, you set your gene value boundaries to fall exactly on the two<BR>numbers you were expecting GALib to find.&nbsp; I don't really know much about<BR>GAs myself, but I wonder if that's a good strategy.&nbsp; It could be.&nbsp; But until<BR>I learned a bit more about GAs, I'd probably put the expected values on the<BR>"inside" of the search domain, not on its boundary.<BR><BR>Weird things can happen on boundaries.<BR><BR><BR>Again, I'm new to all this too, so perhaps all this is wrong, so take<BR>everything I say with a grain of salt.<BR><BR>Pete<BR><BR>-- <BR>GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E&nbsp; 70A9 A3B9 1945 67EA 951D<BR>Last night I dreamt of
 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0<BR><BR>"A mathematician is a machine for converting coffee&nbsp; &nbsp; <A href="mailto:p@dirac.org" ymailto="mailto:p@dirac.org">p@dirac.org</A><BR>into theorems."&nbsp; &nbsp; -- Paul Erd?s&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.dirac.org/" target=_blank>http://www.dirac.org</A><BR><BR><BR>------------------------------<BR><BR>_______________________________________________<BR>galib mailing list<BR><A href="mailto:galib@mit.edu" ymailto="mailto:galib@mit.edu">galib@mit.edu</A><BR><A href="http://mailman.mit.edu/mailman/listinfo/galib" target=_blank>http://mailman.mit.edu/mailman/listinfo/galib</A><BR><BR><BR>End of galib Digest, Vol 52, Issue 6<BR>************************************<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>


      <!--5--><hr size=1></hr> Get the freedom to save as many mails as you wish. <a href="http://in.rd.yahoo.com/tagline_mail_5/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/">Click here to know how.</a></body></html>