Code center > Bugs and fixes

Let's make a stable platform

<< < (20/26) > >>

PurpleYouko:

--- Quote ---I still don't know where to go to make that change you suggested!!!!
--- End quote ---

It's in the place where the original error occured.

The nextElement function in the Mutations module.

here it is again.


--- Code: ---Public Function NextElement(ByRef DNA() As block, beginning As Integer, tipo As Integer, value As Integer) As Integer
  'takes the input for the first value in a gene and returns the position of the next statement
  'as defined by tipo and value
  Dim k As Integer
  Dim uboundarray As Long
  
  uboundarray = UBound(DNA())
  If DNA(uboundarray).tipo <> 4 And DNA(uboundarray).value <> 4 Then
    ReDim Preserve DNA(uboundarray + 1)
    DNA(uboundarray + 1).tipo = 4
    DNA(uboundarray + 1).value = 4
  End If
  k = beginning
  
  If beginning > 0 And beginning < uboundarray Then  'change this line.
    While Not (DNA(k).tipo = 4 And DNA(k).value = 4) And Not (DNA(k).tipo = tipo And DNA(k).value = value)
      k = k + 1
    Wend
    If Not (DNA(k).tipo = tipo And DNA(k).value = value) Then k = -1
  Else 'beginning wasn't valid
    k = -1
  End If
  
  NextElement = k
End Function
--- End code ---

PurpleYouko:
I'm now up to 105,000 cycles with this sim and only one crash so far.

Now my veggies have started mutating. I'm sure they shouldn't be doing that.

PurpleYouko:
Griz.

FYI

The bug that I was working on here was reported by Testlund earlier in this thread.

here is a link to his original post.

http://forum.darwinbots.com/index.php?show...dpost&p=1121272

PurpleYouko:
Yup I know what you mean and that is why we now have a somewhat official channel for reporting the bugs.  :)

Numsgil:
Actually I can't take any credit ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version