[Biopython-dev] test_GASelection hangs

Bruce Southey bsouthey at gmail.com
Mon Nov 17 22:49:19 UTC 2008


Peter wrote:
[snip]
>   
>> Alternatively, is there someway to fix the genome of the first organism
>> rather than a random one?
>> For example, instead of the random_organism() declare it as say:
>> org_1=Organism('100', test_fitness)
>>     
>
> We could do something like:
>
> #Choose anything except the worst organism, "000",
> while True :
>     org_1=random_organism()
>     if test_fitness(org_1) > 0 : break
>   
This needs to be:
if org_1.fitness > 0 : break

Also, when looping the test, I occasionally get
Test not getting an organism already in the new population. ... FAIL
Test basic selection on a small population. ... ok

======================================================================
FAIL: Test not getting an organism already in the new population.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_GASelection.py", line 130, in t_no_retrive_organism
    assert new_org != org, "Got organism already in the new population."
AssertionError: Got organism already in the new population.

I'll try to look at it tomorrow.

Bruce

PS thanks for fixing test_GAQueens.py as I have not got it error even 
running it 10000 times.



More information about the Biopython-dev mailing list