<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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> You are right. in this function only one variable is there. I should make 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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thirdly, for "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"> </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" <galib-request@mit.edu><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> <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> <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> <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> <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> 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 <<A href="mailto:p@dirac.org" ymailto="mailto:p@dirac.org">p@dirac.org</A>><BR>Subject: Re: [galib] GA program<BR>To: GALib Mailing List <<A href="mailto:galib@mit.edu" ymailto="mailto:galib@mit.edu">galib@mit.edu</A>><BR>Message-ID: <<A href="mailto:20071116214511.GA24158@dirac.org" ymailto="mailto:20071116214511.GA24158@dirac.org">20071116214511.GA24158@dirac.org</A>><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 <<A
href="mailto:sn.bhattacharjee@yahoo.co.in" ymailto="mailto:sn.bhattacharjee@yahoo.co.in">sn.bhattacharjee@yahoo.co.in</A>> said:<BR>> I want to solve the Quadratic equation y= x*x+5*x+6.<BR>> According to manual calculation the result will be two roots ( -3 and -2 ,<BR>> for these values of x the function value will be ZERO ).<BR><BR>OK, that's what I suspected.<BR><BR>> Now by GA the<BR>> results (means the roots) should be nearly -3 and -2 (not exactly -3,-2).<BR>> I'm not sure that it is right or not. I'm beginner in GA so your<BR>> suggestion will be benchmark for me.<BR><BR>There's nothing wrong with being a beginner. I'm a beginner too, both with<BR>GAs in general and with GALib. 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>> ga.minimize();<BR><BR>What do you suppose this line of code does? Compare that with what you want<BR>to accomplish.<BR><BR><BR><BR>Secondly, look at your objective function:<BR><BR>> GABin2DecPhenotype map;<BR>> map.add(16, -3, -2);<BR>> map.add(16, -3, -2);<BR>><BR>> ...<BR>> <BR>> float<BR>> objective(GAGenome & c)<BR>> {<BR>> GABin2DecGenome & genome = (GABin2DecGenome &)c;<BR>> float y=6.0;<BR>> y += genome.phenotype(0) * genome.phenotype(0);<BR>> y += 5 * genome.phenotype(0);<BR>> return y;<BR>> }<BR><BR>You have
two genes in your genome.<BR><BR>Your objective function is a function of only one variable. It says a whole<BR>lot about genome.phenotype(0). What does it have to say about<BR>genome.phenotype(1)? 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). How does GALib know<BR>how fit phenotype(1) is?<BR><BR><BR>Thirdly, look at the "roots" that GALib is giving to you. You have two<BR>numbers (note: increase the number of generations to see the "root values"<BR>more clearly.) Now focus on the meaning of this:<BR><BR>> ga.minimize();<BR><BR>Notice anything? If so, you've just discovered what genome.phenotype(0)<BR>really is. 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. Take a look at what the<BR>starting values are for your two genes, before you evolve the system. 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. I don't really know much about<BR>GAs myself, but I wonder if that's a good strategy. It could be. 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 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 <A href="mailto:p@dirac.org" ymailto="mailto:p@dirac.org">p@dirac.org</A><BR>into theorems." -- Paul Erd?s <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>