예제 #1
0
def test_cx(ind1, ind2):
    #Test cxTP
    from MAST.structopt.crossover.cxTP import cxTP
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTP(i1, i2, A, False)

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

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

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

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

    #Test rotct_rand_clus
    from MAST.structopt.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.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.crossover.rotct import rotct
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct(i1, i2, A, False)
예제 #2
0
파일: TestMutsCx.py 프로젝트: m-yu/MAST
def test_cx(ind1, ind2):
    #Test cxTP
    from MAST.structopt.crossover.cxTP import cxTP
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTP(i1,i2,A,False)
    
    #Test cxTPA
    from MAST.structopt.crossover.cxTPA import cxTPA
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTPA(i1,i2,A,False)
    
    #Test cxTPC
    from MAST.structopt.crossover.cxTPC import cxTPC
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = cxTPC(i1,i2,A,False)
    
    #Test NewClus
    from MAST.structopt.crossover.NewClus import NewClus
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = NewClus(i1,i2,A,False)
    
    #Test randalloybox
    from MAST.structopt.crossover.randalloybox import randalloybox
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = randalloybox(i1,i2,A,False)
    
    #Test rotct_rand_clus
    from MAST.structopt.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.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.crossover.rotct import rotct
    i1 = ind1.duplicate()
    i2 = ind2.duplicate()
    nc1, nc2 = rotct(i1,i2,A,False)
예제 #3
0
파일: cx_test.py 프로젝트: zhenming-xu/MAST
        i1 = ind1.duplicate()
        i2 = ind2.duplicate()
        nc1, nc2 = rotct_rand_clus(i1, i2, A)
        print 'rotct_rand_clus crossover test SUCCESSFUL'
    except Exception, e:
        print 'ERROR: rotct_rand_clus crossover test FAILED'
        print e
        pass
    try:
        from MAST.structopt.crossover.rotct_rand import rotct_rand
        i1 = ind1.duplicate()
        i2 = ind2.duplicate()
        nc1, nc2 = rotct_rand(i1, i2, A)
        print 'rotct_rand crossover test SUCCESSFUL'
    except Exception, e:
        print 'ERROR: rotct_rand crossover test FAILED'
        print e
        pass
    try:
        from MAST.structopt.crossover.rotct import rotct
        i1 = ind1.duplicate()
        i2 = ind2.duplicate()
        nc1, nc2 = rotct(i1, i2, A)
        print 'rotct crossover test SUCCESSFUL'
    except Exception, e:
        print 'ERROR: rotct crossover test FAILED'
        print e
        pass
    print 'Crossover Function Testing Complete'
    return
예제 #4
0
파일: cx_test.py 프로젝트: m-yu/MAST
        i1 = ind1.duplicate()
        i2 = ind2.duplicate()
        nc1, nc2 = rotct_rand_clus(i1,i2,A)
        print 'rotct_rand_clus crossover test SUCCESSFUL'
    except Exception, e:
        print 'ERROR: rotct_rand_clus crossover test FAILED'
        print e
        pass
    try:
        from MAST.structopt.crossover.rotct_rand import rotct_rand
        i1 = ind1.duplicate()
        i2 = ind2.duplicate()
        nc1, nc2 = rotct_rand(i1,i2,A)
        print 'rotct_rand crossover test SUCCESSFUL'
    except Exception, e:
        print 'ERROR: rotct_rand crossover test FAILED'
        print e
        pass
    try:
        from MAST.structopt.crossover.rotct import rotct
        i1 = ind1.duplicate()
        i2 = ind2.duplicate()
        nc1, nc2 = rotct(i1,i2,A)
        print 'rotct crossover test SUCCESSFUL'
    except Exception, e:
        print 'ERROR: rotct crossover test FAILED'
        print e
        pass
    print 'Crossover Function Testing Complete'
    return