es.ucm.fdi.gaia.jcolibri.method.maintenance.AbstractCaseBaseEditMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jCOLIBRI Show documentation
Show all versions of jCOLIBRI Show documentation
jCOLIBRI is a java framework for the development of Case-Based Reasoning systems.
package es.ucm.fdi.gaia.jcolibri.method.maintenance;
import java.util.Collection;
import es.ucm.fdi.gaia.jcolibri.cbrcore.CBRCase;
import es.ucm.fdi.gaia.jcolibri.cbrcore.CBRCaseBase;
import es.ucm.fdi.gaia.jcolibri.method.reuse.classification.KNNClassificationConfig;
/**
* Provides the ability to run a case base editing algorithm on
* a case base.
*
* @author Lisa Cummins
* @author Derek Bridge
* 18/05/07
*/
public abstract class AbstractCaseBaseEditMethod {
/**
* Simulates a case base editing algorithm, returning the cases
* that would be deleted by the algorithm.
* @param cases The group of cases on which to perform editing.
* @param simConfig The similarity configuration for these cases.
* @return the list of cases that would be deleted by the algorithm.
*/
public abstract Collection retrieveCasesToDelete(Collection cases, KNNClassificationConfig simConfig);
/**
* Runs a case base editing algorithm on the given case base.
* @param caseBase The case base on which to perform editing.
* @param simConfig The similarity configuration for the case
* base.
*/
public void edit(CBRCaseBase caseBase, KNNClassificationConfig simConfig)
{ Collection casesToDelete = retrieveCasesToDelete(caseBase.getCases(), simConfig);
caseBase.forgetCases(casesToDelete);
}
}