コード例 #1
0
ファイル: TestMutsCx.py プロジェクト: uw-cmg/MAST
def test_cx(ind1, ind2):
    #Test cxTP
    from MAST.structopt_stem.crossover.cxTP import cxTP
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTP(i1,i2,A,False)
    
    #Test cxTPA
    from MAST.structopt_stem.crossover.cxTPA import cxTPA
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTPA(i1,i2,A,False)
    
    #Test cxTPC
    from MAST.structopt_stem.crossover.cxTPC import cxTPC
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTPC(i1,i2,A,False)
    
    #Test NewClus
    from MAST.structopt_stem.crossover.NewClus import NewClus
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = NewClus(i1,i2,A,False)
    
    #Test randalloybox
    from MAST.structopt_stem.crossover.randalloybox import randalloybox
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = randalloybox(i1,i2,A,False)
    
    #Test rotct_rand_clus
    from MAST.structopt_stem.crossover.rotct_rand_clus import rotct_rand_clus
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct_rand_clus(i1,i2,A,False)
    
    #Test rotct_rand
    from MAST.structopt_stem.crossover.rotct_rand import rotct_rand
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct_rand(i1,i2,A,False)
    
    #Test rotct
    from MAST.structopt_stem.crossover.rotct import rotct
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct(i1,i2,A,False)
コード例 #2
0
ファイル: TestMutsCx.py プロジェクト: zhenming-xu/MAST
def test_cx(ind1, ind2):
    #Test cxTP
    from MAST.structopt_stem.crossover.cxTP import cxTP
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTP(i1, i2, A, False)

    #Test cxTPA
    from MAST.structopt_stem.crossover.cxTPA import cxTPA
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTPA(i1, i2, A, False)

    #Test cxTPC
    from MAST.structopt_stem.crossover.cxTPC import cxTPC
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTPC(i1, i2, A, False)

    #Test NewClus
    from MAST.structopt_stem.crossover.NewClus import NewClus
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = NewClus(i1, i2, A, False)

    #Test randalloybox
    from MAST.structopt_stem.crossover.randalloybox import randalloybox
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = randalloybox(i1, i2, A, False)

    #Test rotct_rand_clus
    from MAST.structopt_stem.crossover.rotct_rand_clus import rotct_rand_clus
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct_rand_clus(i1, i2, A, False)

    #Test rotct_rand
    from MAST.structopt_stem.crossover.rotct_rand import rotct_rand
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct_rand(i1, i2, A, False)

    #Test rotct
    from MAST.structopt_stem.crossover.rotct import rotct
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct(i1, i2, A, False)
コード例 #3
0
     pass
 try:
     from MAST.structopt_stem.crossover.cxTP import cxTP
     i1 = ind1.duplicate()
     i2 = ind2.duplicate()
     nc1, nc2 = cxTP(i1,i2,A)
     print 'cxTP crossover test SUCCESSFUL'
 except Exception, e:
     print 'ERROR: cxTP crossover test FAILED'
     print e
     pass
 try:
     from MAST.structopt_stem.crossover.cxTPA import cxTPA
     i1 = ind1.duplicate()
     i2 = ind2.duplicate()
     nc1, nc2 = cxTPA(i1,i2,A)
     print 'cxTPA crossover test SUCCESSFUL'
 except Exception, e:
     print 'ERROR: cxTPA crossover test FAILED'
     print e
     pass
 try:
     from MAST.structopt_stem.crossover.cxTPC import cxTPC
     i1 = ind1.duplicate()
     i2 = ind2.duplicate()
     nc1, nc2 = cxTPC(i1,i2,A)
     print 'cxTPC crossover test SUCCESSFUL'
 except Exception, e:
     print 'ERROR: cxTPC crossover test FAILED'
     print e
     pass