net.sourceforge.cilib.pso.guideprovider.NonDominatedGuideProvider Maven / Gradle / Ivy
/** __ __
* _____ _/ /_/ /_ Computational Intelligence Library (CIlib)
* / ___/ / / / __ \ (c) CIRG @ UP
* / /__/ / / / /_/ / http://cilib.net
* \___/_/_/_/_.___/
*/
package net.sourceforge.cilib.pso.guideprovider;
import fj.data.List;
import net.sourceforge.cilib.algorithm.AbstractAlgorithm;
import net.sourceforge.cilib.pso.particle.Particle;
import net.sourceforge.cilib.entity.Topologies;
import net.sourceforge.cilib.entity.comparator.NonDominatedFitnessComparator;
import net.sourceforge.cilib.pso.PSO;
import net.sourceforge.cilib.type.types.container.StructuredType;
/**
*
*/
public class NonDominatedGuideProvider implements GuideProvider {
@Override
public NonDominatedGuideProvider getClone() {
return this;
}
@Override
public StructuredType get(Particle particle) {
PSO pso = (PSO) AbstractAlgorithm.get();
List topology = pso.getTopology();
Particle gbest = Topologies.getBestEntity(topology, new NonDominatedFitnessComparator());
return gbest.getBestPosition();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy