lol dumb question but why dosent this work - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

lol dumb question but why dosent this work

drowjamdrowjam Posts: 2Member
[code]
Public Sub Set_Best()
Dim B As Gene = Pop(0)
For lp As Integer = 1 To Pop.GetUpperBound(0)
If B.Fit < Pop(lp).Fit Then
B = Pop(lp)
B.Fit = Pop(lp).Fit
End If

Next
""""""""""""The problem is below best.fit keeps going down how is that possible when this is the only place in the code i use it. btw i know i shouldnt use letters it was just a quick throw together so dont be to harsh on me.
If Best.Fit < B.Fit Then
Best = B
Best.Fit = B.Fit
End If

End Sub
[/code]
Sign In or Register to comment.