Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

A Genetic Algorthm Sample in T-SQL Expand / Collapse
Author
Message
Posted Wednesday, January 13, 2010 10:49 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 8:09 AM
Points: 110, Visits: 722
Comments posted to this topic are about the item A Genetic Algorthm Sample in T-SQL
Post #847337
Posted Thursday, January 14, 2010 4:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 21, 2011 8:37 AM
Points: 4, Visits: 17
Great article.

Even had a generation (749) get a perfect score of 500.
Post #847448
Posted Thursday, January 14, 2010 5:13 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 08, 2011 8:52 AM
Points: 26, 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
Post #847462
Posted Thursday, January 14, 2010 5:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 27, 2010 8:30 AM
Points: 9, 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...
Post #847468
Posted Thursday, January 14, 2010 6:54 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, October 08, 2013 8:48 AM
Points: 86, Visits: 474
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!
Post #847510
Posted Thursday, January 14, 2010 7:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, September 03, 2013 11:41 AM
Points: 6, 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
Post #847522
Posted Thursday, January 14, 2010 7:26 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, March 10, 2014 1:08 AM
Points: 130, Visits: 795
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.
Post #847532
Posted Thursday, January 14, 2010 7:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 21, 2011 8:37 AM
Points: 4, 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)
Post #847542
Posted Thursday, January 14, 2010 7:48 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, October 08, 2013 8:48 AM
Points: 86, Visits: 474
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.
Post #847549
Posted Thursday, January 14, 2010 7:53 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 8:09 AM
Points: 110, Visits: 722
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.
Post #847552
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse