Added multi-objective support to PyEO (and changed its name to that)
This commit is contained in:
parent
3267a34191
commit
0a4fb55031
21 changed files with 60 additions and 328 deletions
23
eo/src/pyeo/test/test_mo.py
Normal file
23
eo/src/pyeo/test/test_mo.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from maxone import *
|
||||
import unittest
|
||||
|
||||
class TestSGA(unittest.TestCase):
|
||||
|
||||
def testMO(self):
|
||||
setObjectivesSize(2);
|
||||
setObjectivesValue(0,1);
|
||||
setObjectivesValue(1,-1);
|
||||
|
||||
eo1 = EO();
|
||||
eo2 = EO();
|
||||
|
||||
eo1.fitness = [0,1];
|
||||
eo2.fitness = [1,1];
|
||||
|
||||
print dominates(eo1, eo2)
|
||||
setObjectivesValue(0,-1)
|
||||
setObjectivesValue(1,1);
|
||||
print dominates(eo1, eo2)
|
||||
|
||||
if __name__=='__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue