예제 #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
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
        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_stem.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_stem.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