@crossover
def laplace_crossover(random, mom, dad, args):
    crossover_rate = args.setdefault('crossover_rate', 1.0)
    if random.random() < crossover_rate:
        bounder = args['_ec'].bounder
        a = args.setdefault('lx_location', 0)
        b = args.setdefault('lx_scale', 0.5)
        bro = copy.copy(dad)
        sis = copy.copy(mom)
        for i, (m, d) in enumerate(zip(mom, dad)):
            u = random.random()
            if random.random() <= 0.5:
                beta = a - b * math.log(u)
            else:
                beta = a + b * math.log(u)
            bro[i] = m + beta * abs(m - d)
            sis[i] = d + beta * abs(m - d)
        bro = bounder(bro, args)
        sis = bounder(sis, args)
        return [bro, sis]
    else:
        return [mom, dad]
Return the offspring of Laplace crossover on the candidates.
dataset/ETHPy150Open aarongarrett/inspyred/inspyred/ec/variators/crossovers.py/laplace_crossover