net.sourceforge.cilib.pso.dynamic.responsestrategies.NeighbourhoodBestSentriesReactionStrategy Maven / Gradle / Ivy
/** __ __
* _____ _/ /_/ /_ Computational Intelligence Library (CIlib)
* / ___/ / / / __ \ (c) CIRG @ UP
* / /__/ / / / /_/ / http://cilib.net
* \___/_/_/_/_.___/
*/
package net.sourceforge.cilib.pso.dynamic.responsestrategies;
import net.sourceforge.cilib.algorithm.population.SinglePopulationBasedAlgorithm;
import net.sourceforge.cilib.entity.Entity;
import net.sourceforge.cilib.entity.Topologies;
import net.sourceforge.cilib.pso.particle.Particle;
public class NeighbourhoodBestSentriesReactionStrategy extends EnvironmentChangeResponseStrategy {
private static final long serialVersionUID = -2142727048293776335L;
public NeighbourhoodBestSentriesReactionStrategy(NeighbourhoodBestSentriesReactionStrategy rhs) {
super(rhs);
}
@Override
public NeighbourhoodBestSentriesReactionStrategy getClone() {
return new NeighbourhoodBestSentriesReactionStrategy(this);
}
@Override
protected > void performReaction(
A algorithm) {
for (Entity entity : Topologies.getNeighbourhoodBestEntities(algorithm.getTopology(), algorithm.getNeighbourhood())) {
entity.getCandidateSolution().randomise();
// TODO: What is the influence of reevaluation?
// entity.calculateFitness(false);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy