SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


A Genetic Algorthm Sample in T-SQL


A Genetic Algorthm Sample in T-SQL

Author
Message
Bill Talada
Bill Talada
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5761 Visits: 2259
Comments posted to this topic are about the item A Genetic Algorthm Sample in T-SQL
youngi
youngi
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 17
Great article.

Even had a generation (749) get a perfect score of 500.
rbenton-657286
rbenton-657286
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 79
This is pretty interesting but I am still wondering how can I implement this into some of the complex processes I have for my job? Thanks for the thought provoking article.

Ross
Brad Anderson-284887
Brad Anderson-284887
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 31
WOW... this is very interesting. I can see several possible applications in the Manufacturing Scheduling area: find the least cost path through a matrix of items where the "cans" are the cost in time to move from one item to another.... these procedures are a good place to start...
Pieter-423357
Pieter-423357
SSChasing Mays
SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)

Group: General Forum Members
Points: 635 Visits: 577
Very interesting article and I like to learn more about the concepts. On a practical level, how does one read the @rules table?

For example, my first lines turned out:
nsewca
000014
000114
000211

How can I link this back to the original grid to see what the computer decided?

thanks!
zmided
zmided
SSC Journeyman
SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)

Group: General Forum Members
Points: 76 Visits: 76
Bill, this is great! I have been interested in Genetic Algorithms for quite some time, but I never thought of implementing them in T-SQL! Great stuff.

Zach Mided
www.AllianceGlobalServices.com
liebesiech
liebesiech
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1088 Visits: 869
I like the article as I'm always want to learn something new! But I cannot say that I have understood everything and I certainly need to print this out and ready it through in a quite hour. Unsure
youngi
youngi
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 17
Pieter as I understand it your rules say...

IF North is empty and South is empty and East is empty and West is empty and there's a can on the current position THEN pick up can
ELSE
IF North is empty and South is empty and East is empty and West has a can and there's a can on the current position THEN pick up can
ELSE
IF North is empty and South is empty and East is empty and West has a wall and there's a can on the current position THEN move South

To work out how it applies to the grid - pick a square, see want adjacent and on the current square and find the rule that matches (though when there are more than one matching rules it would depend on bit of dna created that rule)
Pieter-423357
Pieter-423357
SSChasing Mays
SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)SSChasing Mays (635 reputation)

Group: General Forum Members
Points: 635 Visits: 577
youngi,
in my example:
nsewca
000014
000114
000211

starting at top left as indicated by article
Line 1: instruction is not to move and pick up the can
Line 2: Move 1 square to west and pick up can (however you would hit the wall)
Line 3: Move an additional 2 squares to west and leave can (you would hit wall again)

I am unsure what the A score represents.

Somehow, I would have expected to be able to read the route the robot is going to take, based on prior leanings. Where am I going wrong?

Thanks a bunch.
Bill Talada
Bill Talada
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5761 Visits: 2259
I'm so happy everyone is finding this article potentially useful. I apologize for "hiding" the rules table as a math formula instead of implementing it as a real table but the code runs twice as fast this way. It is important to remember the robot has no memory about previous moves; it only knows what adjacent squares look like now and makes a preprogrammed dna decision on what to do based on this current view. I could add some random walls in the grid and the robot would adapt and still perform very well.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search