Code center > Bug reports
Runtime error 11 in Mutation rates dialog
EricL:
The Mutation Rates menu item should be disabled when no bot is selected. This is the ultimate cause of the divide by zero.
In 2.42.9p and beyond, the Mutation Rates menu item will be disabled unless a bot is selected.
I cannot reproduce the crash when a bot is selected. What I suspect is happening is that running leagues is messing up the data structure that underlies the species list box on the optiosn dialog. The way the Mutation Rates dialog works when it is invoked from somewhere other than the optiosn dialog is to fake out an element in this structure using the bot with the focus. Leauges is potentially messing up this fake out. So, I suspect you will only be able to get it to crash even when a bot is selected only after running leagues. If you have not run leagues that DB invocation, I bet it will not crash with a bot selected.
I will be spending mroe time on leagues thios week and may pick this up but the larger issue of crashing when no bot is selected is addressed in 2.42.9p and beyond.
Griz:
ver 2.42.9r
got this a couple of times ...
runtime error 11, division by zero ...
clicking the Mutations button on the Species page to ensure
a species doesn't have them enabled ... I got the error.
the last two times was coming back from having run
Leagues, wanting to run a special match between two
bots ... but this time outside of Leagues.
those bots happened to be in the Species window ...
and I clicked on one, then clicked on the Mutations button
to see if they were indeed disabled, and got the error.
now I didn't actually load that species in before doing so ...
as they were already listed ...
so that may be it.
anyway ...
when the problem does show up ...
as it seems to do on occasion ...
it leads me to this:
in MutationsProbability ...
line 134:
Probs(1).text = CStr(CLng(1 / Psome))
Psome = 0
--- Code: ---Private Sub Probs_Change(Index As Integer)
If Index = 0 Then
If TmpOpts.Specie(optionsform.CurrSpec).Mutables.mutarray(Mode) = 0 Then
TmpOpts.Specie(optionsform.CurrSpec).Mutables.mutarray(Mode) = 1
End If
TmpOpts.Specie(optionsform.CurrSpec).Mutables.mutarray(Mode) = val(Probs(Index)) * _
Sgn(TmpOpts.Specie(optionsform.CurrSpec).Mutables.mutarray(Mode))
'update summations...
With TmpOpts.Specie(optionsform.CurrSpec).Mutables
Dim Pnone As Single, Psome As Single
Pnone = Anti_Prob(.mutarray(1)) * _
Anti_Prob(.mutarray(2)) * _
Anti_Prob(.mutarray(3)) * _
Anti_Prob(.mutarray(5)) * _
Anti_Prob(.mutarray(6))
Psome = 1 - Pnone
Probs(1).text = CStr(CLng(1 / Psome))
End With
End If
End Sub
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version