Added pyeo. Some changes needed to be made for include files and the like
in some files (and some bugs were fixed as well [Marc: eoOneToOneBreeder was a mess]) eoFunctor.h now contains static functor_category members, this shouldn't hurt anyone.
This commit is contained in:
parent
3937dd0fd6
commit
131e0e033d
40 changed files with 2300 additions and 18 deletions
34
eo/src/pyeo/test/test_reduce.py
Normal file
34
eo/src/pyeo/test/test_reduce.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from maxone import *
|
||||
import unittest
|
||||
|
||||
class TestReduce(unittest.TestCase):
|
||||
|
||||
def run_test(self, ReduceClass, Arg = None):
|
||||
pop = Pop(10, init)
|
||||
for indy in pop: evaluate(indy)
|
||||
|
||||
if Arg:
|
||||
red = ReduceClass(Arg)
|
||||
else:
|
||||
red = ReduceClass()
|
||||
|
||||
red(pop, 5);
|
||||
|
||||
self.failUnlessEqual( len(pop), 5)
|
||||
|
||||
def test_eoTruncate(self):
|
||||
self.run_test(eoTruncate)
|
||||
def test_eoRandomeReduce(self):
|
||||
self.run_test(eoRandomReduce)
|
||||
def test_eoEPRReduce(self):
|
||||
self.run_test(eoEPReduce, 2)
|
||||
def test_eoLinearTruncate(self):
|
||||
self.run_test(eoLinearTruncate)
|
||||
def test_eoDetTournamentTruncate(self):
|
||||
self.run_test(eoDetTournamentTruncate, 2)
|
||||
def test_eoStochTournamentTruncate(self):
|
||||
self.run_test(eoStochTournamentTruncate, 0.9)
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue