net.sourceforge.cilib.util.selection.weighting.SocialBestFitness Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cilib-library Show documentation
Show all versions of cilib-library Show documentation
A library of composable components enabling simpler Computational Intelligence
/** __ __
* _____ _/ /_/ /_ Computational Intelligence Library (CIlib)
* / ___/ / / / __ \ (c) CIRG @ UP
* / /__/ / / / /_/ / http://cilib.net
* \___/_/_/_/_.___/
*/
package net.sourceforge.cilib.util.selection.weighting;
import net.sourceforge.cilib.entity.Entity;
import net.sourceforge.cilib.entity.SocialEntity;
import net.sourceforge.cilib.problem.solution.Fitness;
/**
* Obtain the social best fitness value from a {@link SocialEntity}.
* @param The type that is both an {@code Entity} and a {@code SocialEntity}.
* An example of such an entity is the {@link net.sourceforge.cilib.entity.Particle}.
*/
public class SocialBestFitness implements EntityFitness {
/**
* {@inheritDoc}
* Obtains the social based fitness from the {@link SocialEntity}.
*/
@Override
public Fitness getFitness(E entity) {
return entity.getSocialFitness();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy