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

es.ucm.fdi.gaia.jcolibri.method.maintenance.AbstractCaseBaseEditMethod Maven / Gradle / Ivy

Go to download

jCOLIBRI is a java framework for the development of Case-Based Reasoning systems.

There is a newer version: 3.2
Show newest version
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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy