4678e49d41959e8c66e656c3b4fca59e2dd11d1f,GA.py,,GA,#Any#Any#Any#Any#Any#Any#,265

Before Change


    for l in range(iters):
        
        //Loop through chromosomes in population
        for i in range(0,PopSize):
            // Return back the search agents that go beyond the boundaries of the search space
            ga[i,:]=numpy.clip(ga[i,:], lb, ub)

            // Calculate objective function for each search agent
            fitness=objf(ga[i,:])     
            
            scores[i] = fitness
                
            if(bestScore>fitness):
                bestScore=fitness
                bestIndividual=numpy.copy(ga[i,:])
        
        //Apply evolutionary operators to chromosomes
        ga = runOperators(ga, scores, bestIndividual, bestScore, cp, mp, PopSize, lb, ub) 
                    
        convergence_curve[l]=bestScore
     

After Change


    s=solution()
        
    bestIndividual=numpy.zeros(dim)    
    scores=numpy.random.uniform(0.0, 1.0, PopSize) 
    bestScore=float("inf")
    
    ga=numpy.random.uniform(0,1,(PopSize,dim)) *(ub-lb)+lb
    convergence_curve=numpy.zeros(iters)
    
    print("GA is optimizing  \""+objf.__name__+"\"")  
    
    timerStart=time.time() 
    s.startTime=time.strftime("%Y-%m-%d-%H-%M-%S")
    
    for l in range(iters):

        //crossover
        ga = crossoverPopulaton(ga, scores, PopSize, cp, keep)
           
        //mutation
        mutatePopulaton(ga, PopSize, mp, keep, lb, ub)
           
        ga = clearDups(ga, lb, ub)
        
        scores = calculateCost(objf, ga, PopSize, lb, ub)
            
        bestScore = min(scores)
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: 7ossam81/EvoloPy
Commit Name: 4678e49d41959e8c66e656c3b4fca59e2dd11d1f
Time: 2019-03-08
Author: raneem.qaddoura@gmail.com
File Name: GA.py
Class Name:
Method Name: GA


Project Name: 7ossam81/EvoloPy
Commit Name: 4678e49d41959e8c66e656c3b4fca59e2dd11d1f
Time: 2019-03-08
Author: raneem.qaddoura@gmail.com
File Name: GA.py
Class Name:
Method Name: GA


Project Name: geomstats/geomstats
Commit Name: 26138c45ee77d508abb928e8adc6a77aa2e9d149
Time: 2018-09-14
Author: ninamio78@gmail.com
File Name: tests/test_hypersphere_tensorflow.py
Class Name: TestHypersphereOnTensorFlow
Method Name: test_exp_vectorization


Project Name: geomstats/geomstats
Commit Name: d1d8284dd21afef5f5cc3e0b98f67a9dab4d57cd
Time: 2018-09-12
Author: ninamio78@gmail.com
File Name: tests/test_hypersphere_tensorflow.py
Class Name: TestHypersphereOnTensorFlow
Method Name: test_exp_vectorization