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

net.sourceforge.cilib.pso.pbestupdate.BoundedNonDominatedPersonalBestUpdateStrategy Maven / Gradle / Ivy

Go to download

A library of composable components enabling simpler Computational Intelligence

There is a newer version: 0.8
Show newest version
/**           __  __
 *    _____ _/ /_/ /_    Computational Intelligence Library (CIlib)
 *   / ___/ / / / __ \   (c) CIRG @ UP
 *  / /__/ / / / /_/ /   http://cilib.net
 *  \___/_/_/_/_.___/
 */
package net.sourceforge.cilib.pso.pbestupdate;

import net.sourceforge.cilib.entity.EntityType;
import net.sourceforge.cilib.pso.particle.Particle;
import net.sourceforge.cilib.problem.solution.InferiorFitness;
import net.sourceforge.cilib.type.types.Types;

/**
 * 

* Implementation of {@link GuideUpdateStrategy} where a particle's guide * can get updated if the new guide is not dominated by the current guide, * i.e. both of the guides are non-dominated. If both guides are non- * dominated the new guide is selected. *

* * */ public class BoundedNonDominatedPersonalBestUpdateStrategy extends NonDominatedPersonalBestUpdateStrategy { /** * {@inheritDoc} */ @Override public PersonalBestUpdateStrategy getClone() { return this; } /** * If the current fitness is better than the best fitness, or both are * non-dominated, update the best fitness to the current fitness. * * If the current fitness is not updated, increase the particle's pbest stagnation counter. * @param particle The particle to update. */ @Override public void updatePersonalBest(Particle particle) { if (!Types.isInsideBounds(particle.getPosition())) { particle.getProperties().put(EntityType.FITNESS, InferiorFitness.instance()); return; } super.updatePersonalBest(particle); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy