I'm conditioning my simulations of a selective sweep on an allele not being lost, so in each generation I check if its frequency > 0 and otherwise restart with the following statement:
m2mut = sim.mutationsOfType(m2);
freqs = sim.mutationFrequencies(p3, m2mut);
if(freqs==0){ <RESTART> }
If the allele is present, mtuationFrequencies returns a float-valued decimal and the conditional statement evaluates as false. However, if the allele is absent, then mutationFrequencies() returns float(0), which is empty, and thus cannot be assigned to the variable freqs nor evaluated in a conditional statement.
Is there some way to return 0.0 using mutationFrequencies() or some similar function rather than float(0) in this case?