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

net.sourceforge.cilib.pso.dynamic.responsestrategies.ArchiveAlwaysClearingResponseStrategy 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.dynamic.responsestrategies;

import net.sourceforge.cilib.algorithm.population.PopulationBasedAlgorithm;
import net.sourceforge.cilib.moo.archive.Archive;

/**
 * This strategy responds to a change by removing all solutions from the archive.
 * This may be required when dealing with dynamic MOO functions where the POF
 * changes from concave to convex or from convex to concave.
 *
 */
public class ArchiveAlwaysClearingResponseStrategy extends
        EnvironmentChangeResponseStrategy{

    private static final long serialVersionUID = -3042868407937040175L;

    /**
     * @{@inheritDoc}
     */
    @Override
    public EnvironmentChangeResponseStrategy getClone() {
        return this;
    }

    /**
     * Responds to a change by removing all solutions from the archive.
     * @param algorithm The algorithm to perform the response on.
     */
    @Override
    protected void performReaction(PopulationBasedAlgorithm algorithm) {
        //clearing all solutions from the archive
    	Archive.Provider.get().clear();
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy