These are chat archives for DEAP/deap

Jun 2016
Fran├žois-Michel De Rainville
Jun 29 2016 10:03
@shivamkalra Checkout the OneMax example
This message was deleted
@manuparra a) yes b) no, not entirely. The evolution loop is a markov process and thus the next generation depends on the the previous ones. But, there is something called the Island model where the population is divided in a few subgroups that are independent for a few generation and then share individuals through migration. There is an example of this model (parallelized) in the examples/ga folder.
Manuel Parra
Jun 29 2016 15:02

Thanks @fmder. I'm trying to parallelize Mutation as follow:

def mutparallel(indpb,segment):
    for i in xrange(len(segment)):    
        if random.random() < indpb:
            #change[i] some value
    return segment

And then, my mutation function is:

def basicmutation(individual,indpb)

    size = len(individual)    


    pool = mp.Pool(cores)

    # Numeber of elements to parallelize for each core

    # Split individual in a list with X lists of slice_len size
    segments=[individual[i:i+slice_len] for i in range(0, size, slice_len)]

    # Parameters 
    func = partial(mutparallel, indpb)

    # Map,segments)



    return individual,

And now: Must I use deepcopy to return mutated individual ?