Author Topic: Genetic Distance / Generational Distance  (Read 11517 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #15 on: June 13, 2012, 11:23:21 AM »
Sorry Numsgil I don't have pro. (see picky) I should of been less lazy when committing that revision.  But I will list my updates here:

Quote
Updates to icons
array out of bounds bug fixes (sometimes code never finds "end")
subtraction overflow protection
rotate robot on placment (has to do with vegs and manually inserted robots)
skin fix (when skin was trasfeared to robot the first element was always zero)
A debug button to the console window (did not code it yet, should replace RobDebug form)
Else genes where not being displayed properly in the gene activation window fix
maybe a couple more minor once that I don't remember and are not worth mentionaning
« Last Edit: June 13, 2012, 11:47:43 AM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #16 on: June 13, 2012, 01:02:42 PM »
Bleh okay.  (You might want to grab a command line SVN client then.  For example, SlikSVN.  Just because there are a number of tasks that you might want to be able to do that SmartSVN won't let you do without a license).

I'll update the commit message.  Are the changes you're describing in addition to the revision to CL 61?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #17 on: June 13, 2012, 01:27:43 PM »
Quote
Are the changes you're describing in addition to the revision to CL 61?

Yes

Quote
You might want to grab a command line SVN client then.

Hate command line, I will just be careful to add proper comments next time. Is there any other components that I may need that are not in unlicensed SmartSVN ?
« Last Edit: June 13, 2012, 01:32:22 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #18 on: June 13, 2012, 01:36:45 PM »
If you have to do much branching work I'm not sure how much unlicensed SmartSVN will let you do.  Possibly also generating or integrating patches, if you need to do that (rare but possible).  For day-to-day work it should be fine.
« Last Edit: June 13, 2012, 01:41:30 PM by Numsgil »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #19 on: June 13, 2012, 01:39:25 PM »
 8)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #20 on: June 13, 2012, 01:41:34 PM »
For commit messages, a sentence or two is usually fine, but be as precise as you can.  You don't know when you might leave the program to work on other stuff, and you want whoever looks at it next (yourself included) to have an idea of where you left off.  For instance, a bad message would be: "physics stuff".  What physics stuff?  GUI work or engine work?  Is it in a finished state?  A better message would be: "Fixing bounciness issue when bots collide.  Updating physics options form with a new slider to control bounciness.".

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #21 on: June 16, 2012, 01:05:52 PM »
I don't think the crossover code works correctly at all:

I set up this test:

Code: [Select]
Private Sub MDIForm_Load()
'debug
Randomize
Do
Dim dna1(9) As block
Dim dna2(11) As block

ReDim rob(1)

dna1(0).value = 100
dna1(1).value = 200
dna1(2).value = 300
dna1(3).value = 400
dna1(4).value = 500
dna1(5).value = 600
dna1(6).value = 700
dna1(7).value = 800
dna1(8).value = 900
'
dna1(9).value = 1
dna1(9).tipo = 10

dna2(0).value = 111
dna2(1).value = 2
dna2(2).value = 3
dna2(3).value = 4
dna2(4).value = 400
dna2(5).value = 500
dna2(6).value = 600
dna2(7).value = 8
dna2(8).value = 9
dna2(9).value = 10
dna2(10).value = 11
'
dna2(11).value = 1
dna2(11).tipo = 10

rob(0).DNA = dna1
rob(0).DnaLen = DnaLen(rob(0).DNA)
rob(0).spermDNA = dna2
rob(0).spermDNAlen = DnaLen(rob(0).spermDNA)


Crossover 0, 1

Dim i As Integer
For i = 0 To UBound(rob(1).DNA)
MsgBox rob(1).DNA(i).value
Next

MsgBox "reset"

Loop
'debug


and it is ether returning the DNA or the SpermDNA

it should be returning one of the four below:

Code: [Select]
111,2,3,4,400,500,600,700,800,900,1
100,200,300,400,500,600,8,9,10,11,1

it is only returning:

Code: [Select]
100,200,300,400,500,600,700,800,900,1

or

111,2,3,4,400,500,600,8,9,10,11,1

is this output wrong or am I missing a step?
« Last Edit: June 16, 2012, 01:08:52 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #22 on: June 19, 2012, 02:48:59 AM »
I think it has a threshold where if the DNA is dissimilar enough, it doesn't do the crossover at all.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #23 on: June 19, 2012, 02:44:20 PM »
surely this has to be similer enough (same result  :():

Quote
'debug
Randomize
Do
Dim dna1(100) As block
Dim dna2(100) As block

ReDim rob(1)
Dim i As Integer
For i = 0 To 99
dna1(i).value = i
dna2(i).value = i
Next

dna1(0).tipo = 1
dna1(1).tipo = 1
dna1(2).tipo = 1

dna1(99).tipo = 1
dna1(98).tipo = 1
dna1(97).tipo = 1


dna1(100).value = 1
dna1(100).tipo = 10

dna2(100).value = 1
dna2(100).tipo = 10

rob(0).DNA = dna1
rob(0).DnaLen = DnaLen(rob(0).DNA)
rob(0).spermDNA = dna2
rob(0).spermDNAlen = DnaLen(rob(0).spermDNA)


Crossover 0, 1
Dim k As String
k = ""
For i = 0 To 99
k = k & " " & rob(1).DNA(i).tipo
Next

MsgBox k

Loop
'debug

btw, what is the threshold % anyway? because I found no code at all that looks like it is checking for dissimilarity

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #24 on: June 20, 2012, 01:31:31 PM »
It smells like it's just plain broken then.  You should probably attempt to fix it or check out a previous version and see if you can isolate which release it broke (and figure out what the change was).

I don't remember the threshhold percent.  I think it was supposed to be like 50%.  This is the relevant thread where Eric was discussing what he was trying to do.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #25 on: June 20, 2012, 01:51:13 PM »
I'll make it 52%. I have an idea about how to fix this, I'll try my best. If the robots is 52% or less similer I won't let them reproduce sexually at all, the system I am thinking of will also give me direct access to genetic distance.

edit: Changed my mind about 40%; I want an eco-system to develop...
« Last Edit: June 20, 2012, 06:08:17 PM by Botsareus »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #26 on: June 22, 2012, 07:02:53 PM »
I have to stay off DB for a while and try to get my summer homework done. I also have a soccer AI project I am writing a revision on for school. I can not concentrate on more then two things at a time. For the soccer AI I will only have access to 16 cores server until the end of Fall, so I have to get my prioritys straight. I got about 7 chapters in MCPD so I hope I start working on DB crossover fix by the end of August. If Shasta wants to resume work on his version of the chloroplast code, please coordinate with Numsgil because he moved it to a different revision. For now, good luck to all.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #27 on: July 12, 2012, 05:31:20 PM »
I am going to resume work soon. After thinking about it at length I have decided to go with 40% after all. The main reason being is that amplification (when implemented) will drastically change the DNA on each mutation.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #28 on: July 23, 2012, 11:14:23 AM »
They gave me a new 30 day trial with the smartsvn update, so I went in an added a proper commit message instead of "some updates"

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Genetic Distance / Generational Distance
« Reply #29 on: July 28, 2012, 08:08:11 PM »
[small bump]

Definitely starting work in August