Exemplo n.º 1
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)
Exemplo n.º 2
0
     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
 try:
     from MAST.structopt_stem.crossover.NewClus import NewClus
     i1 = ind1.duplicate()
     i2 = ind2.duplicate()
     nc1, nc2 = NewClus(i1,i2,A)
     print 'NewClus crossover test SUCCESSFUL'
 except Exception, e:
     print 'ERROR: NewClus crossover test FAILED'
     print e
     pass