Code center > Suggestions
.sexrepro reimplemented in 2.43.1
shvarz:
Hmm, fun discussion.. I personally find both approaches interesting and can't make my mind as to which one would be better.
From a practical point of view, I just want to see something done to get sexrepro working. My worry is that it's just not going to work. The requirements that Eric plans to impose seem to require a fairly complex behavior and I think that there is no chance for sexrepro to evolve on its own.
EricL:
--- Quote from: shvarz ---My worry is that it's just not going to work. The requirements that Eric plans to impose seem to require a fairly complex behavior and I think that there is no chance for sexrepro to evolve on its own.
--- End quote ---
I like the the shot-based fertilization method over the "look at each other" method. So, if there are no objections, I'll change over to that for 2.43.1.
So, how likely is sexual reproduction to evolve on it's own? Well, two things need to happen. Bots need to evolve the placement of a value into .sexrepro and the same or a different line needs to shoot -8 shots.
I don't plan to reset .sexrepro unless sexual reproduction actually occurs (so that males can detect females in heat) so bots need only evolve the DNA to set this sysvar once in a while or have it set via altzheimers or info shots or similar.
Negative shot values are mod 8, so there is a 1 in 16 chance that an evolved shooter will be shooting fertilization shots.
So, it's doesn't stike me that it will be too difficult for sexual reproduction to evolve naturally. Harder than asexual reproduction as it involves two bots and two sysvars, but not radically improbable I think.
Whether selection will favor it is a different question all together...
EricL:
--- Quote from: Numsgil ---I respect our unspoken agreement to leave either project to the other's trust. Even if I think your agreement in this area is more from a belief that DB3 is vaporwear. I'll respect whatever decision you make in the end, for this simple reason that you're the one coding it, but I do not see any advantages to what you propose over what I propose, except ego stroking. No offense intended.
--- End quote ---
None taken.
I have enough expereice to know how hard it is to build something that complex from scratch that has to be largly complete and reasonbly bug free out of the gate and get it to critical mass, particularily when your chasing a moving target (my fault). I've long argued for the incremental approach of portting the VB version then adding the new physics, but we need not get into that again here. So, I wouldn't go so far as to call DB3 vaporware, but it's gonna take more than some cool new physics to make it real. No offense intended.
Okay, I give. If you can articulate the psuedo code for an effecient crossover algorithm that operates on 2.43 DNA, I'll use it and put the cross operator on hold for the time being.
--- Quote from: Numsgil ---Am I misunderstanding you here? Isn't any value in .sexrepro implying that you're being female? A sperm shot (or whatever you want to call it) probably would use seperate machinery than .sexrepro, right? Maybe a -8 shot, or .jerk or something crass like that?
--- End quote ---
Correct. Any value in .sexrepro implies your female and that your willing to devote your own expensive resources to reproduction. I plan to use -8 shots for fertilization shots.
Numsgil:
I'll do you one better and see if I can work out an actual program demonstrating an algorithm. Probably done in C# operating on strings, for simplicity.
I don't take offense at a vaporware-esque attitude towards DB3. I'm keenly aware of the difficulties. However, I think if I can get the physics working like I want (no mean feat, to be sure), the rest should be downhill. Physics is what stopped the C++ version from being "complete".
EricL:
Here is the current crossover routine for reference:
--- Code: ---Public Function Crossover(male As Integer, female As Integer, offspring As Integer)
Dim parent As Integer
Dim I As Integer
Dim t As Integer
Dim x As Integer
' The length of the offspring's DNA will be the length of the longer of the parent's DNA
If rob(male).DnaLen > rob(female).DnaLen Then
ReDim rob(offspring).DNA(UBound(rob(male).DNA))
Else
ReDim rob(offspring).DNA(UBound(rob(female).DNA))
End If
'flip a coin as to which parent goes first
If Random(0, 1) > 0.5 Then
parent = female
Else
parent = male
End If
For t = 1 To UBound(rob(offspring).DNA)
' test for hitting the end of one of the parent's DNA
' if we have, then if we are currently on that parent, stop.
' if we arn't, then copy the rest of the DNA from the other parent
If (rob(male).DNA(t).tipo = 10) And (rob(male).DNA(t).value = 1) Or _
(rob(female).DNA(t).tipo = 10) And (rob(female).DNA(t).value = 1) Then
If (rob(parent).DNA(t).tipo = 10) And (rob(parent).DNA(t).value = 1) Then
' DNA copying hit the end of the parent. The offspring's DNA length is the shorter of the two parents.
rob(offspring).DNA(t) = rob(parent).DNA(t)
ReDim Preserve rob(offspring).DNA(t)
Else
' DNA copying is currently on the longer parent. No end hit in copying, take the rest of the longer parent
For x = t To UBound(rob(offspring).DNA)
rob(offspring).DNA(x) = rob(parent).DNA(x)
Next x
End If
Exit Function ' we're done.
End If
' copy the base pair from the current parent
rob(offspring).DNA(t) = rob(parent).DNA(t)
' If we hit a crossover point in either parent then switch parents
If (rob(male).DNA(t).tipo = 9) And (rob(male).DNA(t).value = 5) Or _
(rob(female).DNA(t).tipo = 9) And (rob(female).DNA(t).value = 5) Then
'Flip a coin. 50% chance of switching parents at crossover points
If Random(0, 1) > 0.5 Then
If parent = female Then
parent = male
Else
parent = female
End If
End If
End If
Next t
End Function
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version