All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.cilib.pso.crossover.particleprovider.WorstParentParticleProvider Maven / Gradle / Ivy

/**           __  __
 *    _____ _/ /_/ /_    Computational Intelligence Library (CIlib)
 *   / ___/ / / / __ \   (c) CIRG @ UP
 *  / /__/ / / / /_/ /   http://cilib.net
 *  \___/_/_/_/_.___/
 */
package net.sourceforge.cilib.pso.crossover.particleprovider;

import fj.data.List;
import net.sourceforge.cilib.pso.particle.Particle;
import net.sourceforge.cilib.util.selection.Samples;
import net.sourceforge.cilib.util.selection.recipes.ElitistSelector;

/**
 * This ParticleProvider selects a particle's worst parent to be replaced.
 */
public class WorstParentParticleProvider extends ParticleProvider {
    @Override
    public Particle f(List parents, Particle offspring) {
        return new ElitistSelector().on(parents).select(Samples.last()).get(0);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy