|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:31 AM
Points: 65,
Visits: 443
|
|
| "nsewc" is the specific view which defines the precise dna action that will be performed. The "a" is the action the robot will do which is either move one square or pick up the current can. The robot will never move a sequence of squares or pickups because it has no memory of previous actions.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, March 21, 2011 8:37 AM
Points: 4,
Visits: 17
|
|
Pieter
The first square 0,0 is the rule has n=2;s=1;e=1;w=2;c=1
as per --1100010010 --1101101111 ...
this then selects the gene number 206 (from 2*81+1*27+1*9+2*3+1*1+1) from the dna. The rules are not in order of execution - their just the conditions extracted from the dna string
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, June 21, 2012 8:27 AM
Points: 3,
Visits: 10
|
|
Awesome!!!! A real eye opener, wonder if other optimization techniques might also be simulated in SQL
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:16 AM
Points: 360,
Visits: 1,505
|
|
youngi (1/14/2010) Pieter
The first square 0,0 is the rule has n=2;s=1;e=1;w=2;c=1
as per --1100010010 --1101101111 ...
this then selects the gene number 206 (from 2*81+1*27+1*9+2*3+1*1+1) from the dna. The rules are not in order of execution - their just the conditions extracted from the dna string
Ok, I get this for the first "turn". What about the second turn? If location 0,0 gets set to 0 then I would expect a rule for n=2;s=1;e=1;w=2;c=0 as that is what the robot would see after the first turn. I don't have a rule for that. I guess I'm not looking at something right.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:31 AM
Points: 65,
Visits: 443
|
|
| If you run the included "DecipherDNA" script and do a "select *" at the bottom of it, you will see all 243 possible views numbered. These are the 243 rules hidden in the math formula as a sort of virtual table. The robot's dna strand is 243 characters long and matches up to these 243 views.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:16 AM
Points: 360,
Visits: 1,505
|
|
Bill Talada (1/14/2010) If you run the included "DecipherDNA" script and do a "select *" at the bottom of it, you will see all 243 possible views numbered. These are the 243 rules hidden in the math formula as a sort of virtual table. The robot's dna strand is 243 characters long and matches up to these 243 views.
Ooops I got ya. It's just showing what it does if it is sitting on a can right now. Thanks. This is really cool.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, February 16, 2012 3:34 PM
Points: 10,
Visits: 57
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:16 AM
Points: 360,
Visits: 1,505
|
|
jeremiah.thomas (1/14/2010) I think i am with Valued member. how do we read the grid that decipherDNA creates?
here is a short example of the grid:
n s e w c a 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 2 1 4 0 0 1 0 1 4 0 0 1 1 1 1 0 0 1 2 1 3 0 0 2 0 1 4 0 0 2 1 1 1 0 1 0 0 1 3
Ok, I have it figured out now. That first line is not what the robot did first. It's what it would do if it encountered that situation, (no can north,south,east,west but it's current location had a can. It would pick it up as indicated by the last digit "4". What you need to do is take it's starting location of 0,0 and determine what the robot would see at that location. It sees 2 1 1 2 1 (that's wall north and west, can south, east and current location.) Now find that in the results of the DecipherDNA script. Oh, first remove the WHERE CLAUSE on the last line. select * from @rules is what you want.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, February 16, 2012 3:34 PM
Points: 10,
Visits: 57
|
|
| thank you very much that makes alot of sense now.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, July 22, 2010 8:59 AM
Points: 110,
Visits: 952
|
|
"awesome" - you did an excellent job of making genetic algorithms approachable I would like to implement this kind of problem solver to our real world situation. What I would love to see next is a deconstruction of a non-toy example that could be solved by GA. I realize that's meta-programming, but if you could express a guide to fitting problems with GA solutions it would be extremely valuable. (even if it's only a "How to approach..." on determining genes or fitness scoring for a specific environment)
I was expecting "A Genetic Algorthm Sample in T-SQL" to use more declarative programming than a procedural approach. Do you think it is possible to construct your example as a selection from a cross product of genetics? I'm imagining a recursive CTE to manage iterations limited by a generational average score below the previous generational average. If you think it's not possible (or simply unfeasibly difficult) does that fact indicate that GA solutions are perhaps ill-suited for modelling in SQL ?
thanks for giving me something interesting to think about today. :)
|
|
|
|