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
25
eo/src/pyeo/test/test_sga.py
Normal file
25
eo/src/pyeo/test/test_sga.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from maxone import *
|
||||
import unittest
|
||||
|
||||
class TestSGA(unittest.TestCase):
|
||||
|
||||
def test(self):
|
||||
evaluate = EvalFunc()
|
||||
init = Init(20)
|
||||
mutate = Mutate()
|
||||
xover = Crossover()
|
||||
|
||||
pop = Pop(50, init)
|
||||
for indy in pop: evaluate(indy)
|
||||
|
||||
select = eoDetTournamentSelect(3);
|
||||
cont = eoGenContinue(20);
|
||||
|
||||
sga = eoSGA(select, xover, 0.6, mutate, 0.4, evaluate, cont);
|
||||
|
||||
sga(pop)
|
||||
|
||||
print pop.best()
|
||||
|
||||
if __name__=='__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue