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

net.sourceforge.cilib.pso.crossover.particleprovider.GBestParticleProvider 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.algorithm.AbstractAlgorithm;
import net.sourceforge.cilib.algorithm.population.SinglePopulationBasedAlgorithm;

import net.sourceforge.cilib.entity.Topologies;
import net.sourceforge.cilib.entity.comparator.SocialBestFitnessComparator;
import net.sourceforge.cilib.pso.particle.Particle;

public class GBestParticleProvider extends ParticleProvider {

    @Override
    public Particle f(List parents, Particle offspring) {
        return Topologies.getBestEntity((List) ((SinglePopulationBasedAlgorithm) AbstractAlgorithm.get()).getTopology(), new SocialBestFitnessComparator());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy