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

net.sourceforge.cilib.pso.crossover.pbestupdate.BestParentOffspringPBestProvider Maven / Gradle / Ivy

Go to download

A library of composable components enabling simpler Computational Intelligence

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

import java.util.List;
import net.sourceforge.cilib.pso.particle.Particle;
import net.sourceforge.cilib.type.types.container.StructuredType;
import net.sourceforge.cilib.util.selection.recipes.ElitistSelector;

/**
 * This OffspringPBestProvider sets an offspring's pBest to the best parent's pBest.
 */
public class BestParentOffspringPBestProvider extends OffspringPBestProvider {
    @Override
    public StructuredType f(List parents, Particle offspring) {
        return new ElitistSelector().on(parents).select().getBestPosition();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy